Skip to content

Instantly share code, notes, and snippets.

@ramhoj
Last active August 16, 2017 17:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ramhoj/7fa795a68f5eec09046a9ae18c03d8da to your computer and use it in GitHub Desktop.
Save ramhoj/7fa795a68f5eec09046a9ae18c03d8da to your computer and use it in GitHub Desktop.
AWS IAM S3 read/write only policy
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation",
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::my-app-builds",
"arn:aws:s3:::my-app-builds/*"
]
}
]
}
{
"Statement": [
{
"Action": [
"s3:PutObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::my-app-builds"
]
},
{
"Action": [
"s3:PutObject"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::my-app-builds/*"
]
}
]
}
@nskitch
Copy link

nskitch commented Aug 16, 2017

s3_write_only_policy.json. Seems like you can just combine these. Resource is a list, so it can looks like this:

{
  "Statement": [
    {
      "Action": [
        "s3:PutObject"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::my-app-builds/*",
        "arn:aws:s3:::my-app-builds"
      ]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment