Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r/aws_apigatewayv2_stage: Correctly handle deletion of route_settings #16133

Conversation

ewbankkit
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes: #16094.

Release note for CHANGELOG:

resource/aws_apigatewayv2_stage: Correctly handle deletion of route_settings

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Stage_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSAPIGatewayV2Stage_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== PAUSE TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== RUN   TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_disappears
=== PAUSE TestAccAWSAPIGatewayV2Stage_disappears
=== RUN   TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== PAUSE TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== RUN   TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== PAUSE TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_Deployment
=== PAUSE TestAccAWSAPIGatewayV2Stage_Deployment
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== RUN   TestAccAWSAPIGatewayV2Stage_StageVariables
=== PAUSE TestAccAWSAPIGatewayV2Stage_StageVariables
=== RUN   TestAccAWSAPIGatewayV2Stage_Tags
=== PAUSE TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_StageVariables
--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (21.08s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (33.37s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (33.85s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_Deployment
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute (37.98s)
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (44.02s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (45.42s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (24.58s)
=== CONT  TestAccAWSAPIGatewayV2Stage_AccessLogSettings
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (41.40s)
=== CONT  TestAccAWSAPIGatewayV2Stage_disappears
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (41.28s)
=== CONT  TestAccAWSAPIGatewayV2Stage_autoDeployHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (14.36s)
=== CONT  TestAccAWSAPIGatewayV2Stage_defaultHttpStage
--- PASS: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (58.89s)
=== CONT  TestAccAWSAPIGatewayV2Stage_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (18.91s)
=== CONT  TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (32.23s)
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (17.51s)
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (30.47s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	182.621s

Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Stage_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSAPIGatewayV2Stage_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== PAUSE TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== RUN   TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_disappears
=== PAUSE TestAccAWSAPIGatewayV2Stage_disappears
=== RUN   TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== PAUSE TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== RUN   TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== PAUSE TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_Deployment
=== PAUSE TestAccAWSAPIGatewayV2Stage_Deployment
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_StageVariables
=== PAUSE TestAccAWSAPIGatewayV2Stage_StageVariables
=== RUN   TestAccAWSAPIGatewayV2Stage_Tags
=== PAUSE TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (19.97s)
=== CONT  TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (48.55s)
=== CONT  TestAccAWSAPIGatewayV2Stage_AccessLogSettings
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (48.75s)
=== CONT  TestAccAWSAPIGatewayV2Stage_disappears
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (33.71s)
=== CONT  TestAccAWSAPIGatewayV2Stage_autoDeployHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (15.41s)
=== CONT  TestAccAWSAPIGatewayV2Stage_defaultHttpStage
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (20.80s)
=== CONT  TestAccAWSAPIGatewayV2Stage_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (31.71s)
=== CONT  TestAccAWSAPIGatewayV2Stage_StageVariables
--- PASS: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (56.49s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Tags
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (33.14s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (34.05s)
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (32.90s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Deployment
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (24.40s)
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (46.65s)
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (47.40s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	166.012s
Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Stage_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSAPIGatewayV2Stage_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== PAUSE TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== RUN   TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_disappears
=== PAUSE TestAccAWSAPIGatewayV2Stage_disappears
=== RUN   TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== PAUSE TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== RUN   TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== PAUSE TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_Deployment
=== PAUSE TestAccAWSAPIGatewayV2Stage_Deployment
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== RUN   TestAccAWSAPIGatewayV2Stage_StageVariables
=== PAUSE TestAccAWSAPIGatewayV2Stage_StageVariables
=== RUN   TestAccAWSAPIGatewayV2Stage_Tags
=== PAUSE TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_StageVariables
--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (21.08s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (33.37s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (33.85s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_Deployment
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute (37.98s)
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (44.02s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (45.42s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (24.58s)
=== CONT  TestAccAWSAPIGatewayV2Stage_AccessLogSettings
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (41.40s)
=== CONT  TestAccAWSAPIGatewayV2Stage_disappears
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (41.28s)
=== CONT  TestAccAWSAPIGatewayV2Stage_autoDeployHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (14.36s)
=== CONT  TestAccAWSAPIGatewayV2Stage_defaultHttpStage
--- PASS: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (58.89s)
=== CONT  TestAccAWSAPIGatewayV2Stage_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (18.91s)
=== CONT  TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (32.23s)
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (17.51s)
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (30.47s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	182.621s
@ewbankkit ewbankkit requested a review from a team as a code owner November 10, 2020 21:50
@ghost ghost added size/L Managed by automation to categorize the size of a PR. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 10, 2020
@DrFaust92 DrFaust92 assigned DrFaust92 and unassigned DrFaust92 Nov 10, 2020
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Nov 11, 2020

As noticed by @DrFaust92:

$ AWS_DEFAULT_REGION=us-east-2 make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Stage_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSAPIGatewayV2Stage_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== PAUSE TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== RUN   TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_disappears
=== PAUSE TestAccAWSAPIGatewayV2Stage_disappears
=== RUN   TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== PAUSE TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== RUN   TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== PAUSE TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_Deployment
=== PAUSE TestAccAWSAPIGatewayV2Stage_Deployment
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== RUN   TestAccAWSAPIGatewayV2Stage_StageVariables
=== PAUSE TestAccAWSAPIGatewayV2Stage_StageVariables
=== RUN   TestAccAWSAPIGatewayV2Stage_Tags
=== PAUSE TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== CONT  TestAccAWSAPIGatewayV2Stage_Tags
--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (15.31s)
=== CONT  TestAccAWSAPIGatewayV2Stage_StageVariables
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (24.57s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (33.09s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (22.54s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
    resource_aws_apigatewayv2_stage_test.go:618: Step 1/4 error: Error running apply: 2020/11/11 10:44:02 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.10.0
        
        Error: error creating API Gateway v2 stage: BadRequestException: CloudWatch Logs role ARN must be set in account settings to enable logging
        
        
--- FAIL: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (5.73s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Deployment
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute (25.92s)
=== CONT  TestAccAWSAPIGatewayV2Stage_disappears
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (15.74s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (10.40s)
=== CONT  TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
    resource_aws_apigatewayv2_stage_test.go:392: Step 1/4 error: Error running apply: 2020/11/11 10:44:23 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.10.0
        
        Error: error creating API Gateway v2 stage: BadRequestException: CloudWatch Logs role ARN must be set in account settings to enable logging
        
        
--- FAIL: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (5.34s)
=== CONT  TestAccAWSAPIGatewayV2Stage_AccessLogSettings
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (31.77s)
=== CONT  TestAccAWSAPIGatewayV2Stage_defaultHttpStage
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (12.66s)
=== CONT  TestAccAWSAPIGatewayV2Stage_autoDeployHttp
2020/11/11 10:44:41 [DEBUG] Trying to get account information via sts:GetCallerIdentity
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (20.55s)
=== CONT  TestAccAWSAPIGatewayV2Stage_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (11.51s)
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (19.62s)
--- PASS: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (43.39s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	108.152s
FAIL
GNUmakefile:27: recipe for target 'testacc' failed
make: *** [testacc] Error 1

The necessary permissions are only getting set in TestAccAWSAPIGatewayV2Stage_AccessLogSettings, which runs last.

Because of concurrency issues, add a PreCheck for the correct configuration.
Instructions on configuring the CloudWatch role ARN here.

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. service/apigateway Issues and PRs that pertain to the apigateway service. and removed size/L Managed by automation to categorize the size of a PR. labels Nov 11, 2020
@ewbankkit
Copy link
Contributor Author

Running in a region where a CloudWatch role ARN has not been configured:

$ AWS_DEFAULT_REGION=eu-west-1 make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Stage_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSAPIGatewayV2Stage_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== PAUSE TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== RUN   TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_disappears
=== PAUSE TestAccAWSAPIGatewayV2Stage_disappears
=== RUN   TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== PAUSE TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== RUN   TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== PAUSE TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_Deployment
=== PAUSE TestAccAWSAPIGatewayV2Stage_Deployment
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== RUN   TestAccAWSAPIGatewayV2Stage_StageVariables
=== PAUSE TestAccAWSAPIGatewayV2Stage_StageVariables
=== RUN   TestAccAWSAPIGatewayV2Stage_Tags
=== PAUSE TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== CONT  TestAccAWSAPIGatewayV2Stage_Tags
--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (22.85s)
=== CONT  TestAccAWSAPIGatewayV2Stage_StageVariables
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (35.51s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (48.84s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (33.11s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
    resource_aws_api_gateway_account_test.go:133: skipping tests; no API Gateway CloudWatch role ARN has been configured in this region
--- SKIP: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (1.03s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Deployment
=== CONT  TestAccAWSAPIGatewayV2Stage_disappears
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute (40.86s)
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (26.13s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
    resource_aws_api_gateway_account_test.go:133: skipping tests; no API Gateway CloudWatch role ARN has been configured in this region
--- SKIP: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (1.01s)
=== CONT  TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (15.32s)
=== CONT  TestAccAWSAPIGatewayV2Stage_AccessLogSettings
    resource_aws_api_gateway_account_test.go:133: skipping tests; no API Gateway CloudWatch role ARN has been configured in this region
--- SKIP: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (1.00s)
=== CONT  TestAccAWSAPIGatewayV2Stage_defaultHttpStage
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (46.55s)
=== CONT  TestAccAWSAPIGatewayV2Stage_autoDeployHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (18.87s)
=== CONT  TestAccAWSAPIGatewayV2Stage_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (32.75s)
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (18.81s)
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (36.43s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	131.885s

Copy link
Collaborator

@DrFaust92 DrFaust92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (62.23s)
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (81.54s)
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (120.29s)
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (109.09s)
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (56.79s)
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (112.54s)
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (35.07s)
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (78.12s)
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (110.24s)
--- PASS: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (86.10s)
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (54.51s)
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (82.48s)
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (85.65s)
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (45.70s)
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute (95.98s)

@breathingdust
Copy link
Member

LGTM 🚀 Thanks @ewbankkit for the contribution!

Verified Acceptance Tests in Commercial (us-west-2)

make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Stage_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSAPIGatewayV2Stage_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== PAUSE TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== RUN   TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_disappears
=== PAUSE TestAccAWSAPIGatewayV2Stage_disappears
=== RUN   TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== PAUSE TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== RUN   TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== PAUSE TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_Deployment
=== PAUSE TestAccAWSAPIGatewayV2Stage_Deployment
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== RUN   TestAccAWSAPIGatewayV2Stage_StageVariables
=== PAUSE TestAccAWSAPIGatewayV2Stage_StageVariables
=== RUN   TestAccAWSAPIGatewayV2Stage_Tags
=== PAUSE TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (18.12s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Tags
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute (33.25s)
=== CONT  TestAccAWSAPIGatewayV2Stage_StageVariables
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (41.61s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (29.61s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (28.50s)
=== CONT  TestAccAWSAPIGatewayV2Stage_disappears
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (14.16s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (41.18s)
=== CONT  TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (41.63s)
=== CONT  TestAccAWSAPIGatewayV2Stage_AccessLogSettings
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (28.42s)
=== CONT  TestAccAWSAPIGatewayV2Stage_defaultHttpStage
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (40.08s)
=== CONT  TestAccAWSAPIGatewayV2Stage_autoDeployHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (27.89s)
=== CONT  TestAccAWSAPIGatewayV2Stage_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (16.89s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Deployment
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (16.86s)
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (20.36s)
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (32.52s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	150.361s

Verified Acceptance Tests in GovCloud (us-gov-west-1)

make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Stage_' ACCTEST_PARALLELISM=3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 3 -run=TestAccAWSAPIGatewayV2Stage_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_basicHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_basicHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== PAUSE TestAccAWSAPIGatewayV2Stage_defaultHttpStage
=== RUN   TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_autoDeployHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_disappears
=== PAUSE TestAccAWSAPIGatewayV2Stage_disappears
=== RUN   TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== PAUSE TestAccAWSAPIGatewayV2Stage_AccessLogSettings
=== RUN   TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== PAUSE TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_Deployment
=== PAUSE TestAccAWSAPIGatewayV2Stage_Deployment
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
=== RUN   TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== PAUSE TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
=== RUN   TestAccAWSAPIGatewayV2Stage_StageVariables
=== PAUSE TestAccAWSAPIGatewayV2Stage_StageVariables
=== RUN   TestAccAWSAPIGatewayV2Stage_Tags
=== PAUSE TestAccAWSAPIGatewayV2Stage_Tags
=== CONT  TestAccAWSAPIGatewayV2Stage_basicWebSocket
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute
--- PASS: TestAccAWSAPIGatewayV2Stage_basicWebSocket (13.71s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute (26.16s)
=== CONT  TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp (31.94s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Deployment
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp (30.18s)
=== CONT  TestAccAWSAPIGatewayV2Stage_disappears
--- PASS: TestAccAWSAPIGatewayV2Stage_Deployment (16.17s)
=== CONT  TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket
--- PASS: TestAccAWSAPIGatewayV2Stage_disappears (9.62s)
=== CONT  TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription
--- PASS: TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket (47.20s)
=== CONT  TestAccAWSAPIGatewayV2Stage_AccessLogSettings
--- PASS: TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription (21.04s)
=== CONT  TestAccAWSAPIGatewayV2Stage_defaultHttpStage
--- PASS: TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket (31.01s)
=== CONT  TestAccAWSAPIGatewayV2Stage_autoDeployHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_defaultHttpStage (12.65s)
=== CONT  TestAccAWSAPIGatewayV2Stage_Tags
--- PASS: TestAccAWSAPIGatewayV2Stage_AccessLogSettings (21.93s)
=== CONT  TestAccAWSAPIGatewayV2Stage_basicHttp
--- PASS: TestAccAWSAPIGatewayV2Stage_autoDeployHttp (21.27s)
=== CONT  TestAccAWSAPIGatewayV2Stage_StageVariables
--- PASS: TestAccAWSAPIGatewayV2Stage_Tags (21.06s)
--- PASS: TestAccAWSAPIGatewayV2Stage_basicHttp (13.23s)
--- PASS: TestAccAWSAPIGatewayV2Stage_StageVariables (19.75s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	121.678s

@breathingdust breathingdust added this to the v3.16.0 milestone Nov 18, 2020
@breathingdust breathingdust merged commit 279bb04 into hashicorp:master Nov 18, 2020
breathingdust added a commit that referenced this pull request Nov 18, 2020
@ewbankkit ewbankkit deleted the b-aws_apigatewayv2_stage-route_settings branch November 18, 2020 17:52
@ghost
Copy link

ghost commented Nov 18, 2020

This has been released in version 3.16.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Dec 19, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/apigateway Issues and PRs that pertain to the apigateway service. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

API Gateway v2 cutom route settings update fails
3 participants