I logged into aws console with DevUser role and updated bucket policy with deny all as per below:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement1",
"Principal": "*",
"Effect": "Deny",
"Action": "*",
"Resource": "arn:aws:s3:::bucketName"
}
]
}
After doing this i am not able to list bucket permissions or view anything under the bucket as expected, now i want to revert this change but i am not able to neither with DevUser nor with AdminUser role. I also tried to delete bucket policy using cli but did not work:
aws s3api delete-bucket-policy --bucket bucketName
Error:
An error occurred (AccessDenied) when calling the DeleteBucketPolicy operation: Access Denied
How can I revert the DENY all change?