Skip to content

Instantly share code, notes, and snippets.

@joshuaquek
Created February 22, 2020 12:03
Show Gist options
  • Select an option

  • Save joshuaquek/94316cb443862f9aebdaeb3954a877c0 to your computer and use it in GitHub Desktop.

Select an option

Save joshuaquek/94316cb443862f9aebdaeb3954a877c0 to your computer and use it in GitHub Desktop.

Revisions

  1. joshuaquek created this gist Feb 22, 2020.
    1 change: 1 addition & 0 deletions .S3-bucket-programmatic-access
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Summary: IAM Policy that allows S3 programmatic access to only one bucket, while still being able to view the list of all available buckets (but not all those buckets' contents)
    30 changes: 30 additions & 0 deletions iam-policy.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Sid": "Stmt1480515305000",
    "Effect": "Allow",
    "Action": [
    "s3:ListAllMyBuckets",
    "s3:GetBucketLocation"
    ],
    "Resource": [
    "arn:aws:s3:::*"
    ]
    },
    {
    "Sid": "Stmt1480515305002",
    "Effect": "Allow",
    "Action": [
    "s3:List*",
    "s3:GetObject",
    "s3:PutObject",
    "s3:DeleteObject"
    ],
    "Resource": [
    "arn:aws:s3:::my-secret-bucket-arn-name",
    "arn:aws:s3:::my-secret-bucket-arn-name/*"
    ]
    }
    ]
    }