Description
ALB access logs record request paths, response status and processing times. Delivery is best effort, so individual requests may be absent.
Potential impact
Missing records make it harder to trace slow responses, errors and unexpected traffic.
Remediation
Set access_logs.s3.enabled to true and access_logs.s3.bucket to a bucket in the ALB’s Region. Allow log delivery in the bucket policy and set retention. Send test traffic, then check newly delivered access logs for the request path and status.
Examples
Provide the subnets, security group and LogBucketName referenced in the template.
Before
yaml
Resources:
LoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Subnets: !Ref Subnets
SecurityGroups:
- !Ref SecurityGroup
After
yaml
Resources:
LoadBalancer:
Type: AWS::ElasticLoadBalancingV2::LoadBalancer
Properties:
Subnets: !Ref Subnets
SecurityGroups:
- !Ref SecurityGroup
LoadBalancerAttributes:
- Key: access_logs.s3.enabled
Value: 'true'
- Key: access_logs.s3.bucket
Value: !Ref LogBucketName