Skip to content

Commit ea2dfc9

Browse files
Update permissions
- Handle production trust policy for multiple repositories - Include lambda functions into deploy
1 parent f148887 commit ea2dfc9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

terraform/account/deployment_permissions.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ resource "aws_iam_role" "data_replication_snapshot" {
5252
name = "DatabaseSnapshotRole"
5353
description = "Role to be assumed by the data replication workflow for taking on-demand DB snapshots"
5454
assume_role_policy = templatefile("resources/iam_role_github_trust_policy_${var.environment}.json.tftpl", {
55-
account_id = var.account_id
55+
account_id = var.account_id
56+
repository_list = ["repo:nhsuk/manage-vaccinations-in-schools:*"]
5657
})
5758
}
5859

terraform/account/resources/iam_policy_DeployMavisResources.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@
142142
"ssm:DeleteParameter",
143143
"ssm:DeleteParameters",
144144
"ssm:PutParameter",
145+
"lambda:InvokeFunction",
146+
"lambda:DeleteFunction",
147+
"lambda:CreateFunction",
148+
"lambda:CreateAlias",
149+
"lambda:DeleteAlias",
150+
"lambda:UpdateAlias",
145151
"elasticache:CreateCacheParameterGroup",
146152
"elasticache:AuthorizeCacheSecurityGroupIngress",
147153
"elasticache:CreateReplicationGroup",

terraform/account/resources/iam_role_github_trust_policy_production.json.tftpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"Condition": {
1111
"StringEquals": {
1212
"token.actions.githubusercontent.com:sub": [
13-
"repo:nhsuk/manage-vaccinations-in-schools:ref:refs/heads/main",
14-
"repo:nhsuk/manage-vaccinations-in-schools:environment:production"
13+
"repo:${repository}:ref:refs/heads/main",
14+
"repo:${repository}:environment:production"
1515
],
1616
"token.actions.githubusercontent.com:aud": "sts.amazonaws.com"
1717
}

0 commit comments

Comments
 (0)