Support Documents

Using AWS S3 to Store ELB Access Logs

Lab Details

  1. This lab walks you through the steps to create an ELB and store ELB access logs in an S3 Bucket.

  2. In this lab, you will create two EC2 instances and attach them to an elastic load balancer.

  3. You will also enable Access logs in ELB and configure the ELB to send the logs to an S3 Bucket.

  4. Duration: 1 hour

  5. AWS Region: US East (N. Virginia) us-east-1


Elastic Load Balancer

  1. Load Balancer is a service that allows you to distribute incoming application or network traffic across multiple targets, such as Amazon EC2 instances, containers, and IP addresses across multiple Availability Zones.

  2. AWS currently offers four types of load balancers:

  • Application Load Balancer

  • Network Load Balancer

  • Classic Load Balancer

  • Gateway Load Balancer.

  • Application Load Balancer is best suited for load balancing of HTTP and HTTPS traffic.

  • Network Load Balancer is used to distribute the traffic or load using TCP/UDP protocols. 

  • Classic Load Balancer provides basic load balancing across multiple Amazon EC2 instances.

  • Gateway Load Balancers use Gateway Load Balancer endpoints to securely exchange traffic across VPC boundaries.

Storing ELB Access logs in S3

  1. ELB access logs provide detailed information regarding the request received by the load balancer.

  2. Log files contain detailed information such as the time of the request, IP Address of the client, path of the request and the response from the server.

  3. ELB access log feature is an optional feature.

  4. You can use these access logs to analyze traffic patterns and troubleshoot issues.   

  5. Log files stored in S3 bucket are encrypted with a unique key.

  6. There is no additional charge for access logs. You are charged storage costs in S3, but you are not charged for the bandwidth used by Elastic Load Balancing to send log files to Amazon S3.       

  7. When managing multiple environments, it would be better to store the logs in separate S3 buckets so that it will be easy to find logs for a specific environments.     

Architecture Diagram


Task Details:

  1. Launching Lab Environment.

  2. Launching two web servers with apache service installed.

  3. Creating a Target Group.

  4. Creating an Application Load Balancer.

  5. Configuring the Load Balancer to store Access logs in S3 bucket.

  6. Testing the Load Balancer and Stored Access Logs.

  7. Validation of the Lab.

  8. Deleting AWS Resources.