Skip to content

Commit

Permalink
Merge pull request #152 from NetApp/enable_tflint
Browse files Browse the repository at this point in the history
Made some changes to satisfy tflint.
  • Loading branch information
kcantrel authored Jul 3, 2024
2 parents 5d357f6 + ca9447e commit 360f311
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 21 deletions.
18 changes: 18 additions & 0 deletions .github/linters/.tflint.hcl
Original file line number Diff line number Diff line change
@@ -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
}
}
2 changes: 1 addition & 1 deletion EKS/FSxN-as-PVC-for-EKS/terraform/eks-cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
],
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
16 changes: 8 additions & 8 deletions Terraform/deploy-fsx-ontap-fileshare-access/networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}

Expand Down
18 changes: 9 additions & 9 deletions Terraform/deploy-fsx-ontap-sqlserver/networking.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand All @@ -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
}

Expand Down Expand Up @@ -137,7 +137,7 @@ resource "aws_security_group" "default" {
}

tags = {
Environment = "${var.environment}"
Environment = var.environment
}
}

Expand Down
2 changes: 1 addition & 1 deletion Terraform/deploy-fsx-ontap/module/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Terraform/deploy-fsx-ontap/module/output.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand All @@ -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
}
}

0 comments on commit 360f311

Please sign in to comment.