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 China, please refer to: Enable access logs for Application Load Balancer - Elastic Load Balancing (amazonaws.cn) https://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/*"
}
]
}