Error
Load Balancer의 로그를 보기 위해 Access Log를 활성화하였는데 아래와 같은 에러가 발생했다.
Access Denied for bucket please check s3bucket permission

Solution
생성한 S3 버킷의 권한 설정을 해주어야 한다.
S3 > 버킷 > 권한 > 편집으로 이동



버킷 정책부분의 내용을 수정하면 되는데 다음 내용을 아래와 같이 수정하여 정책에 붙여넣는다.

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::elb-account-id:root"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::bucket-name/prefix/AWSLogs/your-aws-account-id/*"
},
{
"Effect": "Allow",
"Principal": {
"Service": "delivery.logs.amazonaws.com"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::bucket-name/prefix/AWSLogs/your-aws-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"
}
]
}
- bucket-name/prefix : S3 버킷의 이름과 prefix
- your-aws-account-id : AWS 계정 ID
- elb-account-id : 서울 600734575887

수정 후 다시 엑세스를 활성화하면 정상적으로 활성화 된 것을 확인할 수 있다.

참고 :
https://docs.aws.amazon.com/ko_kr/elasticloadbalancing/latest/classic/enable-access-logs.html
Enable access logs for your Classic Load Balancer - Elastic Load Balancing
If you will use the console to enable access logs, you can skip this step and have Elastic Load Balancing create a bucket with the required permissions for you. If you will use the AWS CLI to enable access logs, you must create the bucket and grant the req
docs.aws.amazon.com
'Cloud > aws' 카테고리의 다른 글
[AWS] Rest Request GET 요청 시 query parameter 없어짐 (0) | 2024.05.09 |
---|---|
[AWS] AWS Certificate Manager(ACM)를 이용하여 인증서 발급하기 (검증 대기 중 해결) (1) | 2022.11.11 |
[AWS] EC2, Load Balancer SSL인증서를 이용하여 https 설정하기 (1) | 2022.09.20 |
Error
Load Balancer의 로그를 보기 위해 Access Log를 활성화하였는데 아래와 같은 에러가 발생했다.
Access Denied for bucket please check s3bucket permission

Solution
생성한 S3 버킷의 권한 설정을 해주어야 한다.
S3 > 버킷 > 권한 > 편집으로 이동



버킷 정책부분의 내용을 수정하면 되는데 다음 내용을 아래와 같이 수정하여 정책에 붙여넣는다.

{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::elb-account-id:root"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::bucket-name/prefix/AWSLogs/your-aws-account-id/*"
},
{
"Effect": "Allow",
"Principal": {
"Service": "delivery.logs.amazonaws.com"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::bucket-name/prefix/AWSLogs/your-aws-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"
}
]
}
- bucket-name/prefix : S3 버킷의 이름과 prefix
- your-aws-account-id : AWS 계정 ID
- elb-account-id : 서울 600734575887

수정 후 다시 엑세스를 활성화하면 정상적으로 활성화 된 것을 확인할 수 있다.

참고 :
https://docs.aws.amazon.com/ko_kr/elasticloadbalancing/latest/classic/enable-access-logs.html
Enable access logs for your Classic Load Balancer - Elastic Load Balancing
If you will use the console to enable access logs, you can skip this step and have Elastic Load Balancing create a bucket with the required permissions for you. If you will use the AWS CLI to enable access logs, you must create the bucket and grant the req
docs.aws.amazon.com
'Cloud > aws' 카테고리의 다른 글
[AWS] Rest Request GET 요청 시 query parameter 없어짐 (0) | 2024.05.09 |
---|---|
[AWS] AWS Certificate Manager(ACM)를 이용하여 인증서 발급하기 (검증 대기 중 해결) (1) | 2022.11.11 |
[AWS] EC2, Load Balancer SSL인증서를 이용하여 https 설정하기 (1) | 2022.09.20 |