Locking down access to an S3 bucket

Report a typo

You need to create a JSON policy that will control the delete action on an S3 bucket named hyper-bucket. This policy should deny the DeleteObject action for all users except the root user of the AWS account with the account ID 123456789012. Apply the policy specifically to the hyper-bucket resource.

Here are the details you need to include in your policy:

  • Policy Version — use the version "2012-10-17";

  • Effect — set this to "Deny" to prevent actions;

  • Action — restrict the DeleteObject action;

  • Resource — specify the ARN of the bucket hyper-bucket;

  • Condition — include a condition to exempt the root user's ARN for an account with the ID 123456789012 from this denial. The root user should still be able to delete objects from the bucket.

Please write the JSON policy in the space provided below, ensuring it matches the requirements.

Enter a short text

Create a free account to access the full topic