Skip to content

Commit 63ca6e0

Browse files
committed
Add IAM policy for uploading to archive bucket
To be used for automated archiving.
1 parent 59ef8b5 commit 63ca6e0

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
resource "aws_iam_policy" "NextstrainArchiveUpload" {
2+
name = "NextstrainArchiveUpload"
3+
description = "Provides permissions to upload to the nextstrain-archive bucket"
4+
5+
policy = jsonencode({
6+
"Version": "2012-10-17",
7+
"Statement": [
8+
{
9+
"Sid": "ListBucket",
10+
"Effect": "Allow",
11+
"Action": "s3:ListBucket",
12+
"Resource": "arn:aws:s3:::nextstrain-archive"
13+
},
14+
{
15+
"Sid": "PutObjectIfAbsent",
16+
"Effect": "Allow",
17+
"Action": "s3:PutObject",
18+
"Resource": "arn:aws:s3:::nextstrain-archive/*",
19+
"Condition": {
20+
"Null": {
21+
"s3:if-none-match": "false"
22+
}
23+
}
24+
},
25+
{
26+
"Sid": "AbortMultipartUpload",
27+
"Effect": "Allow",
28+
"Action": "s3:AbortMultipartUpload",
29+
"Resource": "arn:aws:s3:::nextstrain-archive/*"
30+
}
31+
]
32+
})
33+
}

0 commit comments

Comments
 (0)