I used the AWS Policy Generator to create a policy for my S3 bucket. Unfortunately, I closed the Policy Generator console, so I no longer have access to the actual JSON file. After completing the policy generator requirements, I clicked the optional "Add Condition" feature as an experiment, which correctly generated an "Effect is to Deny" condition in JSON language. After generating the policy, I copied it and pasted it into the bucket's policy editing space and saved it.
Now, I am unable to edit the policy because of the "You don’t have permission to get bucket policy" error, which is an AWS-generated exception under the "Edit" of "Bucket Policy."
Please be advised that I have the option to delete the bucket entirely since it is empty, and create a new bucket with the same name, generating a new policy with the "allow" keyword.
The potential question is, without deleting the current bucket and its existing "deny" policy, which was generated as previously described above, is there any way to edit that bucket policy without deleting the current bucket?
The bucket policy "Edit" button is grayed out and not clickable in this matter.
Snapshoot: You don’t have permission to get bucket policy!
There are no proper tags in relation to the above matter!
The IAM Policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "",
"Resource": ""
}
]
}