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

resource/aws_api_gateway_account: Properly support unregistration #40004

Merged
merged 13 commits into from
Nov 7, 2024

Conversation

gdavison
Copy link
Contributor

@gdavison gdavison commented Nov 4, 2024

Description

An aws_api_gateway_account can be unregistered by clearing the cloudwatch_role_arn. Do that and add sweeper.

Output from Acceptance Testing

% make testacc PKG=apigateway TESTS='TestAccAPIGateway_serial/Account'

--- PASS: TestAccAPIGateway_serial (178.47s)
    --- PASS: TestAccAPIGateway_serial/Account (178.47s)
        --- PASS: TestAccAPIGateway_serial/Account/basic (178.47s)

@gdavison gdavison requested a review from a team as a code owner November 4, 2024 18:35
Copy link

github-actions bot commented Nov 4, 2024

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. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/apigateway Issues and PRs that pertain to the apigateway service. sweeper Pertains to changes to or issues with the sweeper. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels Nov 4, 2024
Copy link
Member

@jar-b jar-b left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Just one potential suggestion on retaining the no-op destroy behavior as an opt-in feature.

@gdavison gdavison requested a review from jar-b November 7, 2024 00:48
Copy link
Member

@jar-b jar-b 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 PKG=apigateway TESTS=TestAccAPIGateway_serial/Account/
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.2 test ./internal/service/apigateway/... -v -count 1 -parallel 20 -run='TestAccAPIGateway_serial/Account/'  -timeout 360m
2024/11/07 10:01:35 Initializing Terraform AWS Provider...
=== RUN   TestAccAPIGateway_serial
=== RUN   TestAccAPIGateway_serial/Account
=== RUN   TestAccAPIGateway_serial/Account/ResetOnDelete_true
=== RUN   TestAccAPIGateway_serial/Account/basic
=== RUN   TestAccAPIGateway_serial/Account/CloudwatchRoleARN_Value
=== RUN   TestAccAPIGateway_serial/Account/CloudwatchRoleARN_Empty
=== RUN   TestAccAPIGateway_serial/Account/FrameworkMigration_Basic
=== RUN   TestAccAPIGateway_serial/Account/FrameworkMigration_CloudwatchRoleARN
=== RUN   TestAccAPIGateway_serial/Account/ResetOnDelete_false
--- PASS: TestAccAPIGateway_serial (389.36s)
    --- PASS: TestAccAPIGateway_serial/Account (389.36s)
        --- PASS: TestAccAPIGateway_serial/Account/ResetOnDelete_true (74.08s)
        --- PASS: TestAccAPIGateway_serial/Account/basic (34.53s)
        --- PASS: TestAccAPIGateway_serial/Account/CloudwatchRoleARN_Value (81.50s)
        --- PASS: TestAccAPIGateway_serial/Account/CloudwatchRoleARN_Empty (45.07s)
        --- PASS: TestAccAPIGateway_serial/Account/FrameworkMigration_Basic (45.45s)
        --- PASS: TestAccAPIGateway_serial/Account/FrameworkMigration_CloudwatchRoleARN (64.17s)
        --- PASS: TestAccAPIGateway_serial/Account/ResetOnDelete_false (44.54s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/apigateway 394.414s

internal/service/apigateway/account.go Outdated Show resolved Hide resolved
internal/service/apigateway/account.go Outdated Show resolved Hide resolved
internal/service/apigateway/account.go Outdated Show resolved Hide resolved
internal/service/apigateway/account.go Show resolved Hide resolved
website/docs/r/api_gateway_account.html.markdown Outdated Show resolved Hide resolved
website/docs/r/api_gateway_account.html.markdown Outdated Show resolved Hide resolved
@gdavison gdavison merged commit 8ef65cc into main Nov 7, 2024
42 checks passed
@gdavison gdavison deleted the td-apigateway-delete-account branch November 7, 2024 22:45
@github-actions github-actions bot added this to the v5.76.0 milestone Nov 7, 2024
terraform-aws-provider bot pushed a commit that referenced this pull request Nov 7, 2024
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Nov 11, 2024
Copy link

This functionality has been released in v5.75.1 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. service/apigateway Issues and PRs that pertain to the apigateway service. sweeper Pertains to changes to or issues with the sweeper. 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.

2 participants