Skip to content

Commit faeb310

Browse files
Nilesh Gadgianmolnagpal
Nilesh Gadgi
andauthored
fix: update naming conevension for policy and IAM name (#31)
Co-authored-by: Anmol Nagpal <[email protected]>
1 parent b6f5fac commit faeb310

File tree

15 files changed

+22
-22
lines changed

15 files changed

+22
-22
lines changed

addons/aws-ebs-csi-driver/main.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module "helm_addon" {
2020
# -- IRSA Configurations
2121
irsa_config = {
2222
irsa_iam_policies = [aws_iam_policy.policy.arn]
23-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
23+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
2424
create_kubernetes_service_account = true
2525
kubernetes_service_account = "${local.name}-sa"
2626
kubernetes_namespace = local.default_helm_config.namespace

addons/aws-efs-csi-driver/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module "helm_addon" {
2828
# -- IRSA Configurations
2929
irsa_config = {
3030
irsa_iam_policies = [aws_iam_policy.policy.arn]
31-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
31+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
3232
create_kubernetes_service_account = true
3333
kubernetes_service_account = "${local.name}-sa"
3434
kubernetes_namespace = local.default_helm_config.namespace
@@ -39,7 +39,7 @@ module "helm_addon" {
3939
}
4040

4141
resource "aws_iam_policy" "policy" {
42-
name = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
42+
name = "${local.name}-${var.eks_cluster_name}"
4343
path = "/"
4444
description = "IAM Policy used by ${local.name}-${var.eks_cluster_name} IAM Role"
4545
policy = var.iampolicy_json_content != null ? var.iampolicy_json_content : <<-EOT

addons/aws-efs-csi-driver/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output "service_account" {
33
}
44

55
output "iam_policy" {
6-
value = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
6+
value = "${local.name}-${var.eks_cluster_name}"
77
}
88

99
output "namespace" {

addons/aws-load-balancer-controller/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module "helm_addon" {
3232
# -- IRSA Configurations
3333
irsa_config = {
3434
irsa_iam_policies = [aws_iam_policy.policy.arn]
35-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
35+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
3636
create_kubernetes_service_account = true
3737
kubernetes_service_account = "${local.name}-sa"
3838
kubernetes_namespace = local.default_helm_config.namespace
@@ -43,7 +43,7 @@ module "helm_addon" {
4343
}
4444

4545
resource "aws_iam_policy" "policy" {
46-
name = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
46+
name = "${local.name}-${var.eks_cluster_name}"
4747
path = "/"
4848
description = "IAM Policy used by ${local.name}-${var.eks_cluster_name} IAM Role"
4949
policy = var.iampolicy_json_content != null ? var.iampolicy_json_content : <<-EOT

addons/aws-load-balancer-controller/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output "service_account" {
33
}
44

55
output "iam_policy" {
6-
value = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
6+
value = "${local.name}-${var.eks_cluster_name}"
77
}
88

99
output "namespace" {

addons/cluster-autoscaler/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module "helm_addon" {
2828
# -- IRSA Configurations
2929
irsa_config = {
3030
irsa_iam_policies = [aws_iam_policy.policy.arn]
31-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
31+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
3232
create_kubernetes_service_account = true
3333
kubernetes_service_account = "${local.name}-sa"
3434
kubernetes_namespace = local.default_helm_config.namespace
@@ -38,7 +38,7 @@ module "helm_addon" {
3838
}
3939

4040
resource "aws_iam_policy" "policy" {
41-
name = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
41+
name = "${local.name}-${var.eks_cluster_name}"
4242
path = "/"
4343
description = "IAM Policy used by ${local.name}-${var.eks_cluster_name} IAM Role"
4444
policy = var.iampolicy_json_content != null ? var.iampolicy_json_content : <<-EOT

addons/cluster-autoscaler/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output "service_account" {
33
}
44

55
output "iam_policy" {
6-
value = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
6+
value = "${local.name}-${var.eks_cluster_name}"
77
}
88

99
output "namespace" {

addons/external-secrets/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module "helm_addon" {
3737
# -- IRSA Configurations
3838
irsa_config = {
3939
irsa_iam_policies = [aws_iam_policy.policy.arn]
40-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
40+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
4141
create_kubernetes_service_account = true
4242
kubernetes_service_account = "${local.name}-sa"
4343
kubernetes_namespace = local.default_helm_config.namespace
@@ -48,7 +48,7 @@ module "helm_addon" {
4848
}
4949

5050
resource "aws_iam_policy" "policy" {
51-
name = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
51+
name = "${local.name}-${var.eks_cluster_name}"
5252
path = "/"
5353
description = "IAM Policy used by ${local.name}-${var.eks_cluster_name} IAM Role"
5454
policy = data.aws_iam_policy_document.iam-policy.json

addons/external-secrets/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ output "service_account" {
77
}
88

99
output "iam_policy" {
10-
value = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
10+
value = "${local.name}-${var.eks_cluster_name}"
1111
}
1212

1313
output "namespace" {

addons/fluent-bit/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module "helm_addon" {
3131
# -- IRSA Configurations
3232
irsa_config = {
3333
irsa_iam_policies = [aws_iam_policy.policy.arn]
34-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
34+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
3535
create_kubernetes_service_account = true
3636
kubernetes_service_account = "${local.name}-sa"
3737
kubernetes_namespace = local.default_helm_config.namespace
@@ -42,7 +42,7 @@ module "helm_addon" {
4242
}
4343

4444
resource "aws_iam_policy" "policy" {
45-
name = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
45+
name = "${local.name}-${var.eks_cluster_name}"
4646
path = "/"
4747
description = "IAM Policy used by ${local.name}-${var.eks_cluster_name} IAM Role"
4848
policy = var.iampolicy_json_content != null ? var.iampolicy_json_content : <<-EOT

addons/fluent-bit/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output "service_account" {
33
}
44

55
output "iam_policy" {
6-
value = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
6+
value = "${local.name}-${var.eks_cluster_name}"
77
}
88

99
output "namespace" {

addons/karpenter/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module "helm_addon" {
3232
# -- IRSA Configurations
3333
irsa_config = {
3434
irsa_iam_policies = [aws_iam_policy.policy.arn]
35-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
35+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
3636
create_kubernetes_service_account = true
3737
kubernetes_service_account = "${local.name}-sa"
3838
kubernetes_namespace = local.default_helm_config.namespace
@@ -43,7 +43,7 @@ module "helm_addon" {
4343
}
4444

4545
resource "aws_iam_policy" "policy" {
46-
name = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
46+
name = "${local.name}-${var.eks_cluster_name}"
4747
path = "/"
4848
description = "IAM Policy used by ${local.name}-${var.eks_cluster_name} IAM Role"
4949
policy = var.iampolicy_json_content != null ? var.iampolicy_json_content : <<-EOT

addons/karpenter/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output "service_account" {
33
}
44

55
output "iam_policy" {
6-
value = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
6+
value = "${local.name}-${var.eks_cluster_name}"
77
}
88

99
output "namespace" {

addons/velero/main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ module "helm_addon" {
2727
kubernetes_namespace = local.default_helm_config.namespace
2828
kubernetes_service_account = "${local.name}-sa"
2929
irsa_iam_policies = [aws_iam_policy.policy.arn]
30-
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}-IAM-Role"
30+
irsa_iam_role_name = "${local.name}-${var.eks_cluster_name}"
3131
eks_oidc_provider_arn = replace(data.aws_eks_cluster.eks_cluster.identity[0].oidc[0].issuer, "https://", "")
3232
account_id = var.account_id
3333
}
3434
}
3535
resource "aws_iam_policy" "policy" {
36-
name = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
36+
name = "${local.name}-${var.eks_cluster_name}"
3737
path = "/"
3838
description = "IAM Policy used by ${local.name}-${var.eks_cluster_name} IAM Role"
3939
policy = var.iampolicy_json_content != null ? var.iampolicy_json_content : <<-EOT

addons/velero/outputs.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ output "service_account" {
33
}
44

55
output "iam_policy" {
6-
value = "${local.name}-${var.eks_cluster_name}-IAM-Policy"
6+
value = "${local.name}-${var.eks_cluster_name}"
77
}
88

99
output "namespace" {

0 commit comments

Comments
 (0)