Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit d800faa

Browse files
authored
docs: add example IAM policy to README (#44)
1 parent 8eb1eab commit d800faa

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,34 @@ module.exports = {
4444

4545
You can use the plugin both with private and public buckets.
4646

47-
```json
47+
We recommend creating an IAM user to use with this plugin, and attach an IAM
48+
policy to access specific buckets.
49+
50+
The policy needs to allow `ListBucket` on buckets and `GetObject` on bucket
51+
contents (`/*`). For example:
4852

53+
```json
54+
{
55+
"Version": "2012-10-17",
56+
"Statement": [
57+
{
58+
"Effect": "Allow",
59+
"Action": ["s3:ListBucket"],
60+
"Resource": [
61+
"arn:aws:s3:::gatsby-source-s3-example",
62+
"arn:aws:s3:::gatsby-source-s3-example-2"
63+
]
64+
},
65+
{
66+
"Effect": "Allow",
67+
"Action": ["s3:GetObject"],
68+
"Resource": [
69+
"arn:aws:s3:::gatsby-source-s3-example/*",
70+
"arn:aws:s3:::gatsby-source-s3-example-2/*"
71+
]
72+
}
73+
]
74+
}
4975
```
5076

5177
## Querying S3 objects

0 commit comments

Comments
 (0)