Last active
February 24, 2023 15:08
-
-
Save moonape1226/96f9191ec8933d6b6964e61e6d5f3521 to your computer and use it in GitHub Desktop.
S3 bucket policy for storing AWS ALB access log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"AWS": "arn:aws:iam::${aws_elb_account_id}:root" | |
}, | |
"Action": "s3:PutObject", | |
"Resource": "arn:aws:s3:::${bucket_name}/prefix/AWSLogs/${your_account_id}/*" | |
}, | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "delivery.logs.amazonaws.com" | |
}, | |
"Action": "s3:PutObject", | |
"Resource": "arn:aws:s3:::${bucket_name}/prefix/AWSLogs/${your_account_id}/*", | |
"Condition": { | |
"StringEquals": { | |
"s3:x-amz-acl": "bucket-owner-full-control" | |
} | |
} | |
}, | |
{ | |
"Effect": "Allow", | |
"Principal": { | |
"Service": "delivery.logs.amazonaws.com" | |
}, | |
"Action": "s3:GetBucketAcl", | |
"Resource": "arn:aws:s3:::${bucket_name}" | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment