Skip to content

Commit

Permalink
d/aws_apigatewayv2_export: Fix 'Error: error exporting Gateway v2 API…
Browse files Browse the repository at this point in the history
… (o1hlpon70b): BadRequestException: No deployment is available in the stage tf-acc-test-5885592264819914276'.
  • Loading branch information
ewbankkit authored and anGie44 committed Jan 24, 2022
1 parent deda445 commit a461715
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions internal/service/apigatewayv2/export_data_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,28 +77,33 @@ resource "aws_apigatewayv2_route" "test" {
}

func testAccExportHTTPDataSourceBasicConfig(rName string) string {
return testAccExportHTTPDataSourceConfigBase(rName) + `
return acctest.ConfigCompose(testAccExportHTTPDataSourceConfigBase(rName), `
data "aws_apigatewayv2_export" "test" {
api_id = aws_apigatewayv2_route.test.api_id
specification = "OAS30"
output_type = "JSON"
}
`
`)
}

func testAccExportHTTPDataSourceStageConfig(rName string) string {
return testAccExportHTTPDataSourceConfigBase(rName) + fmt.Sprintf(`
return acctest.ConfigCompose(testAccExportHTTPDataSourceConfigBase(rName), fmt.Sprintf(`
resource "aws_apigatewayv2_stage" "test" {
api_id = aws_apigatewayv2_deployment.test.api_id
name = %[1]q
deployment_id = aws_apigatewayv2_deployment.test.id
}
resource "aws_apigatewayv2_deployment" "test" {
api_id = aws_apigatewayv2_route.test.api_id
name = %[1]q
auto_deploy = true
description = %[1]q
}
data "aws_apigatewayv2_export" "test" {
api_id = aws_apigatewayv2_route.test.api_id
api_id = aws_apigatewayv2_api.test.id
specification = "OAS30"
output_type = "JSON"
stage_name = aws_apigatewayv2_stage.test.name
}
`, rName)
`, rName))
}

0 comments on commit a461715

Please sign in to comment.