diff --git a/.github/linters/.tflint.hcl b/.github/linters/.tflint.hcl new file mode 100644 index 0000000..90157ce --- /dev/null +++ b/.github/linters/.tflint.hcl @@ -0,0 +1,18 @@ +tflint { + required_version = ">= 0.50" +} + +config { + rule "terraform_typed_variables" { + enabled = false + } + rule "terraform_module_version" { + enabled = false + } + rule "terraform_required_providers" { + enabled = false + } + rule "terraform_unused_declarations" { + enabled = false + } +} diff --git a/EKS/FSxN-as-PVC-for-EKS/terraform/eks-cluster.tf b/EKS/FSxN-as-PVC-for-EKS/terraform/eks-cluster.tf index 299951e..22ff83e 100644 --- a/EKS/FSxN-as-PVC-for-EKS/terraform/eks-cluster.tf +++ b/EKS/FSxN-as-PVC-for-EKS/terraform/eks-cluster.tf @@ -81,7 +81,7 @@ resource "aws_iam_policy" "trident_policy" { { "Action": "secretsmanager:GetSecretValue", "Effect": "Allow", - "Resource": "${aws_secretsmanager_secret_version.fsx_secret_password.arn}" + "Resource": aws_secretsmanager_secret_version.fsx_secret_password.arn } ], }) diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf b/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf index 3570ddc..6ddeb5c 100644 --- a/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf +++ b/Terraform/deploy-fsx-ontap-fileshare-access/modules/vpn/main.tf @@ -6,12 +6,18 @@ resource "aws_acm_certificate" "server_vpn_cert" { certificate_body = var.server_cert private_key = var.server_private_key certificate_chain = var.ca_crt + lifecycle { + create_before_destroy = true + } } resource "aws_acm_certificate" "client_vpn_cert" { certificate_body = var.client_cert private_key = var.client_private_key certificate_chain = var.ca_crt + lifecycle { + create_before_destroy = true + } } resource "aws_ec2_client_vpn_endpoint" "my_client_vpn" { diff --git a/Terraform/deploy-fsx-ontap-fileshare-access/networking.tf b/Terraform/deploy-fsx-ontap-fileshare-access/networking.tf index 7525aa2..dfb062d 100644 --- a/Terraform/deploy-fsx-ontap-fileshare-access/networking.tf +++ b/Terraform/deploy-fsx-ontap-fileshare-access/networking.tf @@ -28,11 +28,11 @@ resource "aws_eip" "nat_eip" { # NAT resource "aws_nat_gateway" "nat" { allocation_id = aws_eip.nat_eip.id - subnet_id = element(aws_subnet.public_subnet.*.id, 0) + subnet_id = element(aws_subnet.public_subnet[*].id, 0) tags = { Name = "nat" - Environment = "${var.environment}" + Environment = var.environment } } @@ -46,7 +46,7 @@ resource "aws_subnet" "public_subnet" { tags = { Name = "${var.creator_tag}-${var.environment}-${element(var.availability_zones, count.index)}-public-subnet" - Environment = "${var.environment}" + Environment = var.environment } } @@ -61,7 +61,7 @@ resource "aws_subnet" "private_subnet" { tags = { Name = "${var.creator_tag}-${var.environment}-${element(var.availability_zones, count.index)}-private-subnet" - Environment = "${var.environment}" + Environment = var.environment } } @@ -72,7 +72,7 @@ resource "aws_route_table" "private" { tags = { Name = "${var.creator_tag}-${var.environment}-private-route-table" - Environment = "${var.environment}" + Environment = var.environment } } @@ -82,7 +82,7 @@ resource "aws_route_table" "public" { tags = { Name = "${var.creator_tag}-${var.environment}-public-route-table" - Environment = "${var.environment}" + Environment = var.environment } } @@ -103,13 +103,13 @@ resource "aws_route" "private_nat_gateway" { # Route table associations for both Public & Private Subnets resource "aws_route_table_association" "public" { count = length(var.public_subnets_cidr) - subnet_id = element(aws_subnet.public_subnet.*.id, count.index) + subnet_id = element(aws_subnet.public_subnet[*].id, count.index) route_table_id = aws_route_table.public.id } resource "aws_route_table_association" "private" { count = length(var.private_subnets_cidr) - subnet_id = element(aws_subnet.private_subnet.*.id, count.index) + subnet_id = element(aws_subnet.private_subnet[*].id, count.index) route_table_id = aws_route_table.private.id } diff --git a/Terraform/deploy-fsx-ontap-sqlserver/networking.tf b/Terraform/deploy-fsx-ontap-sqlserver/networking.tf index ca7a220..63f561d 100644 --- a/Terraform/deploy-fsx-ontap-sqlserver/networking.tf +++ b/Terraform/deploy-fsx-ontap-sqlserver/networking.tf @@ -28,11 +28,11 @@ resource "aws_eip" "nat_eip" { # NAT resource "aws_nat_gateway" "nat" { allocation_id = aws_eip.nat_eip.id - subnet_id = element(aws_subnet.public_subnet.*.id, 0) + subnet_id = element(aws_subnet.public_subnet[*].id, 0) tags = { Name = "nat" - Environment = "${var.environment}" + Environment = var.environment } } @@ -46,7 +46,7 @@ resource "aws_subnet" "public_subnet" { tags = { Name = "${var.creator_tag}-${var.environment}-${element(var.availability_zones, count.index)}-public-subnet" - Environment = "${var.environment}" + Environment = var.environment } } @@ -61,7 +61,7 @@ resource "aws_subnet" "private_subnet" { tags = { Name = "${var.creator_tag}-${var.environment}-${element(var.availability_zones, count.index)}-private-subnet" - Environment = "${var.environment}" + Environment = var.environment } } @@ -72,7 +72,7 @@ resource "aws_route_table" "private" { tags = { Name = "${var.creator_tag}-${var.environment}-private-route-table" - Environment = "${var.environment}" + Environment = var.environment } } @@ -82,7 +82,7 @@ resource "aws_route_table" "public" { tags = { Name = "${var.creator_tag}-${var.environment}-public-route-table" - Environment = "${var.environment}" + Environment = var.environment } } @@ -103,13 +103,13 @@ resource "aws_route" "private_nat_gateway" { # Route table associations for both Public & Private Subnets resource "aws_route_table_association" "public" { count = length(var.public_subnets_cidr) - subnet_id = element(aws_subnet.public_subnet.*.id, count.index) + subnet_id = element(aws_subnet.public_subnet[*].id, count.index) route_table_id = aws_route_table.public.id } resource "aws_route_table_association" "private" { count = length(var.private_subnets_cidr) - subnet_id = element(aws_subnet.private_subnet.*.id, count.index) + subnet_id = element(aws_subnet.private_subnet[*].id, count.index) route_table_id = aws_route_table.private.id } @@ -137,7 +137,7 @@ resource "aws_security_group" "default" { } tags = { - Environment = "${var.environment}" + Environment = var.environment } } diff --git a/Terraform/deploy-fsx-ontap/module/main.tf b/Terraform/deploy-fsx-ontap/module/main.tf index 448137a..4c10789 100644 --- a/Terraform/deploy-fsx-ontap/module/main.tf +++ b/Terraform/deploy-fsx-ontap/module/main.tf @@ -19,7 +19,7 @@ resource "aws_fsx_ontap_file_system" "terraform-fsxn" { // OPTIONAL PARAMETERS storage_capacity = var.capacity_size_gb - security_group_ids = var.create_sg ? [element(aws_security_group.fsx_sg.*.id, 0)] : [var.security_group_id] + security_group_ids = var.create_sg ? [element(aws_security_group.fsx_sg[*].id, 0)] : [var.security_group_id] deployment_type = var.deployment_type throughput_capacity = var.throughput_in_MBps weekly_maintenance_start_time = var.maintenance_start_time diff --git a/Terraform/deploy-fsx-ontap/module/output.tf b/Terraform/deploy-fsx-ontap/module/output.tf index a237cd3..9c25998 100644 --- a/Terraform/deploy-fsx-ontap/module/output.tf +++ b/Terraform/deploy-fsx-ontap/module/output.tf @@ -1,6 +1,6 @@ output "my_fsx_ontap_security_group_id" { description = "The ID of the FSxN Security Group" - value = var.create_sg ? [element(aws_security_group.fsx_sg.*.id, 0)] : [] + value = var.create_sg ? [element(aws_security_group.fsx_sg[*].id, 0)] : [] } output "my_filesystem_id" { @@ -16,4 +16,4 @@ output "my_svm_id" { output "my_vol_id" { description = "The ID of the ONTAP volume in the File System" value = aws_fsx_ontap_volume.myvol.id -} \ No newline at end of file +}