Skip to content

Commit

Permalink
tests/resource/aws_sns_topic_subscription: Fix Terraform 0.12 syntax
Browse files Browse the repository at this point in the history
These changes are backwards compatible with Terraform 0.11. The remaining configuration error requires this upstream issue: hashicorp/terraform#20098

Previous output from Terraform 0.12 acceptance testing:

```
--- FAIL: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (0.44s)
    testing.go:568: Step 0 error: /opt/teamcity-agent/temp/buildTmp/tf-test250105636/main.tf:25,5-6: Invalid argument name; Argument names must not be quoted.

--- FAIL: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (0.60s)
    testing.go:568: Step 0 error: /opt/teamcity-agent/temp/buildTmp/tf-test092280804/main.tf:26,5-6: Invalid argument name; Argument names must not be quoted.
```

Output from Terraform 0.12 acceptance testing (additional fixes required upstream in Terraform Provider SDK):

```
--- FAIL: TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint (1.70s)
    testing.go:568: Step 0 error: config is invalid: Error in function call: Call to function "file" failed: contents of test-fixtures/lambda_confirm_sns.zip are not valid UTF-8; to read arbitrary bytes, use the filebase64 function instead.
--- FAIL: TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint (1.70s)
    testing.go:568: Step 0 error: config is invalid: 2 problems:

        - Error in function call: Call to function "file" failed: contents of test-fixtures/lambda_confirm_sns.zip are not valid UTF-8; to read arbitrary bytes, use the filebase64 function instead.
        - Error in function call: Call to function "file" failed: contents of test-fixtures/lambda_basic_authorizer.zip are not valid UTF-8; to read arbitrary bytes, use the filebase64 function instead.
```
  • Loading branch information
bflad committed Jan 24, 2019
1 parent 51d7335 commit c052a39
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions aws/resource_aws_sns_topic_subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ resource "aws_api_gateway_method_response" "test" {
http_method = "${aws_api_gateway_method.test.http_method}"
status_code = "200"
response_parameters {
response_parameters = {
"method.response.header.Access-Control-Allow-Origin" = true
}
}
Expand All @@ -514,7 +514,7 @@ resource "aws_api_gateway_integration_response" "test" {
http_method = "${aws_api_gateway_method.test.http_method}"
status_code = "${aws_api_gateway_method_response.test.status_code}"
response_parameters {
response_parameters = {
"method.response.header.Access-Control-Allow-Origin" = "'*'"
}
}
Expand Down Expand Up @@ -617,7 +617,7 @@ resource "aws_api_gateway_method_response" "test" {
http_method = "${aws_api_gateway_method.test.http_method}"
status_code = "200"
response_parameters {
response_parameters = {
"method.response.header.Access-Control-Allow-Origin" = true
}
}
Expand All @@ -638,7 +638,7 @@ resource "aws_api_gateway_integration_response" "test" {
http_method = "${aws_api_gateway_method.test.http_method}"
status_code = "${aws_api_gateway_method_response.test.status_code}"
response_parameters {
response_parameters = {
"method.response.header.Access-Control-Allow-Origin" = "'*'"
}
}
Expand Down Expand Up @@ -762,7 +762,7 @@ resource "aws_lambda_function" "authorizer" {
runtime = "nodejs6.10"
environment {
variables {
variables = {
AUTH_USER="%s"
AUTH_PASS="%s"
}
Expand Down

0 comments on commit c052a39

Please sign in to comment.