From d8a63502e24b1b85fc48fefc6223fd0f5ebe36b8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 5 Aug 2020 17:11:34 -0400 Subject: [PATCH] Fix acc test configs (up to VPC endpoint) --- ...aws_secretsmanager_secret_rotation_test.go | 20 +-- ...a_source_aws_secretsmanager_secret_test.go | 24 ++-- ..._aws_secretsmanager_secret_version_test.go | 14 +- aws/data_source_aws_security_group_test.go | 12 +- aws/data_source_aws_security_groups_test.go | 8 +- aws/data_source_aws_sfn_activity_test.go | 6 +- aws/data_source_aws_sfn_state_machine_test.go | 4 +- aws/data_source_aws_sns_test.go | 2 +- aws/data_source_aws_sqs_queue_test.go | 4 +- aws/data_source_aws_ssm_document_test.go | 32 ++--- aws/data_source_aws_ssm_parameter_test.go | 2 +- ...data_source_aws_ssm_patch_baseline_test.go | 32 ++--- aws/data_source_aws_subnet_ids_test.go | 26 ++-- aws/data_source_aws_subnet_test.go | 44 +++--- aws/data_source_aws_transfer_server_test.go | 130 +++++++++--------- aws/data_source_aws_vpc_dhcp_options_test.go | 4 +- ...ta_source_aws_vpc_endpoint_service_test.go | 20 +-- 17 files changed, 193 insertions(+), 191 deletions(-) diff --git a/aws/data_source_aws_secretsmanager_secret_rotation_test.go b/aws/data_source_aws_secretsmanager_secret_rotation_test.go index f78d5f7a6e8..60abe6953bb 100644 --- a/aws/data_source_aws_secretsmanager_secret_rotation_test.go +++ b/aws/data_source_aws_secretsmanager_secret_rotation_test.go @@ -47,15 +47,15 @@ resource "aws_lambda_function" "test" { filename = "test-fixtures/lambdatest.zip" function_name = "%[1]s-1" handler = "exports.example" - role = "${aws_iam_role.iam_for_lambda.arn}" + role = aws_iam_role.iam_for_lambda.arn runtime = "nodejs12.x" } resource "aws_lambda_permission" "test" { - action = "lambda:InvokeFunction" - function_name = "${aws_lambda_function.test.function_name}" - principal = "secretsmanager.amazonaws.com" - statement_id = "AllowExecutionFromSecretsManager" + action = "lambda:InvokeFunction" + function_name = aws_lambda_function.test.function_name + principal = "secretsmanager.amazonaws.com" + statement_id = "AllowExecutionFromSecretsManager" } resource "aws_secretsmanager_secret" "test" { @@ -63,16 +63,16 @@ resource "aws_secretsmanager_secret" "test" { } resource "aws_secretsmanager_secret_rotation" "test" { - secret_id = "${aws_secretsmanager_secret.test.id}" - rotation_lambda_arn = "${aws_lambda_function.test.arn}" + secret_id = aws_secretsmanager_secret.test.id + rotation_lambda_arn = aws_lambda_function.test.arn - rotation_rules { + rotation_rules { automatically_after_days = %[2]d - } + } } data "aws_secretsmanager_secret_rotation" "test" { - secret_id = "${aws_secretsmanager_secret_rotation.test.secret_id}" + secret_id = aws_secretsmanager_secret_rotation.test.secret_id } `, rName, automaticallyAfterDays) } diff --git a/aws/data_source_aws_secretsmanager_secret_test.go b/aws/data_source_aws_secretsmanager_secret_test.go index d9989d25a0f..51ece8b801d 100644 --- a/aws/data_source_aws_secretsmanager_secret_test.go +++ b/aws/data_source_aws_secretsmanager_secret_test.go @@ -138,7 +138,7 @@ resource "aws_secretsmanager_secret" "test" { } data "aws_secretsmanager_secret" "test" { - arn = "${aws_secretsmanager_secret.test.arn}" + arn = aws_secretsmanager_secret.test.arn } `, rName) } @@ -165,7 +165,7 @@ resource "aws_secretsmanager_secret" "test" { } data "aws_secretsmanager_secret" "test" { - name = "${aws_secretsmanager_secret.test.name}" + name = aws_secretsmanager_secret.test.name } `, rName) } @@ -179,22 +179,22 @@ resource "aws_secretsmanager_secret" "test" { { "Version": "2012-10-17", "Statement": [ - { - "Sid": "EnableAllPermissions", - "Effect": "Allow", - "Principal": { - "AWS": "*" - }, - "Action": "secretsmanager:GetSecretValue", - "Resource": "*" - } + { + "Sid": "EnableAllPermissions", + "Effect": "Allow", + "Principal": { + "AWS": "*" + }, + "Action": "secretsmanager:GetSecretValue", + "Resource": "*" + } ] } POLICY } data "aws_secretsmanager_secret" "test" { - name = "${aws_secretsmanager_secret.test.name}" + name = aws_secretsmanager_secret.test.name } `, rName) } diff --git a/aws/data_source_aws_secretsmanager_secret_version_test.go b/aws/data_source_aws_secretsmanager_secret_version_test.go index bee026ba98f..8939bed3f7e 100644 --- a/aws/data_source_aws_secretsmanager_secret_version_test.go +++ b/aws/data_source_aws_secretsmanager_secret_version_test.go @@ -116,13 +116,13 @@ resource "aws_secretsmanager_secret" "test" { } resource "aws_secretsmanager_secret_version" "test" { - secret_id = "${aws_secretsmanager_secret.test.id}" + secret_id = aws_secretsmanager_secret.test.id secret_string = "test-string" } data "aws_secretsmanager_secret_version" "test" { - secret_id = "${aws_secretsmanager_secret.test.id}" - version_id = "${aws_secretsmanager_secret_version.test.version_id}" + secret_id = aws_secretsmanager_secret.test.id + version_id = aws_secretsmanager_secret_version.test.version_id } `, rName) } @@ -134,13 +134,13 @@ resource "aws_secretsmanager_secret" "test" { } resource "aws_secretsmanager_secret_version" "test" { - secret_id = "${aws_secretsmanager_secret.test.id}" + secret_id = aws_secretsmanager_secret.test.id secret_string = "test-string" version_stages = ["test-stage", "AWSCURRENT"] } data "aws_secretsmanager_secret_version" "test" { - secret_id = "${aws_secretsmanager_secret_version.test.secret_id}" + secret_id = aws_secretsmanager_secret_version.test.secret_id version_stage = "test-stage" } `, rName) @@ -153,12 +153,12 @@ resource "aws_secretsmanager_secret" "test" { } resource "aws_secretsmanager_secret_version" "test" { - secret_id = "${aws_secretsmanager_secret.test.id}" + secret_id = aws_secretsmanager_secret.test.id secret_string = "test-string" } data "aws_secretsmanager_secret_version" "test" { - secret_id = "${aws_secretsmanager_secret_version.test.secret_id}" + secret_id = aws_secretsmanager_secret_version.test.secret_id } `, rName) } diff --git a/aws/data_source_aws_security_group_test.go b/aws/data_source_aws_security_group_test.go index 58e05ade858..2447d666561 100644 --- a/aws/data_source_aws_security_group_test.go +++ b/aws/data_source_aws_security_group_test.go @@ -113,7 +113,7 @@ resource "aws_vpc" "test" { } resource "aws_security_group" "test" { - vpc_id = "${aws_vpc.test.id}" + vpc_id = aws_vpc.test.id name = "test-%d" tags = { @@ -125,28 +125,28 @@ resource "aws_security_group" "test" { } data "aws_security_group" "by_id" { - id = "${aws_security_group.test.id}" + id = aws_security_group.test.id } data "aws_security_group" "by_name" { - name = "${aws_security_group.test.name}" + name = aws_security_group.test.name } data "aws_security_group" "default_by_name" { - vpc_id = "${aws_vpc.test.id}" + vpc_id = aws_vpc.test.id name = "default" } data "aws_security_group" "by_tag" { tags = { - Seed = "${aws_security_group.test.tags["Seed"]}" + Seed = aws_security_group.test.tags["Seed"] } } data "aws_security_group" "by_filter" { filter { name = "group-name" - values = ["${aws_security_group.test.name}"] + values = [aws_security_group.test.name] } } `, rInt, rInt) diff --git a/aws/data_source_aws_security_groups_test.go b/aws/data_source_aws_security_groups_test.go index 466d2a1c562..fb99f00db35 100644 --- a/aws/data_source_aws_security_groups_test.go +++ b/aws/data_source_aws_security_groups_test.go @@ -54,7 +54,7 @@ resource "aws_vpc" "test_tag" { resource "aws_security_group" "test" { count = 3 - vpc_id = "${aws_vpc.test_tag.id}" + vpc_id = aws_vpc.test_tag.id name = "tf-%[1]d-${count.index}" tags = { @@ -64,7 +64,7 @@ resource "aws_security_group" "test" { data "aws_security_groups" "by_tag" { tags = { - Seed = "${aws_security_group.test.0.tags["Seed"]}" + Seed = aws_security_group.test.0.tags["Seed"] } } `, rInt) @@ -82,7 +82,7 @@ resource "aws_vpc" "test_filter" { resource "aws_security_group" "test" { count = 3 - vpc_id = "${aws_vpc.test_filter.id}" + vpc_id = aws_vpc.test_filter.id name = "tf-%[1]d-${count.index}" tags = { @@ -93,7 +93,7 @@ resource "aws_security_group" "test" { data "aws_security_groups" "by_filter" { filter { name = "vpc-id" - values = ["${aws_vpc.test_filter.id}"] + values = [aws_vpc.test_filter.id] } filter { diff --git a/aws/data_source_aws_sfn_activity_test.go b/aws/data_source_aws_sfn_activity_test.go index 9de84fda2bb..b8cc56f08b0 100644 --- a/aws/data_source_aws_sfn_activity_test.go +++ b/aws/data_source_aws_sfn_activity_test.go @@ -42,8 +42,9 @@ func testAccCheckAWSStepFunctionsActivityDataSourceConfig_ActivityArn(rName stri resource aws_sfn_activity "test" { name = "%s" } + data aws_sfn_activity "test" { - arn = "${aws_sfn_activity.test.id}" + arn = aws_sfn_activity.test.id } `, rName) } @@ -53,8 +54,9 @@ func testAccCheckAWSStepFunctionsActivityDataSourceConfig_ActivityName(rName str resource aws_sfn_activity "test" { name = "%s" } + data aws_sfn_activity "test" { - name = "${aws_sfn_activity.test.name}" + name = aws_sfn_activity.test.name } `, rName) } diff --git a/aws/data_source_aws_sfn_state_machine_test.go b/aws/data_source_aws_sfn_state_machine_test.go index ee7612d7e78..461c53bf0c0 100644 --- a/aws/data_source_aws_sfn_state_machine_test.go +++ b/aws/data_source_aws_sfn_state_machine_test.go @@ -57,7 +57,7 @@ EOF resource "aws_sfn_state_machine" "test" { name = "test_sfn_%s" - role_arn = "${aws_iam_role.iam_for_sfn.arn}" + role_arn = aws_iam_role.iam_for_sfn.arn definition = <