provider/aws: Fix acceptance tests w/ missing values (#11377)
This commit is contained in:
parent
e81d096699
commit
cbaf051af5
|
@ -28,8 +28,8 @@ func TestAccAWSAPIGatewayIntegrationResponse_basic(t *testing.T) {
|
||||||
"aws_api_gateway_integration_response.test", "response_templates.application/json", ""),
|
"aws_api_gateway_integration_response.test", "response_templates.application/json", ""),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_api_gateway_integration_response.test", "response_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"),
|
"aws_api_gateway_integration_response.test", "response_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_api_gateway_integration_response.test", "content_handling", ""),
|
"aws_api_gateway_integration_response.test", "content_handling"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) {
|
||||||
"aws_api_gateway_integration.test", "request_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"),
|
"aws_api_gateway_integration.test", "request_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_api_gateway_integration.test", "passthrough_behavior", "WHEN_NO_MATCH"),
|
"aws_api_gateway_integration.test", "passthrough_behavior", "WHEN_NO_MATCH"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_api_gateway_integration.test", "content_handling", ""),
|
"aws_api_gateway_integration.test", "content_handling"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ func TestAccAWSAPIGatewayRestApi_basic(t *testing.T) {
|
||||||
"aws_api_gateway_rest_api.test", "description", ""),
|
"aws_api_gateway_rest_api.test", "description", ""),
|
||||||
resource.TestCheckResourceAttrSet(
|
resource.TestCheckResourceAttrSet(
|
||||||
"aws_api_gateway_rest_api.test", "created_date"),
|
"aws_api_gateway_rest_api.test", "created_date"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_api_gateway_rest_api.test", "binary_media_types", ""),
|
"aws_api_gateway_rest_api.test", "binary_media_types"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -277,8 +277,8 @@ func TestAccAWSAutoScalingGroup_enablingMetrics(t *testing.T) {
|
||||||
Config: testAccAWSAutoScalingGroupConfig(randName),
|
Config: testAccAWSAutoScalingGroupConfig(randName),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group),
|
testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_autoscaling_group.bar", "enabled_metrics.#", ""),
|
"aws_autoscaling_group.bar", "enabled_metrics"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,8 @@ func TestAccAWSCodeCommitRepository_create_and_update_default_branch(t *testing.
|
||||||
Config: testAccCodeCommitRepository_basic(rInt),
|
Config: testAccCodeCommitRepository_basic(rInt),
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test"),
|
testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_codecommit_repository.test", "default_branch", ""),
|
"aws_codecommit_repository.test", "default_branch"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
resource.TestStep{
|
resource.TestStep{
|
||||||
|
|
|
@ -51,8 +51,8 @@ func TestAccAWSAccessKey_encrypted(t *testing.T) {
|
||||||
testAccCheckAWSAccessKeyExists("aws_iam_access_key.a_key", &conf),
|
testAccCheckAWSAccessKeyExists("aws_iam_access_key.a_key", &conf),
|
||||||
testAccCheckAWSAccessKeyAttributes(&conf),
|
testAccCheckAWSAccessKeyAttributes(&conf),
|
||||||
testDecryptSecretKeyAndTest("aws_iam_access_key.a_key", testPrivKey1),
|
testDecryptSecretKeyAndTest("aws_iam_access_key.a_key", testPrivKey1),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_iam_access_key.a_key", "secret", ""),
|
"aws_iam_access_key.a_key", "secret"),
|
||||||
resource.TestCheckResourceAttrSet(
|
resource.TestCheckResourceAttrSet(
|
||||||
"aws_iam_access_key.a_key", "encrypted_secret"),
|
"aws_iam_access_key.a_key", "encrypted_secret"),
|
||||||
resource.TestCheckResourceAttrSet(
|
resource.TestCheckResourceAttrSet(
|
||||||
|
|
|
@ -134,8 +134,8 @@ func TestAccAWSKinesisStream_shardLevelMetrics(t *testing.T) {
|
||||||
Check: resource.ComposeTestCheckFunc(
|
Check: resource.ComposeTestCheckFunc(
|
||||||
testAccCheckKinesisStreamExists("aws_kinesis_stream.test_stream", &stream),
|
testAccCheckKinesisStreamExists("aws_kinesis_stream.test_stream", &stream),
|
||||||
testAccCheckAWSKinesisStreamAttributes(&stream),
|
testAccCheckAWSKinesisStreamAttributes(&stream),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_kinesis_stream.test_stream", "shard_level_metrics.#", ""),
|
"aws_kinesis_stream.test_stream", "shard_level_metrics"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ func TestAccAWSLambdaFunction_envVariables(t *testing.T) {
|
||||||
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf),
|
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf),
|
||||||
testAccCheckAwsLambdaFunctionName(&conf, rName),
|
testAccCheckAwsLambdaFunctionName(&conf, rName),
|
||||||
testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":"+rName),
|
testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":"+rName),
|
||||||
resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "environment.#", "0"),
|
resource.TestCheckNoResourceAttr("aws_lambda_function.lambda_function_test", "environment"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -102,8 +102,7 @@ func TestAccAWSLambdaFunction_envVariables(t *testing.T) {
|
||||||
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf),
|
testAccCheckAwsLambdaFunctionExists("aws_lambda_function.lambda_function_test", rName, &conf),
|
||||||
testAccCheckAwsLambdaFunctionName(&conf, rName),
|
testAccCheckAwsLambdaFunctionName(&conf, rName),
|
||||||
testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":"+rName),
|
testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":"+rName),
|
||||||
resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "environment.0.variables.foo", ""),
|
resource.TestCheckNoResourceAttr("aws_lambda_function.lambda_function_test", "environment"),
|
||||||
resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "environment.0.variables.foo1", ""),
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -52,9 +52,9 @@ func TestAccAWSLightsailKeyPair_imported(t *testing.T) {
|
||||||
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "arn"),
|
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "arn"),
|
||||||
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "fingerprint"),
|
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "fingerprint"),
|
||||||
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "public_key"),
|
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "public_key"),
|
||||||
resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_fingerprint", ""),
|
resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_fingerprint"),
|
||||||
resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_private_key", ""),
|
resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_private_key"),
|
||||||
resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key", ""),
|
resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -79,7 +79,7 @@ func TestAccAWSLightsailKeyPair_encrypted(t *testing.T) {
|
||||||
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_fingerprint"),
|
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_fingerprint"),
|
||||||
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_private_key"),
|
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "encrypted_private_key"),
|
||||||
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "public_key"),
|
resource.TestCheckResourceAttrSet("aws_lightsail_key_pair.lightsail_key_pair_test", "public_key"),
|
||||||
resource.TestCheckResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key", ""),
|
resource.TestCheckNoResourceAttr("aws_lightsail_key_pair.lightsail_key_pair_test", "private_key"),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,8 +42,8 @@ func TestAccAWSS3Bucket_basic(t *testing.T) {
|
||||||
"aws_s3_bucket.bucket", "hosted_zone_id", HostedZoneIDForRegion("us-west-2")),
|
"aws_s3_bucket.bucket", "hosted_zone_id", HostedZoneIDForRegion("us-west-2")),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckResourceAttr(
|
||||||
"aws_s3_bucket.bucket", "region", "us-west-2"),
|
"aws_s3_bucket.bucket", "region", "us-west-2"),
|
||||||
resource.TestCheckResourceAttr(
|
resource.TestCheckNoResourceAttr(
|
||||||
"aws_s3_bucket.bucket", "website_endpoint", ""),
|
"aws_s3_bucket.bucket", "website_endpoint"),
|
||||||
resource.TestMatchResourceAttr(
|
resource.TestMatchResourceAttr(
|
||||||
"aws_s3_bucket.bucket", "arn", arnRegexp),
|
"aws_s3_bucket.bucket", "arn", arnRegexp),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue