-1

Learning AWS and mucking about with buckets. I tried to configure a logging bucket for a project, with the following logging.json used for the put-bucket-logging command in the cli:

{
    "LoggingEnabled": {
        "TargetBucket": "logs.bucketname.com",
        "TargetPrefix": "bucketLogs/",
        "TargetGrants": [
            {
                "Grantee": {
                    "Type": "AmazonCustomerByEmail",
                    "EmailAddress": "username@email.com"
                },
                "Permission": "FULL_CONTROL"
            },
            {
                "Grantee": {
                    "Type": "Group",
                    "URI": "http://acs.amazonaws.com/groups/global/AllUsers"
                },
                "Permission": "READ"
            }
        ]
    }
}

And after receiving a message in the buckets overview tab in the S3 management console stating "Error: Access Denied", I've been trying to set up a policy that will give me access back so I can just delete the bucket and start over. The policy now looks like this:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": [
                "s3:GetObject",
                "s3:DeleteObject",
                "s3:PutObject"
            ],
            "Resource": "arn:aws:s3:::logs.bucketname.com/*"
        }
    ]
}

I'm not sure how any of this has caused the root user to be unable to access or delete the bucket in the console. Please advise.

  • "And after observing the error" ...what was the error you observed? – Michael - sqlbot Sep 20 '17 at 12:00
2

I'm not sure how any of this has caused the root user to be unable to access or delete the bucket in the console.

... it's because you set a policy that doesn't grant anyone the right to delete the bucket. Funnily enough, if you tell AWS to not let anyone delete a bucket, AWS will not let anyone delete the bucket. If you want someone to be able to delete the bucket, you'll need to grant them the s3:DeleteBucket policy.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.