-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trs/ncov-non-standard-paths'
- Loading branch information
Showing
2 changed files
with
55 additions
and
3 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
env/production/aws-iam-policy-NextstrainPathogenNcovNonStandardPaths.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Single-pathogen policy, special-case for the historical reason that | ||
# ncov uses the non-standard files/ncov/ paths. | ||
resource "aws_iam_policy" "NextstrainPathogenNcovNonStandardPaths" { | ||
name = "NextstrainPathogen@ncov+non-standard-paths" | ||
description = "Provides permissions to upload workflow files for the Nextstrain ncov pathogen to its non-standard paths" | ||
|
||
policy = jsonencode({ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "List", | ||
"Effect": "Allow", | ||
"Action": [ | ||
"s3:ListBucket", | ||
"s3:ListBucketVersions", | ||
"s3:GetBucketLocation", | ||
"s3:GetBucketVersioning", | ||
], | ||
"Resource": [ | ||
"arn:aws:s3:::nextstrain-data", | ||
"arn:aws:s3:::nextstrain-staging", | ||
], | ||
"Condition": { | ||
"StringLike": { | ||
"s3:prefix": [ | ||
"files/ncov/*", | ||
] | ||
} | ||
} | ||
}, | ||
{ | ||
"Sid": "ReadWrite", | ||
"Effect": "Allow", | ||
"Action": [ | ||
"s3:GetObject", | ||
"s3:GetObjectTagging", | ||
"s3:GetObjectVersion", | ||
"s3:GetObjectVersionTagging", | ||
"s3:PutObject", | ||
"s3:PutObjectTagging", | ||
"s3:DeleteObject", | ||
# but NOT s3:DeleteObjectVersion so objects can't be completely wiped | ||
], | ||
"Resource": [ | ||
"arn:aws:s3:::nextstrain-data/files/ncov/*", | ||
"arn:aws:s3:::nextstrain-staging/files/ncov/*", | ||
], | ||
}, | ||
] | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters