Skip to content

Commit d28981b

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

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
# TODO: Add --if-none-match when Nextstrain Docker image moves to AWS CLI v2.
20+
# <https://github.com/nextstrain/docker-base/issues/216>
21+
},
22+
{
23+
"Sid": "AbortMultipartUpload",
24+
"Effect": "Allow",
25+
"Action": "s3:AbortMultipartUpload",
26+
"Resource": "arn:aws:s3:::nextstrain-archive/*"
27+
}
28+
]
29+
})
30+
}

0 commit comments

Comments
 (0)