Skip to content

Commit e8a2a72

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/multi-170d91aa79
2 parents 85701a1 + 67681c6 commit e8a2a72

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

infra/environments/prod/variables.tfvars

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ mns_admin_role = "role/nhs-mns-events-lambda-delivery"
99
environment = "prod"
1010
parent_route53_zone_name = "prod.vds.platform.nhs.uk"
1111
child_route53_zone_name = "imms.prod.vds.platform.nhs.uk"
12-
mesh_mailbox_id = "X26HC138"
13-
mesh_dlq_mailbox_id = null

infra/roles.tf renamed to infra/iam.tf

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,22 @@ resource "aws_iam_role" "auto_ops" {
5959
AWS = "arn:aws:iam::${var.build_agent_account_id}:role/build-agent"
6060
},
6161
Action = "sts:AssumeRole"
62+
},
63+
{
64+
Sid = "",
65+
Effect = "Allow",
66+
Principal = {
67+
Federated = "arn:aws:iam::${var.imms_account_id}:oidc-provider/token.actions.githubusercontent.com"
68+
},
69+
Action = "sts:AssumeRoleWithWebIdentity",
70+
Condition = {
71+
StringEquals = {
72+
"token.actions.githubusercontent.com:aud" : "sts.amazonaws.com"
73+
},
74+
StringLike = {
75+
"token.actions.githubusercontent.com:sub" : "repo:NHSDigital/immunisation-fhir-api:*"
76+
}
77+
}
6278
}
6379
]
6480
})
@@ -78,3 +94,15 @@ resource "aws_iam_role_policy_attachment" "custom_auto_ops" {
7894
role = aws_iam_role.auto_ops.name
7995
policy_arn = aws_iam_policy.auto_ops.arn
8096
}
97+
98+
resource "aws_iam_openid_connect_provider" "github" {
99+
url = "https://token.actions.githubusercontent.com"
100+
101+
client_id_list = [
102+
"sts.amazonaws.com"
103+
]
104+
105+
thumbprint_list = [
106+
"2b18947a6a9fc7764fd8b5fb18a863b0c6dac24f"
107+
]
108+
}

0 commit comments

Comments
 (0)