Skip to content

Commit

Permalink
Allow pathogen workflows to perform CloudFront invalidations…
Browse files Browse the repository at this point in the history
…for the {data,staging}.nextstrain.org distributions.

This is a more tightly scoped policy than the policy often used,
"AllowCloudfrontInvalidations".  I think that policy is too broad but
don't want to change it directly out of concerns for off-target effects.
  • Loading branch information
tsibley committed Jun 3, 2024
1 parent 63b7d05 commit feccdfa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions env/production/aws-iam-policy-NextstrainPathogen@.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,22 @@ resource "aws_iam_policy" "NextstrainPathogen" {
"arn:aws:s3:::nextstrain-staging/files/datasets/${each.key}/*",
],
},
{
"Sid": "CloudFront",
"Effect": "Allow",
"Action": [
"cloudfront:ListDistributions",
"cloudfront:CreateInvalidation",
"cloudfront:GetInvalidation",
],
# XXX TODO: Import CloudFront resources into Terraform and pull their
# IDs dynamically instead of hardcoding them here.
# -trs, 31 May 2024
"Resource": [
"arn:aws:cloudfront:::distribution/E3LB0EWZKCCV", # data.nextstrain.org
"arn:aws:cloudfront:::distribution/E3L83FTHWUN0BV", # staging.nextstrain.org
],
}
]
})
}

0 comments on commit feccdfa

Please sign in to comment.