File tree Expand file tree Collapse file tree
modules/aws-gha-oidc-providers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ module "aws_custom_policies" {
1111 }
1212 " IncubatorTfPlanSecretsRead" = {
1313 description = " Allows incubator tf plan role to read specific Secrets Manager secrets needed for terraform plan"
14- filename = " incubator- tf-plan-secrets-read-policy .json"
14+ filename = " tf-plan-scoped .json"
1515 }
1616 }
1717}
Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ resource "aws_iam_openid_connect_provider" "github_actions" {
5050
5151resource "aws_iam_role" "github_actions_oidc" {
5252
53- name = var. role_name
54- managed_policy_arns = var. policy_arns
53+ name = var. role_name
5554
5655 assume_role_policy = jsonencode ({
5756 " Version" : " 2012-10-17" ,
@@ -71,4 +70,11 @@ resource "aws_iam_role" "github_actions_oidc" {
7170 }
7271 }]
7372 })
73+ }
74+
75+ resource "aws_iam_role_policy_attachment" "github_actions_oidc" {
76+ for_each = toset (var. policy_arns )
77+
78+ role = aws_iam_role. github_actions_oidc . name
79+ policy_arn = each. value
7480}
You can’t perform that action at this time.
0 commit comments