diff --git a/GNUmakefile b/GNUmakefile index fff71f3c9ba..968a131e932 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -648,6 +648,12 @@ testacc-tflint-dir: tflint-init ## Run tflint on Terraform directories @tflint_config="$(PWD)/.ci/.tflint.hcl" ; \ tflint --config "$$tflint_config" --chdir=./internal/service --recursive +testacc-tflint-dir-fix: tflint-init ## fix Terraform directory linter findings + @echo "make: Acceptance Test Linting (standalone) / tflint..." + @# tflint always resolves config flies relative to the working directory when using --recursive + @tflint_config="$(PWD)/.ci/.tflint.hcl" ; \ + tflint --config "$$tflint_config" --chdir=./internal/service --recursive --fix + testacc-tflint-embedded: tflint-init ## Run tflint on embedded Terraform configs @echo "make: Acceptance Test Linting (embedded) / tflint..." @find $(SVC_DIR) -type f -name '*_test.go' \ diff --git a/internal/service/amp/testdata/Scraper/tags/main_gen.tf b/internal/service/amp/testdata/Scraper/tags/main_gen.tf index fd5275c1429..0de45a4f2b4 100644 --- a/internal/service/amp/testdata/Scraper/tags/main_gen.tf +++ b/internal/service/amp/testdata/Scraper/tags/main_gen.tf @@ -62,7 +62,7 @@ CONFIG source { eks { cluster_arn = aws_eks_cluster.test.arn - subnet_ids = aws_subnet.test.*.id + subnet_ids = aws_subnet.test[*].id } } diff --git a/internal/service/apigateway/testdata/VPCLink/data.tags/main_gen.tf b/internal/service/apigateway/testdata/VPCLink/data.tags/main_gen.tf index af2e3894283..fdfdf624705 100644 --- a/internal/service/apigateway/testdata/VPCLink/data.tags/main_gen.tf +++ b/internal/service/apigateway/testdata/VPCLink/data.tags/main_gen.tf @@ -20,7 +20,7 @@ resource "aws_lb" "test" { subnets = aws_subnet.test[*].id } -// acctest.ConfigVPCWithSubnets(rName, 1) +# acctest.ConfigVPCWithSubnets(rName, 1) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -37,7 +37,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigateway/testdata/VPCLink/tags/main_gen.tf b/internal/service/apigateway/testdata/VPCLink/tags/main_gen.tf index 1fdd77fd620..f4bbd024bd6 100644 --- a/internal/service/apigateway/testdata/VPCLink/tags/main_gen.tf +++ b/internal/service/apigateway/testdata/VPCLink/tags/main_gen.tf @@ -15,7 +15,7 @@ resource "aws_lb" "test" { subnets = aws_subnet.test[*].id } -// acctest.ConfigVPCWithSubnets(rName, 1) +# acctest.ConfigVPCWithSubnets(rName, 1) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -32,7 +32,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigateway/testdata/VPCLink/tagsComputed1/main_gen.tf b/internal/service/apigateway/testdata/VPCLink/tagsComputed1/main_gen.tf index 7991ec0083f..1a8f7b0d442 100644 --- a/internal/service/apigateway/testdata/VPCLink/tagsComputed1/main_gen.tf +++ b/internal/service/apigateway/testdata/VPCLink/tagsComputed1/main_gen.tf @@ -19,7 +19,7 @@ resource "aws_lb" "test" { subnets = aws_subnet.test[*].id } -// acctest.ConfigVPCWithSubnets(rName, 1) +# acctest.ConfigVPCWithSubnets(rName, 1) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -36,7 +36,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigateway/testdata/VPCLink/tagsComputed2/main_gen.tf b/internal/service/apigateway/testdata/VPCLink/tagsComputed2/main_gen.tf index 650d6b44527..74c8751e90a 100644 --- a/internal/service/apigateway/testdata/VPCLink/tagsComputed2/main_gen.tf +++ b/internal/service/apigateway/testdata/VPCLink/tagsComputed2/main_gen.tf @@ -20,7 +20,7 @@ resource "aws_lb" "test" { subnets = aws_subnet.test[*].id } -// acctest.ConfigVPCWithSubnets(rName, 1) +# acctest.ConfigVPCWithSubnets(rName, 1) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -37,7 +37,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigateway/testdata/VPCLink/tags_defaults/main_gen.tf b/internal/service/apigateway/testdata/VPCLink/tags_defaults/main_gen.tf index f1f904d58e7..0044d5ccea2 100644 --- a/internal/service/apigateway/testdata/VPCLink/tags_defaults/main_gen.tf +++ b/internal/service/apigateway/testdata/VPCLink/tags_defaults/main_gen.tf @@ -21,7 +21,7 @@ resource "aws_lb" "test" { subnets = aws_subnet.test[*].id } -// acctest.ConfigVPCWithSubnets(rName, 1) +# acctest.ConfigVPCWithSubnets(rName, 1) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -38,7 +38,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigateway/testdata/VPCLink/tags_ignore/main_gen.tf b/internal/service/apigateway/testdata/VPCLink/tags_ignore/main_gen.tf index 737c6e23610..409bb9024de 100644 --- a/internal/service/apigateway/testdata/VPCLink/tags_ignore/main_gen.tf +++ b/internal/service/apigateway/testdata/VPCLink/tags_ignore/main_gen.tf @@ -24,7 +24,7 @@ resource "aws_lb" "test" { subnets = aws_subnet.test[*].id } -// acctest.ConfigVPCWithSubnets(rName, 1) +# acctest.ConfigVPCWithSubnets(rName, 1) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -41,7 +41,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigateway/testdata/tmpl/vpc_link_tags.gtpl b/internal/service/apigateway/testdata/tmpl/vpc_link_tags.gtpl index f7c0e44f109..d0512a1f785 100644 --- a/internal/service/apigateway/testdata/tmpl/vpc_link_tags.gtpl +++ b/internal/service/apigateway/testdata/tmpl/vpc_link_tags.gtpl @@ -12,7 +12,7 @@ resource "aws_lb" "test" { subnets = aws_subnet.test[*].id } -// acctest.ConfigVPCWithSubnets(rName, 1) +# acctest.ConfigVPCWithSubnets(rName, 1) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -29,7 +29,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigatewayv2/testdata/VPCLink/data.tags/main_gen.tf b/internal/service/apigatewayv2/testdata/VPCLink/data.tags/main_gen.tf index c3a2be641c9..0f12e5c98f3 100644 --- a/internal/service/apigatewayv2/testdata/VPCLink/data.tags/main_gen.tf +++ b/internal/service/apigatewayv2/testdata/VPCLink/data.tags/main_gen.tf @@ -19,7 +19,7 @@ resource "aws_security_group" "test" { vpc_id = aws_vpc.test.id } -// acctest.ConfigVPCWithSubnets(rName, 2) +# acctest.ConfigVPCWithSubnets(rName, 2) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" } @@ -32,7 +32,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigatewayv2/testdata/VPCLink/tags/main_gen.tf b/internal/service/apigatewayv2/testdata/VPCLink/tags/main_gen.tf index 5b5b42ca4aa..bde33657636 100644 --- a/internal/service/apigatewayv2/testdata/VPCLink/tags/main_gen.tf +++ b/internal/service/apigatewayv2/testdata/VPCLink/tags/main_gen.tf @@ -14,7 +14,7 @@ resource "aws_security_group" "test" { vpc_id = aws_vpc.test.id } -// acctest.ConfigVPCWithSubnets(rName, 2) +# acctest.ConfigVPCWithSubnets(rName, 2) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" } @@ -27,7 +27,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed1/main_gen.tf b/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed1/main_gen.tf index c6fe68efdb6..90dabb59023 100644 --- a/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed1/main_gen.tf +++ b/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed1/main_gen.tf @@ -18,7 +18,7 @@ resource "aws_security_group" "test" { vpc_id = aws_vpc.test.id } -// acctest.ConfigVPCWithSubnets(rName, 2) +# acctest.ConfigVPCWithSubnets(rName, 2) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" } @@ -31,7 +31,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed2/main_gen.tf b/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed2/main_gen.tf index 0a916212fbd..68dd2853214 100644 --- a/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed2/main_gen.tf +++ b/internal/service/apigatewayv2/testdata/VPCLink/tagsComputed2/main_gen.tf @@ -19,7 +19,7 @@ resource "aws_security_group" "test" { vpc_id = aws_vpc.test.id } -// acctest.ConfigVPCWithSubnets(rName, 2) +# acctest.ConfigVPCWithSubnets(rName, 2) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" } @@ -32,7 +32,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigatewayv2/testdata/VPCLink/tags_defaults/main_gen.tf b/internal/service/apigatewayv2/testdata/VPCLink/tags_defaults/main_gen.tf index 31cfc12669d..3ba67c765d6 100644 --- a/internal/service/apigatewayv2/testdata/VPCLink/tags_defaults/main_gen.tf +++ b/internal/service/apigatewayv2/testdata/VPCLink/tags_defaults/main_gen.tf @@ -20,7 +20,7 @@ resource "aws_security_group" "test" { vpc_id = aws_vpc.test.id } -// acctest.ConfigVPCWithSubnets(rName, 2) +# acctest.ConfigVPCWithSubnets(rName, 2) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" } @@ -33,7 +33,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigatewayv2/testdata/VPCLink/tags_ignore/main_gen.tf b/internal/service/apigatewayv2/testdata/VPCLink/tags_ignore/main_gen.tf index 5baf4ad4bbe..c5e4c34cca3 100644 --- a/internal/service/apigatewayv2/testdata/VPCLink/tags_ignore/main_gen.tf +++ b/internal/service/apigatewayv2/testdata/VPCLink/tags_ignore/main_gen.tf @@ -23,7 +23,7 @@ resource "aws_security_group" "test" { vpc_id = aws_vpc.test.id } -// acctest.ConfigVPCWithSubnets(rName, 2) +# acctest.ConfigVPCWithSubnets(rName, 2) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" } @@ -36,7 +36,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available" diff --git a/internal/service/apigatewayv2/testdata/tmpl/vpc_link_tags.gtpl b/internal/service/apigatewayv2/testdata/tmpl/vpc_link_tags.gtpl index d28cdca4cf1..5477f2277da 100644 --- a/internal/service/apigatewayv2/testdata/tmpl/vpc_link_tags.gtpl +++ b/internal/service/apigatewayv2/testdata/tmpl/vpc_link_tags.gtpl @@ -11,7 +11,7 @@ resource "aws_security_group" "test" { vpc_id = aws_vpc.test.id } -// acctest.ConfigVPCWithSubnets(rName, 2) +# acctest.ConfigVPCWithSubnets(rName, 2) resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" } @@ -24,7 +24,7 @@ resource "aws_subnet" "test" { cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) } -// acctest.ConfigAvailableAZsNoOptInDefaultExclude() +# acctest.ConfigAvailableAZsNoOptInDefaultExclude() data "aws_availability_zones" "available" { exclude_zone_ids = local.default_exclude_zone_ids state = "available"