Skip to content

Instantly share code, notes, and snippets.

@jasonmccay
Created January 16, 2012 05:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonmccay/1619242 to your computer and use it in GitHub Desktop.
Save jasonmccay/1619242 to your computer and use it in GitHub Desktop.
IAM Permissions Example
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::*"
},
{
"Action": [
"s3:PutObject",
"s3:PutObjectAcl",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:DeleteObject",
"s3:DeleteObjectAcl"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::MY-BACKUP-BUCKET/*"
]
}
]
}
@Winslett
Copy link

Winslett commented Mar 7, 2012

Need to append "s3:ListBucket" to your first list of actions, to change the output to:

{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::"
},
{
"Action": [
"s3:PutObject",
"s3:PutObjectAcl"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::MY-BACKUP-BUCKET/
"
]
}
]
}

@jasonmccay
Copy link
Author

Cool, thank you. Change is made.

@Winslett
Copy link

To restore your data, you will need to add the following:

    "s3:GetObject",
    "s3:GetObjectAcl"

You will need to add that in the block:

 "Action": [
    "s3:PutObject",
    "s3:PutObjectAcl"
  ]

@Winslett
Copy link

For MongoHQ to manage your files (i.e. delete older versions, you will need to add the following:

    "s3:DeleteObject",
    "s3:DeleteObjectAcl"

You will need to add that in the block:

   "Action": [
      "s3:PutObject",
      "s3:PutObjectAcl"
    ],

@jasonmccay
Copy link
Author

Thanks ... made these changes.

@Winslett
Copy link

Winslett commented Jun 1, 2012

Confirmed there is a typo in this gist:

Replace:

"s3:ListBuckets"

with

 "s3:ListBucket"

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