Skip to content

Instantly share code, notes, and snippets.

@harshavardhana
Last active September 9, 2021 03:49
Show Gist options
  • Save harshavardhana/c0982d12243f8b7b0735680b4e5da784 to your computer and use it in GitHub Desktop.
Save harshavardhana/c0982d12243f8b7b0735680b4e5da784 to your computer and use it in GitHub Desktop.

IAM policy recipes

Public Read Write

Type: bucket

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "s3:GetBucketLocation",
        "s3:ListBucket",
        "s3:ListBucketMultipartUploads"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::YOUR-BUCKET"
      ],
      "Sid": ""
    },
    {
      "Action": [
        "s3:AbortMultipartUpload",
        "s3:DeleteObject",
        "s3:GetObject",
        "s3:ListMultipartUploadParts",
        "s3:PutObject"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::YOUR-BUCKET/*"
      ],
      "Sid": ""
    }
  ]
}

Public Read Only

Type: bucket

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "s3:GetBucketLocation",
        "s3:ListBucket"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::YOUR-BUCKET"
      ],
      "Sid": ""
    },
    {
      "Action": [
        "s3:GetObject"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::YOUR-BUCKET/*"
      ],
      "Sid": ""
    }
  ]
}

Public Write Only

Type: bucket

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": [
        "s3:GetBucketLocation",
        "s3:ListBucketMultipartUploads"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::YOUR-BUCKET"
      ],
      "Sid": ""
    },
    {
      "Action": [
        "s3:AbortMultipartUpload",
        "s3:DeleteObject",
        "s3:ListMultipartUploadParts",
        "s3:PutObject"
      ],
      "Effect": "Allow",
      "Resource": [
        "arn:aws:s3:::YOUR-BUCKET/*"
      ],
      "Sid": ""
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment