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_deployment #9245

Merged

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented Jul 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_api_gateway_v2_deployment (#7004)

Output from acceptance testing:

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

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

@ewbankkit ewbankkit requested a review from a team July 5, 2019 13:24
@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. service/apigatewayv2 Issues and PRs that pertain to the apigatewayv2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Jul 5, 2019
@ewbankkit ewbankkit mentioned this pull request Jul 5, 2019
@ghost ghost added size/XXL Managed by automation to categorize the size of a PR. and removed size/XL Managed by automation to categorize the size of a PR. labels Jul 13, 2019
@ewbankkit
Copy link
Contributor Author

Includes

@ewbankkit ewbankkit changed the title [WIP] New resource: aws_api_gateway_v2_deployment New resource: aws_api_gateway_v2_deployment Jul 13, 2019
@ewbankkit
Copy link
Contributor Author

Be aware of #162.
Does the same thing happen for WebSocket APIs?

@ewbankkit
Copy link
Contributor Author

Rebased to fix merge conflict.
Acceptance tests:

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

@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_deployment branch 2 times, most recently from 421835c to 48a5eae Compare July 26, 2019 21:16
@ewbankkit
Copy link
Contributor Author

Re-ran acceptance tests:

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

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

So this is now lying dormant for months, I know I'm busting your balls on this but we really need to get this going.

What is holding this back? I'm seeing release notes for issues that are getting a release with a far lower priority.

@bflad bflad removed the service/apigateway Issues and PRs that pertain to the apigateway service. label Apr 15, 2020
@ewbankkit
Copy link
Contributor Author

After merge of #8881, 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_deployment New resource: aws_apigatewayv2_deployment Apr 15, 2020
@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_deployment branch from 6cb96f1 to 36c00bd Compare April 15, 2020 16:16
@ewbankkit
Copy link
Contributor Author

Renamed resource to aws_apigatewayv2_deployment.
Waiter added following pattern established in #12765.
Re-ran acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayV2Deployment_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2Deployment_ -timeout 120m
=== RUN   TestAccAWSAPIGatewayV2Deployment_basic
=== PAUSE TestAccAWSAPIGatewayV2Deployment_basic
=== RUN   TestAccAWSAPIGatewayV2Deployment_disappears
=== PAUSE TestAccAWSAPIGatewayV2Deployment_disappears
=== CONT  TestAccAWSAPIGatewayV2Deployment_basic
=== CONT  TestAccAWSAPIGatewayV2Deployment_disappears
--- PASS: TestAccAWSAPIGatewayV2Deployment_disappears (28.85s)
--- PASS: TestAccAWSAPIGatewayV2Deployment_basic (52.03s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	52.080s

@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_deployment branch from 0878c7b to 166b6ac Compare April 15, 2020 17:38
@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 15, 2020
@ewbankkit ewbankkit force-pushed the issue-7004.aws_api_gateway_v2_deployment branch from 166b6ac to bb318d6 Compare April 15, 2020 17:45
@ewbankkit
Copy link
Contributor Author

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, otherwise LGTM 🚀

--- PASS: TestAccAWSAPIGatewayV2Deployment_disappears (10.72s)
--- PASS: TestAccAWSAPIGatewayV2Deployment_basic (17.94s)


outputRaw, err := stateConf.WaitForState()

switch output := outputRaw.(type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since there are only two possibilities, would if v, ok := outputRaw.(*apigatewayv2.GetDeploymentOutput); ok { ... } work better here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

On implementation, your suggestions seems more maintainable.
I made the change.

}
}

func testAccCheckAWSAPIGatewayV2DeploymentExists(n string, vApiId *string, v *apigatewayv2.GetDeploymentOutput) resource.TestCheckFunc {
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 in this and your other PRs you've added returning the ID to our existing pattern of returning the object.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The returned objects don't include all the necessary information to be able to identify the resource which is different from other AWS APIs.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see. It's a minor convenience/cosmetic thing, but I've seen a number of use cases where it would be handy, or at least meaning fewer dereferences :)

@gdavison gdavison added this to the v2.58.0 milestone Apr 15, 2020
@gdavison gdavison merged commit a3eb0a6 into hashicorp:master Apr 15, 2020
gdavison added a commit that referenced this pull request Apr 15, 2020
@ewbankkit ewbankkit deleted the issue-7004.aws_api_gateway_v2_deployment branch April 16, 2020 10:33
@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.

5 participants