Skip to content

Commit

Permalink
Update linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ranikamadurawe committed Aug 26, 2024
1 parent e2ec3ac commit 81d9d4c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion modules/aws/EKS-Cluster/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# trivy:ignore:AVD-AWS-0039
resource "aws_eks_cluster" "eks_cluster" {
name = join("-", [var.project, var.application, var.environment, var.region, "eks"])
role_arn = aws_iam_role.iam_role.arn
role_arn = aws_iam_role.iam_role[0].arn

version = var.kubernetes_version

Expand Down
4 changes: 2 additions & 2 deletions modules/aws/EKS-Cluster/iam_role.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ POLICY

resource "aws_iam_role_policy_attachment" "amazon_eks_cluster_policy" {
count = var.cluster_iam_role_arn != null ? 0 : 1
role = aws_iam_role[0].iam_role.name
role = aws_iam_role.iam_role[0].name
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy"

depends_on = [
Expand All @@ -44,7 +44,7 @@ resource "aws_iam_role_policy_attachment" "amazon_eks_cluster_policy" {
# Reference: https://docs.aws.amazon.com/eks/latest/userguide/security-groups-for-pods.html
resource "aws_iam_role_policy_attachment" "amazon_eks_pc_resource_controller" {
count = var.cluster_iam_role_arn != null ? 0 : 1
role = aws_iam_role[0].iam_role.name
role = aws_iam_role.iam_role[0].name
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSVPCResourceController"

depends_on = [
Expand Down
2 changes: 1 addition & 1 deletion modules/aws/EKS-Node-Group/eks_node_group.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
resource "aws_eks_node_group" "eks_node_group" {
cluster_name = var.eks_cluster_name
node_group_name = join("-", [var.eks_cluster_name, var.node_group_name, "node-group"])
node_role_arn = var.node_iam_role_arn == null ? aws_iam_role.iam_role.arn : var.node_iam_role_arn
node_role_arn = var.node_iam_role_arn == null ? aws_iam_role.iam_role[0].arn : var.node_iam_role_arn
subnet_ids = var.subnet_ids
version = var.k8s_version
labels = var.labels
Expand Down
10 changes: 5 additions & 5 deletions modules/aws/EKS-Node-Group/iam_role.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ resource "aws_iam_role" "iam_role" {
resource "aws_iam_role_policy_attachment" "amazon_eks_worker_node_policy" {
count = var.node_iam_role_arn != null ? 0 : 1
policy_arn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy"
role = aws_iam_role[0].iam_role.name
role = aws_iam_role.iam_role[0].name

depends_on = [
aws_iam_role.iam_role
Expand All @@ -41,7 +41,7 @@ resource "aws_iam_role_policy_attachment" "amazon_eks_worker_node_policy" {
resource "aws_iam_role_policy_attachment" "amazon_eks_cni_policy" {
count = var.node_iam_role_arn != null ? 0 : 1
policy_arn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"
role = aws_iam_role[0].iam_role.name
role = aws_iam_role.iam_role[0].name

depends_on = [
aws_iam_role.iam_role
Expand All @@ -52,7 +52,7 @@ resource "aws_iam_role_policy_attachment" "amazon_eks_cni_policy" {
resource "aws_iam_role_policy_attachment" "amazon_ec2_container_registry_read_only" {
policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly"
count = var.node_iam_role_arn != null ? 0 : 1
role = aws_iam_role[0].iam_role.name
role = aws_iam_role.iam_role[0].name

depends_on = [
aws_iam_role.iam_role
Expand Down Expand Up @@ -131,8 +131,8 @@ resource "aws_iam_policy" "amazon_ec2_cache_policy" {

resource "aws_iam_role_policy_attachment" "amazon_ec2_cache_policy_attachment" {
count = var.node_iam_role_arn != null ? 0 : 1
policy_arn = aws_iam_policy[0].amazon_ec2_cache_policy.arn
role = aws_iam_role[0].iam_role.name
policy_arn = aws_iam_policy.amazon_ec2_cache_policy[0].arn
role = aws_iam_role.iam_role[0].name

depends_on = [
aws_iam_role.iam_role
Expand Down

0 comments on commit 81d9d4c

Please sign in to comment.