Skip to content
4 changes: 4 additions & 0 deletions terraform/aws-custom-policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,9 @@ module "aws_custom_policies" {
description = "Policy enforcing MFA for devops security users"
filename = "enforce-mfa-for-users-policy.json"
}
"IncubatorTfPlanSecretsRead" = {
description = "Allows incubator tf plan role to read specific Secrets Manager secrets needed for terraform plan"
filename = "incubator-tf-plan-secrets-read-policy.json"
}
Comment thread
ale210 marked this conversation as resolved.
}
}
Comment thread
Benettonkkb marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowReadSpecificSecretsForTerraformPlan",
"Effect": "Allow",
"Action": [
"secretsmanager:GetSecretValue"
],
"Resource": [
"arn:aws:secretsmanager:us-west-2:035866691871:secret:home-unite-us-cognito-client*",
Comment thread
Benettonkkb marked this conversation as resolved.
Outdated
"arn:aws:secretsmanager:us-west-2:035866691871:secret:home-unite-us-google-clientid*",
"arn:aws:secretsmanager:us-west-2:035866691871:secret:home-unite-us-google-secret*"
]
}
]
}
8 changes: 6 additions & 2 deletions terraform/aws-gha-oidc-providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ resource "aws_iam_role" "incubator_tf_plan" {
}

resource "aws_iam_role_policy_attachment" "incubator_tf_plan_readonly" {
role = aws_iam_role.incubator_tf_plan.name
role = aws_iam_role.incubator_tf_plan.name
policy_arn = "arn:aws:iam::aws:policy/ReadOnlyAccess"
}
Comment thread
ale210 marked this conversation as resolved.

resource "aws_iam_role_policy_attachment" "incubator_tf_plan_secrets_read" {
role = aws_iam_role.incubator_tf_plan.name
policy_arn = module.aws_custom_policies.policy_arns["IncubatorTfPlanSecretsRead"]
}

resource "aws_iam_role" "incubator_tf_apply" {
name = "incubator-tf-apply"

assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
Expand Down
Loading