AWS ALB ELB exports logs to S3 No permission error

The AWS ALB ELB log function can be turned on in the properties tab:

 However, direct configuration will report a permissionless error.

According to the official documentation, you need to configure the S3 bucket policy.

AWS Global请参考:Enable access logs for your Application Load Balancer - Elastic Load Balancing (amazon.com)icon-default.png?t=N176https://docs.aws.amazon.com/elasticloadbalancing/latest/application/enable-access-logging.html#attach-bucket-policy

AWS China, please refer to: Enable access logs for Application Load Balancer - Elastic Load Balancing (amazonaws.cn) icon-default.png?t=N176https://docs.amazonaws.cn/elasticloadbalancing/latest/application/enable-access-logging.html

Pay special attention to this paragraph:

Replace  elb-account-id with the ID of the Amazon Web Services account used for Elastic Load Balancing in your region:

  • China (Beijing) – 638102146993

  • China (Ningxia) – 037604701340

The IDs of these two AWS Accounts are the AWS Account where the ELB is located.

Reference Code:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws-cn:iam::638102146993:root"
            },
            "Action": "s3:*",
            "Resource": "arn:aws-cn:s3:::supero-poc-alb-logs/*"
        }
    ]
}

Guess you like

Origin blog.csdn.net/rav009/article/details/129503101