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

17 views Asked by At
{
    "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

1

There are 1 answers

0
Marcin On

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": "*"
        }
    ]
}