I accidentally denied everyone access to my Amazon S3 bucket. How do I regain access?

To Nha Notes | April 19, 2024, 4:30 p.m.

Hi, this morning logged in my admin account I inserted a bucket policy like this one:

{ "Version": "2012-10-17", "Id": "Policy1415115909153", "Statement": [ { "Sid": "Access-to-specific-VPC-only", "Principal": "", "Action": "s3:", "Effect": "Deny", "Resource": ["arn:aws:s3:::awsexamplebucket1", "arn:aws:s3:::awsexamplebucket1/*"], "Condition": { "StringNotEquals": { "aws:SourceVpc": "vpc-111bbb22" } } } ] }

for my bucket and my vpc. Now I'm not able to access the bucket nor remove the policy. Is it possible to do something? I don't want to delete the bucket.... Many thanks!

 

You can remove bucket policy using root account. please take a look below steps. https://repost.aws/knowledge-center/s3-accidentally-denied-access

References

https://repost.aws/questions/QU9EtM-52cTE2YqRIcG6S5cQ/s3-bucket-policy-not-accessible-by-anyone-anymore

https://repost.aws/knowledge-center/change-vpc-endpoint-s3-bucket-policy

https://repost.aws/knowledge-center/s3-accidentally-denied-access