@@ -6,14 +6,13 @@ resource "aws_iam_role_policy_attachment" "ReadOnlyAccess" {
66
77# POLICY SPLIT INTO 3 PARTS TO AVOID HITTING THE 6,144 CHARACTER LIMIT FOR AWS IAM POLICIES
88
9- resource "aws_iam_role_policy_attachment" "github_actions_dev_test_pre-prod_prod_1" {
10-
9+ resource "aws_iam_role_policy_attachment" "github_actions_common_1" {
1110 role = aws_iam_role. github_actions . name
12- policy_arn = aws_iam_policy. github_actions_dev_test_pre-prod_prod_1 . arn
11+ policy_arn = aws_iam_policy. github_actions_common_1 . arn
1312}
1413
15- resource "aws_iam_policy" "github_actions_dev_test_pre-prod_prod_1 " {
16- name = " ${ terraform . workspace } -github-actions-policy-dev_test_pre-prod_prod_1 "
14+ resource "aws_iam_policy" "github_actions_common_1 " {
15+ name = " ${ terraform . workspace } -github-actions-policy-common-1 "
1716 path = " /"
1817 policy = jsonencode ({
1918 Version = " 2012-10-17"
@@ -118,13 +117,13 @@ resource "aws_iam_policy" "github_actions_dev_test_pre-prod_prod_1" {
118117}
119118
120119
121- resource "aws_iam_role_policy_attachment" "github_actions_dev_test_pre-prod_prod_2 " {
120+ resource "aws_iam_role_policy_attachment" "github_actions_common_2 " {
122121 role = aws_iam_role. github_actions . name
123- policy_arn = aws_iam_policy. github_actions_dev_test_pre-prod_prod_2 . arn
122+ policy_arn = aws_iam_policy. github_actions_common_2 . arn
124123}
125124
126- resource "aws_iam_policy" "github_actions_dev_test_pre-prod_prod_2 " {
127- name = " ${ terraform . workspace } -github-actions-policy-dev_test_pre-prod_prod_2 "
125+ resource "aws_iam_policy" "github_actions_common_2 " {
126+ name = " ${ terraform . workspace } -github-actions-policy-common-2 "
128127 path = " /"
129128 policy = jsonencode ({
130129 Version = " 2012-10-17"
@@ -268,13 +267,13 @@ resource "aws_iam_policy" "github_actions_dev_test_pre-prod_prod_2" {
268267}
269268
270269
271- resource "aws_iam_role_policy_attachment" "github_actions_dev_test_pre-prod_prod_3 " {
270+ resource "aws_iam_role_policy_attachment" "github_actions_common_3 " {
272271 role = aws_iam_role. github_actions . name
273- policy_arn = aws_iam_policy. github_actions_dev_test_pre-prod_prod_3 . arn
272+ policy_arn = aws_iam_policy. github_actions_common_3 . arn
274273}
275274
276- resource "aws_iam_policy" "github_actions_dev_test_pre-prod_prod_3 " {
277- name = " ${ terraform . workspace } -github-actions-policy-dev_test_pre-prod_prod_3 "
275+ resource "aws_iam_policy" "github_actions_common_3 " {
276+ name = " ${ terraform . workspace } -github-actions-policy-common-3 "
278277 path = " /"
279278 policy = jsonencode ({
280279 Version = " 2012-10-17"
0 commit comments