Question:
An error occurred (AccessDenied) when calling the DeleteBucket operation: Access Denied
1 2 |
[ec2-user@ip-172-31-31-84 temp]$ aws s3 rb --force s3://elasticbeanstalk-us-east-2-719330736384/ |
remove_bucket failed: s3://elasticbeanstalk-us-east-2-719330736384/ An error occurred (AccessDenied) when calling the DeleteBucket operation: Access Denied
Answer:
Elastic Beanstalk Bucket policies by default denies deletion.
Go to the bucket’s policy (bucket –> properties –> permissions –> edit bucket policy)
Then find this statement
1 2 3 4 5 6 7 8 9 10 |
{ "Sid": xxxxxxxxx, "Effect": "Deny", "Principal": { "AWS": "*" }, "Action": "s3:DeleteBucket", "Resource": xxxxxxxxxx } |
Change the Effect from Deny to Allow.
Save the change to the Bucket Policy.
Try deleting again.