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

New resource: aws_apigatewayv2_route #8881

Merged

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jun 5, 2019

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" comments, they generate extra noise for pull request followers and do not help prioritize the request

Another resource for #7004.

Release note for CHANGELOG:

FEATURES:

* New Resource: aws_apigatewayv2_route

Output from acceptance testing:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGateway2Route_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAPIGateway2Route_ -timeout 120m
=== RUN   TestAccAWSAPIGateway2Route_basic
=== PAUSE TestAccAWSAPIGateway2Route_basic
=== RUN   TestAccAWSAPIGateway2Route_Authorizer
=== PAUSE TestAccAWSAPIGateway2Route_Authorizer
=== RUN   TestAccAWSAPIGateway2Route_Model
=== PAUSE TestAccAWSAPIGateway2Route_Model
=== RUN   TestAccAWSAPIGateway2Route_SimpleAttributes
=== PAUSE TestAccAWSAPIGateway2Route_SimpleAttributes
=== RUN   TestAccAWSAPIGateway2Route_Target
=== PAUSE TestAccAWSAPIGateway2Route_Target
=== CONT  TestAccAWSAPIGateway2Route_basic
=== CONT  TestAccAWSAPIGateway2Route_Target
=== CONT  TestAccAWSAPIGateway2Route_SimpleAttributes
=== CONT  TestAccAWSAPIGateway2Route_Model
=== CONT  TestAccAWSAPIGateway2Route_Authorizer
--- PASS: TestAccAWSAPIGateway2Route_basic (21.57s)
--- PASS: TestAccAWSAPIGateway2Route_Model (23.63s)
--- PASS: TestAccAWSAPIGateway2Route_Target (33.68s)
--- PASS: TestAccAWSAPIGateway2Route_SimpleAttributes (46.55s)
--- PASS: TestAccAWSAPIGateway2Route_Authorizer (59.10s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	59.142s

Currently based on #8842, will need to rebase once that PR is merged.

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/apigateway Issues and PRs that pertain to the apigateway service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jun 5, 2019
@ewbankkit ewbankkit mentioned this pull request Jun 5, 2019
@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_route branch 2 times, most recently from f5f1093 to 7b58039 Compare June 7, 2019 16:18
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Jun 7, 2019

Acceptance tests so far:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGateway2Route_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAPIGateway2Route_ -timeout 120m
=== RUN   TestAccAWSAPIGateway2Route_basic
=== PAUSE TestAccAWSAPIGateway2Route_basic
=== RUN   TestAccAWSAPIGateway2Route_update
=== PAUSE TestAccAWSAPIGateway2Route_update
=== CONT  TestAccAWSAPIGateway2Route_basic
=== CONT  TestAccAWSAPIGateway2Route_update
--- PASS: TestAccAWSAPIGateway2Route_basic (25.74s)
--- PASS: TestAccAWSAPIGateway2Route_update (65.13s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	65.224s

Testing additional attributes requires additional resources for authorizers, models and integrations.

@aeschright aeschright requested a review from a team June 28, 2019 18:14
@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_route branch from 836235b to 6832550 Compare July 1, 2019 16:57
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. and removed size/XL Managed by automation to categorize the size of a PR. labels Jul 1, 2019
@ewbankkit
Copy link
Contributor Author

Rebased to track #8842 (comment).

@ewbankkit
Copy link
Contributor Author

Includes

Will need to rebase as these are merged.

@ewbankkit ewbankkit changed the title [WIP] New resource: aws_api_gateway_v2_route New resource: aws_api_gateway_v2_route Jul 13, 2019
@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_route branch from ac0ec49 to 1468489 Compare July 26, 2019 20:41
@ewbankkit
Copy link
Contributor Author

Rebased to fix merge conflict.
Acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGateway2Route_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAPIGateway2Route_ -timeout 120m
=== RUN   TestAccAWSAPIGateway2Route_basic
=== PAUSE TestAccAWSAPIGateway2Route_basic
=== RUN   TestAccAWSAPIGateway2Route_Authorizer
=== PAUSE TestAccAWSAPIGateway2Route_Authorizer
=== RUN   TestAccAWSAPIGateway2Route_Model
=== PAUSE TestAccAWSAPIGateway2Route_Model
=== RUN   TestAccAWSAPIGateway2Route_SimpleAttributes
=== PAUSE TestAccAWSAPIGateway2Route_SimpleAttributes
=== RUN   TestAccAWSAPIGateway2Route_Target
=== PAUSE TestAccAWSAPIGateway2Route_Target
=== CONT  TestAccAWSAPIGateway2Route_basic
=== CONT  TestAccAWSAPIGateway2Route_Target
=== CONT  TestAccAWSAPIGateway2Route_SimpleAttributes
=== CONT  TestAccAWSAPIGateway2Route_Model
=== CONT  TestAccAWSAPIGateway2Route_Authorizer
--- PASS: TestAccAWSAPIGateway2Route_Target (23.34s)
--- PASS: TestAccAWSAPIGateway2Route_basic (23.52s)
--- PASS: TestAccAWSAPIGateway2Route_Model (39.58s)
--- PASS: TestAccAWSAPIGateway2Route_SimpleAttributes (48.75s)
--- PASS: TestAccAWSAPIGateway2Route_Authorizer (58.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	58.882s

@ewbankkit
Copy link
Contributor Author

Re-ran acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGateway2Route_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAWSAPIGateway2Route_ -timeout 120m
=== RUN   TestAccAWSAPIGateway2Route_basic
=== PAUSE TestAccAWSAPIGateway2Route_basic
=== RUN   TestAccAWSAPIGateway2Route_Authorizer
=== PAUSE TestAccAWSAPIGateway2Route_Authorizer
=== RUN   TestAccAWSAPIGateway2Route_Model
=== PAUSE TestAccAWSAPIGateway2Route_Model
=== RUN   TestAccAWSAPIGateway2Route_SimpleAttributes
=== PAUSE TestAccAWSAPIGateway2Route_SimpleAttributes
=== RUN   TestAccAWSAPIGateway2Route_Target
=== PAUSE TestAccAWSAPIGateway2Route_Target
=== CONT  TestAccAWSAPIGateway2Route_basic
=== CONT  TestAccAWSAPIGateway2Route_Target
=== CONT  TestAccAWSAPIGateway2Route_SimpleAttributes
=== CONT  TestAccAWSAPIGateway2Route_Model
=== CONT  TestAccAWSAPIGateway2Route_Authorizer
--- PASS: TestAccAWSAPIGateway2Route_Target (23.40s)
--- PASS: TestAccAWSAPIGateway2Route_Model (29.59s)
--- PASS: TestAccAWSAPIGateway2Route_basic (31.16s)
--- PASS: TestAccAWSAPIGateway2Route_SimpleAttributes (57.02s)
--- PASS: TestAccAWSAPIGateway2Route_Authorizer (57.93s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	57.949s

@aeschright aeschright added the new-resource Introduces a new resource. label Aug 19, 2019
@ewbankkit
Copy link
Contributor Author

After merge of #8949, #8912 and #9228, incorporate all the feedback:

  • Migrate to Terraform provider SDK
  • Change resource name to aws_apigatewayv2_blah; Rename source files
  • Remove sidebar_current from documentation
  • Add subcategory: "API Gateway v2 (WebSocket and HTTP APIs)" to documentation
  • Change function names to ApiGatewayV2
  • Add _disappears acceptance test
  • Use multierror in any test sweeper

@ewbankkit ewbankkit changed the title New resource: aws_api_gateway_v2_route New resource: aws_apigatewayv2_route Apr 9, 2020
Acceptance test output:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Route_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Route_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Route_basic
=== PAUSE TestAccAWSAPIGatewayV2Route_basic
=== RUN   TestAccAWSAPIGatewayV2Route_disappears
=== PAUSE TestAccAWSAPIGatewayV2Route_disappears
=== RUN   TestAccAWSAPIGatewayV2Route_Model
=== PAUSE TestAccAWSAPIGatewayV2Route_Model
=== RUN   TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== PAUSE TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== RUN   TestAccAWSAPIGatewayV2Route_Target
=== PAUSE TestAccAWSAPIGatewayV2Route_Target
=== CONT  TestAccAWSAPIGatewayV2Route_basic
=== CONT  TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== CONT  TestAccAWSAPIGatewayV2Route_Model
=== CONT  TestAccAWSAPIGatewayV2Route_Target
=== CONT  TestAccAWSAPIGatewayV2Route_disappears
--- PASS: TestAccAWSAPIGatewayV2Route_disappears (23.60s)
--- PASS: TestAccAWSAPIGatewayV2Route_basic (26.45s)
--- PASS: TestAccAWSAPIGatewayV2Route_Target (28.53s)
--- PASS: TestAccAWSAPIGatewayV2Route_Model (29.18s)
--- PASS: TestAccAWSAPIGatewayV2Route_SimpleAttributes (58.48s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	58.539s
@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_route branch from 6a80c6c to 8aa0e7c Compare April 9, 2020 21:26
@ghost ghost added size/XL Managed by automation to categorize the size of a PR. and removed size/XXL Managed by automation to categorize the size of a PR. labels Apr 9, 2020
@ewbankkit
Copy link
Contributor Author

Renamed resource to aws_apigatewayv2_route.
Re-ran acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Route_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Route_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Route_basic
=== PAUSE TestAccAWSAPIGatewayV2Route_basic
=== RUN   TestAccAWSAPIGatewayV2Route_disappears
=== PAUSE TestAccAWSAPIGatewayV2Route_disappears
=== RUN   TestAccAWSAPIGatewayV2Route_Authorizer
=== PAUSE TestAccAWSAPIGatewayV2Route_Authorizer
=== RUN   TestAccAWSAPIGatewayV2Route_JwtAuthorization
=== PAUSE TestAccAWSAPIGatewayV2Route_JwtAuthorization
=== RUN   TestAccAWSAPIGatewayV2Route_Model
=== PAUSE TestAccAWSAPIGatewayV2Route_Model
=== RUN   TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== PAUSE TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== RUN   TestAccAWSAPIGatewayV2Route_Target
=== PAUSE TestAccAWSAPIGatewayV2Route_Target
=== CONT  TestAccAWSAPIGatewayV2Route_basic
=== CONT  TestAccAWSAPIGatewayV2Route_Model
=== CONT  TestAccAWSAPIGatewayV2Route_Target
=== CONT  TestAccAWSAPIGatewayV2Route_JwtAuthorization
=== CONT  TestAccAWSAPIGatewayV2Route_Authorizer
=== CONT  TestAccAWSAPIGatewayV2Route_SimpleAttributes
=== CONT  TestAccAWSAPIGatewayV2Route_disappears
--- PASS: TestAccAWSAPIGatewayV2Route_disappears (23.66s)
--- PASS: TestAccAWSAPIGatewayV2Route_basic (27.63s)
--- PASS: TestAccAWSAPIGatewayV2Route_Model (29.72s)
--- PASS: TestAccAWSAPIGatewayV2Route_Target (29.80s)
--- PASS: TestAccAWSAPIGatewayV2Route_SimpleAttributes (59.29s)
--- PASS: TestAccAWSAPIGatewayV2Route_JwtAuthorization (67.32s)
--- PASS: TestAccAWSAPIGatewayV2Route_Authorizer (76.36s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	76.442s

@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_route branch from 8aa0e7c to 4ba6eba Compare April 9, 2020 21:32
@ewbankkit
Copy link
Contributor Author

This is now ready for review.

Copy link
Contributor

@gdavison gdavison left a comment

Choose a reason for hiding this comment

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

One comment on the documentation, but otherwise, LGTM 🚀

--- PASS: TestAccAWSAPIGatewayV2Route_disappears (9.94s)
--- PASS: TestAccAWSAPIGatewayV2Route_basic (10.62s)
--- PASS: TestAccAWSAPIGatewayV2Route_Target (11.13s)
--- PASS: TestAccAWSAPIGatewayV2Route_Model (18.21s)
--- PASS: TestAccAWSAPIGatewayV2Route_SimpleAttributes (20.87s)
--- PASS: TestAccAWSAPIGatewayV2Route_JwtAuthorization (22.82s)
--- PASS: TestAccAWSAPIGatewayV2Route_Authorizer (42.87s)

return fmt.Errorf("Not Found: %s", integrationResourceName)
}

return resource.TestCheckResourceAttr(resourceName, "target", fmt.Sprintf("integrations/%s", rs.Primary.ID))(s)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like how you implemented this to get the specific value


## Import

`aws_apigatewayv2_route` can be imported by using the API identifier and route identifier, e.g.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since routes managed by API Gateway cannot be imported, please add a note in this section indicating that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Added the same for the aws_apigatewayv2_integration resource.

@bflad bflad removed the service/apigateway Issues and PRs that pertain to the apigateway service. label Apr 15, 2020
…resources created as part of API quick create.
@gdavison gdavison merged commit e899956 into hashicorp:master Apr 15, 2020
gdavison added a commit that referenced this pull request Apr 15, 2020
@gdavison gdavison added this to the v2.58.0 milestone Apr 15, 2020
@ewbankkit ewbankkit deleted the issue-7004.aws_api_gateway_v2_route branch April 15, 2020 17:39
@ghost
Copy link

ghost commented Apr 17, 2020

This has been released in version 2.58.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 May 16, 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 and limited conversation to collaborators May 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. 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.

4 participants