deeno james
deeno james

Reputation: 27

How to create an IAM Policy for a specific Role and give access to s3bucket get and put operations

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": "*"
        }
    ]
}

this is my amazons3fullaccess policy but now i want to give only get put and delete access not full access

Upvotes: 1

Views: 17

Answers (1)

Marcin
Marcin

Reputation: 238051

You could do the following using wildcards:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": ["s3:put*", "s3:delete*", "s3:get*"],
            "Resource": "*"
        }
    ]
}

Or if you want to be more specific (good practice!):

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": ["s3:putObject", "s3:deleteObject", "s3:getObject"],
            "Resource": "*"
        }
    ]
}

Upvotes: 1

Related Questions