Skip to content

r/aws_controltower_control: handle removal of parameters block #42494

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

Merged
merged 3 commits into from
May 6, 2025

Conversation

jar-b
Copy link
Member

@jar-b jar-b commented May 6, 2025

Description

Previously, removal of a configured parameters block would result in an error due to the update request body being serialized with a nil Parameters argument rather than an empty array. This change now returns an empty slice from the parameters expander when no value is configured.

Relations

Closes #42485

Output from Acceptance Testing

% TF_AWS_CONTROLTOWER_CONTROL_OU_NAME=<redacted> make testacc PKG=controltower TESTS=TestAccControlTower_serial/Control/
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.8 test ./internal/service/controltower/... -v -count 1 -parallel 20 -run='TestAccControlTower_serial/Control/'  -timeout 360m -vet=off
2025/05/05 16:50:01 Initializing Terraform AWS Provider...
=== RUN   TestAccControlTower_serial
=== PAUSE TestAccControlTower_serial
=== CONT  TestAccControlTower_serial
=== RUN   TestAccControlTower_serial/Control
=== RUN   TestAccControlTower_serial/Control/basic
=== RUN   TestAccControlTower_serial/Control/disappears
=== RUN   TestAccControlTower_serial/Control/parameters
--- PASS: TestAccControlTower_serial (349.28s)
    --- PASS: TestAccControlTower_serial/Control (349.28s)
        --- PASS: TestAccControlTower_serial/Control/basic (85.56s)
        --- PASS: TestAccControlTower_serial/Control/disappears (86.00s)
        --- PASS: TestAccControlTower_serial/Control/parameters (177.72s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/controltower       354.847s

jar-b added 2 commits May 6, 2025 09:07
Previously, removal of a configured `parameters` block would result in an error due to the update request body being serialized with a nil `Parameters` argument rather than an empty array. This change now returns an empty slice from the `parameters` expander when no value is configured.
…ng delete

Previously the delete operation did not gracefully handle `ResourceNotFound` exceptions returned by the `DisableControl` API. Now these errors will be handled by the provider, allowing the apply operation to proceed without error.
Copy link

github-actions bot commented May 6, 2025

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link

github-actions bot commented May 6, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@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/controltower Issues and PRs that pertain to the controltower service. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. size/L Managed by automation to categorize the size of a PR. and removed prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. labels May 6, 2025
…rameters` test

```console
% TF_AWS_CONTROLTOWER_CONTROL_OU_NAME=<redacted> make testacc PKG=controltower TESTS=TestAccControlTower_serial/Control/
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.8 test ./internal/service/controltower/... -v -count 1 -parallel 20 -run='TestAccControlTower_serial/Control/'  -timeout 360m -vet=off
2025/05/05 16:50:01 Initializing Terraform AWS Provider...
=== RUN   TestAccControlTower_serial
=== PAUSE TestAccControlTower_serial
=== CONT  TestAccControlTower_serial
=== RUN   TestAccControlTower_serial/Control
=== RUN   TestAccControlTower_serial/Control/basic
=== RUN   TestAccControlTower_serial/Control/disappears
=== RUN   TestAccControlTower_serial/Control/parameters
--- PASS: TestAccControlTower_serial (349.28s)
    --- PASS: TestAccControlTower_serial/Control (349.28s)
        --- PASS: TestAccControlTower_serial/Control/basic (85.56s)
        --- PASS: TestAccControlTower_serial/Control/disappears (86.00s)
        --- PASS: TestAccControlTower_serial/Control/parameters (177.72s)
PASS
ok      github.com/hashicorp/terraform-provider-aws/internal/service/controltower       354.847s
```
@jar-b jar-b force-pushed the b-controltower_control-parameter-removal branch from 0a2125f to 3c63649 Compare May 6, 2025 13:42
@jar-b jar-b marked this pull request as ready for review May 6, 2025 14:22
@jar-b jar-b requested a review from a team as a code owner May 6, 2025 14:22
@jar-b jar-b added the bug Addresses a defect in current functionality. label May 6, 2025
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 🚀.

% TF_AWS_CONTROLTOWER_CONTROL_OU_NAME=... make testacc PKG=controltower TESTS=TestAccControlTower_serial/Control/
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.23.8 test ./internal/service/controltower/... -v -count 1 -parallel 20 -run='TestAccControlTower_serial/Control/'  -timeout 360m -vet=off
2025/05/06 11:14:44 Initializing Terraform AWS Provider...
=== RUN   TestAccControlTower_serial
=== PAUSE TestAccControlTower_serial
=== CONT  TestAccControlTower_serial
=== RUN   TestAccControlTower_serial/Control
=== RUN   TestAccControlTower_serial/Control/basic
=== RUN   TestAccControlTower_serial/Control/disappears
=== RUN   TestAccControlTower_serial/Control/parameters
--- PASS: TestAccControlTower_serial (348.57s)
    --- PASS: TestAccControlTower_serial/Control (348.57s)
        --- PASS: TestAccControlTower_serial/Control/basic (85.36s)
        --- PASS: TestAccControlTower_serial/Control/disappears (85.54s)
        --- PASS: TestAccControlTower_serial/Control/parameters (177.68s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/controltower	353.562s

@jar-b jar-b merged commit 6c4e066 into main May 6, 2025
46 checks passed
@jar-b jar-b deleted the b-controltower_control-parameter-removal branch May 6, 2025 15:24
Copy link

github-actions bot commented May 6, 2025

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

@github-actions github-actions bot added this to the v5.98.0 milestone May 6, 2025
terraform-aws-provider bot pushed a commit that referenced this pull request May 6, 2025
Copy link

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

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 Jun 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. documentation Introduces or discusses updates to documentation. service/controltower Issues and PRs that pertain to the controltower service. size/L 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.

r/aws_controltower_control: Unable to remove parameters
2 participants