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

Added import support for API Gateway Deployment #28030

Merged

Conversation

bluenick2k17
Copy link
Contributor

@bluenick2k17 bluenick2k17 commented Nov 27, 2022

Description

Enables the ability to import aws_api_gateway_deployment.

Currently as implemented, aws_api_gateway_deployment will not attempt to import stage_name, stage_description, or variables due to the recommended approach of importing aws_api_gateway_stage and to prevent issues importing multiple stages tied to the same deployment.

Relations

Closes #558

(aws_api_gateway_deployment is the last API Gateway resource that is not importable)

References

Output from Acceptance Testing

$ ~/git/hashicorp/terraform-provider-aws (f-aws_api_gateway_deployment-import ✔) ᐅ make testacc TESTS=TestAccAPIGatewayDeployment_ PKG=apigateway 
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 20 -run='TestAccAPIGatewayDeployment_'  -timeout 180m
--- PASS: TestAccAPIGatewayDeployment_Disappears_restAPI (23.73s)
--- PASS: TestAccAPIGatewayDeployment_description (53.36s)
--- PASS: TestAccAPIGatewayDeployment_variables (77.70s)
--- PASS: TestAccAPIGatewayDeployment_triggers (92.82s)
--- PASS: TestAccAPIGatewayDeployment_stageDescription (131.49s)
--- PASS: TestAccAPIGatewayDeployment_StageName_emptyString (182.83s)
--- PASS: TestAccAPIGatewayDeployment_stageName (215.13s)
--- PASS: TestAccAPIGatewayDeployment_basic (351.62s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/apigateway 351.693s

Acceptance Test Modifications

  • Removed stage_name and stage_description from the _basic test, since the stage_* variables are optional and shouldn't be a part of a basic test.
  • Moved validation of execution_arn and invoke_url using the stage to the _stageName test, since stage_name was removed from the _basic test. The _basic test still validates the two properties without the stage present.
  • Added import validation to the _basic test

@github-actions
Copy link

Hey @bluenick2k17 👋 Thank you very much for your contribution! At times, our maintainers need to make direct edits to pull requests in order to help get it ready to be merged. Your current settings do not allow maintainers to make such edits. To help facilitate this, update your pull request to allow such edits as described in GitHub's Allowing changes to a pull request branch created from a fork documentation. (If you're using a fork owned by an organization, your organization may not allow you to change this setting. If that is the case, let us know.)

@github-actions
Copy link

Community Note

Voting for Prioritization

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

For Submitters

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

@github-actions github-actions bot added documentation Introduces or discusses updates to documentation. service/apigateway Issues and PRs that pertain to the apigateway service. size/S Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. labels Nov 27, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome @bluenick2k17 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTOR guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

bluenick2k17 and others added 3 commits November 27, 2022 15:30
moved stage url validation to stage specific config
and removed stage name/desc from basic test
@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. size/M Managed by automation to categorize the size of a PR. and removed size/S Managed by automation to categorize the size of a PR. labels Nov 28, 2022
@bluenick2k17
Copy link
Contributor Author

Hey @bluenick2k17 👋 Thank you very much for your contribution! At times, our maintainers need to make direct edits to pull requests in order to help get it ready to be merged. Your current settings do not allow maintainers to make such edits. To help facilitate this, update your pull request to allow such edits as described in GitHub's Allowing changes to a pull request branch created from a fork documentation. (If you're using a fork owned by an organization, your organization may not allow you to change this setting. If that is the case, let us know.)

I'm in a GitHub organization which doesn't currently allow me to change this setting. I'll do what I can to stay on top of suggestions/feedback, and keeping the branch current. Thanks!

@bluenick2k17 bluenick2k17 marked this pull request as ready for review November 28, 2022 21:10
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Nov 30, 2022
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

% make testacc TESTARGS='-run=TestAccAPIGatewayDeployment_' PKG=apigateway ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/apigateway/... -v -count 1 -parallel 2  -run=TestAccAPIGatewayDeployment_ -timeout 180m
=== RUN   TestAccAPIGatewayDeployment_basic
=== PAUSE TestAccAPIGatewayDeployment_basic
=== RUN   TestAccAPIGatewayDeployment_Disappears_restAPI
=== PAUSE TestAccAPIGatewayDeployment_Disappears_restAPI
=== RUN   TestAccAPIGatewayDeployment_triggers
=== PAUSE TestAccAPIGatewayDeployment_triggers
=== RUN   TestAccAPIGatewayDeployment_description
=== PAUSE TestAccAPIGatewayDeployment_description
=== RUN   TestAccAPIGatewayDeployment_stageDescription
=== PAUSE TestAccAPIGatewayDeployment_stageDescription
=== RUN   TestAccAPIGatewayDeployment_stageName
=== PAUSE TestAccAPIGatewayDeployment_stageName
=== RUN   TestAccAPIGatewayDeployment_StageName_emptyString
=== PAUSE TestAccAPIGatewayDeployment_StageName_emptyString
=== RUN   TestAccAPIGatewayDeployment_variables
=== PAUSE TestAccAPIGatewayDeployment_variables
=== CONT  TestAccAPIGatewayDeployment_basic
=== CONT  TestAccAPIGatewayDeployment_stageDescription
--- PASS: TestAccAPIGatewayDeployment_basic (20.70s)
=== CONT  TestAccAPIGatewayDeployment_StageName_emptyString
--- PASS: TestAccAPIGatewayDeployment_stageDescription (20.82s)
=== CONT  TestAccAPIGatewayDeployment_variables
--- PASS: TestAccAPIGatewayDeployment_StageName_emptyString (68.45s)
=== CONT  TestAccAPIGatewayDeployment_triggers
--- PASS: TestAccAPIGatewayDeployment_variables (109.29s)
=== CONT  TestAccAPIGatewayDeployment_description
--- PASS: TestAccAPIGatewayDeployment_triggers (63.88s)
=== CONT  TestAccAPIGatewayDeployment_Disappears_restAPI
--- PASS: TestAccAPIGatewayDeployment_description (89.83s)
=== CONT  TestAccAPIGatewayDeployment_stageName
--- PASS: TestAccAPIGatewayDeployment_Disappears_restAPI (75.52s)
--- PASS: TestAccAPIGatewayDeployment_stageName (33.56s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/apigateway	258.159s

@ewbankkit
Copy link
Contributor

@bluenick2k17 Thanks for the contribution 🎉 👏.
I can fix any linter errors after merge.

@ewbankkit ewbankkit merged commit ab9fa23 into hashicorp:main Nov 30, 2022
@github-actions github-actions bot added this to the v4.44.0 milestone Nov 30, 2022
@bluenick2k17 bluenick2k17 deleted the f-aws_api_gateway_deployment-import branch November 30, 2022 17:36
@github-actions
Copy link

This functionality has been released in v4.44.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. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2022
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. service/apigateway Issues and PRs that pertain to the apigateway service. size/M 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.

provider/aws: Add import support for API Gateway resources
2 participants