Skip to content

Tech debt: Use AutoFlEx for auditmanager #42741

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 13 commits into from
Jun 3, 2025

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented May 23, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

The auditmanager service was one of the first to use terraform-plugin-framework, before the introduction of AutoFlEx.
This PR refactors to use AutoFlEx.

Relates #38907.

Output from Acceptance Testing

% AWS_DEFAULT_REGION=us-east-2 make testacc TESTARGS='-run=TestAccAuditManager' PKG=auditmanager ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.3 test ./internal/service/auditmanager/... -v -count 1 -parallel 3  -run=TestAccAuditManager -timeout 360m -vet=off
2025/05/23 08:44:59 Creating Terraform AWS Provider (SDKv2-style)...
2025/05/23 08:44:59 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAuditManagerAccountRegistration_serial
=== PAUSE TestAccAuditManagerAccountRegistration_serial
=== RUN   TestAccAuditManagerAssessmentDelegation_basic
=== PAUSE TestAccAuditManagerAssessmentDelegation_basic
=== RUN   TestAccAuditManagerAssessmentDelegation_disappears
=== PAUSE TestAccAuditManagerAssessmentDelegation_disappears
=== RUN   TestAccAuditManagerAssessmentDelegation_optional
=== PAUSE TestAccAuditManagerAssessmentDelegation_optional
=== RUN   TestAccAuditManagerAssessmentDelegation_multiple
=== PAUSE TestAccAuditManagerAssessmentDelegation_multiple
=== RUN   TestAccAuditManagerAssessmentReport_basic
=== PAUSE TestAccAuditManagerAssessmentReport_basic
=== RUN   TestAccAuditManagerAssessmentReport_disappears
=== PAUSE TestAccAuditManagerAssessmentReport_disappears
=== RUN   TestAccAuditManagerAssessmentReport_optional
=== PAUSE TestAccAuditManagerAssessmentReport_optional
=== RUN   TestAccAuditManagerAssessment_basic
=== PAUSE TestAccAuditManagerAssessment_basic
=== RUN   TestAccAuditManagerAssessment_disappears
=== PAUSE TestAccAuditManagerAssessment_disappears
=== RUN   TestAccAuditManagerAssessment_tags
=== PAUSE TestAccAuditManagerAssessment_tags
=== RUN   TestAccAuditManagerAssessment_optional
=== PAUSE TestAccAuditManagerAssessment_optional
=== RUN   TestAccAuditManagerControlDataSource_standard
=== PAUSE TestAccAuditManagerControlDataSource_standard
=== RUN   TestAccAuditManagerControlDataSource_custom
=== PAUSE TestAccAuditManagerControlDataSource_custom
=== RUN   TestAccAuditManagerControl_basic
=== PAUSE TestAccAuditManagerControl_basic
=== RUN   TestAccAuditManagerControl_disappears
=== PAUSE TestAccAuditManagerControl_disappears
=== RUN   TestAccAuditManagerControl_tags
=== PAUSE TestAccAuditManagerControl_tags
=== RUN   TestAccAuditManagerControl_optional
=== PAUSE TestAccAuditManagerControl_optional
=== RUN   TestAccAuditManagerControl_optionalSources
=== PAUSE TestAccAuditManagerControl_optionalSources
=== RUN   TestAccAuditManagerFrameworkDataSource_standard
=== PAUSE TestAccAuditManagerFrameworkDataSource_standard
=== RUN   TestAccAuditManagerFrameworkDataSource_custom
=== PAUSE TestAccAuditManagerFrameworkDataSource_custom
=== RUN   TestAccAuditManagerFrameworkShare_basic
=== PAUSE TestAccAuditManagerFrameworkShare_basic
=== RUN   TestAccAuditManagerFrameworkShare_disappears
=== PAUSE TestAccAuditManagerFrameworkShare_disappears
=== RUN   TestAccAuditManagerFrameworkShare_optional
=== PAUSE TestAccAuditManagerFrameworkShare_optional
=== RUN   TestAccAuditManagerFramework_basic
=== PAUSE TestAccAuditManagerFramework_basic
=== RUN   TestAccAuditManagerFramework_disappears
=== PAUSE TestAccAuditManagerFramework_disappears
=== RUN   TestAccAuditManagerFramework_tags
=== PAUSE TestAccAuditManagerFramework_tags
=== RUN   TestAccAuditManagerFramework_optional
=== PAUSE TestAccAuditManagerFramework_optional
=== RUN   TestAccAuditManagerOrganizationAdminAccountRegistration_serial
=== PAUSE TestAccAuditManagerOrganizationAdminAccountRegistration_serial
=== CONT  TestAccAuditManagerAccountRegistration_serial
=== CONT  TestAccAuditManagerControl_disappears
=== RUN   TestAccAuditManagerAccountRegistration_serial/basic
=== CONT  TestAccAuditManagerControl_basic
--- PASS: TestAccAuditManagerControl_disappears (10.51s)
=== CONT  TestAccAuditManagerControlDataSource_custom
=== RUN   TestAccAuditManagerAccountRegistration_serial/disappears
    account_registration_test.go:60: Environment variable AUDITMANAGER_DEREGISTER_ACCOUNT_ON_DESTROY is not set, skipping test
=== RUN   TestAccAuditManagerAccountRegistration_serial/kms_key
--- PASS: TestAccAuditManagerControl_basic (11.73s)
=== CONT  TestAccAuditManagerControlDataSource_standard
--- PASS: TestAccAuditManagerControlDataSource_custom (8.95s)
=== CONT  TestAccAuditManagerAssessment_optional
--- PASS: TestAccAuditManagerControlDataSource_standard (26.28s)
=== CONT  TestAccAuditManagerAssessmentReport_basic
--- PASS: TestAccAuditManagerAccountRegistration_serial (42.60s)
    --- PASS: TestAccAuditManagerAccountRegistration_serial/basic (11.28s)
    --- SKIP: TestAccAuditManagerAccountRegistration_serial/disappears (0.00s)
    --- PASS: TestAccAuditManagerAccountRegistration_serial/kms_key (31.32s)
=== CONT  TestAccAuditManagerAssessmentDelegation_multiple
--- PASS: TestAccAuditManagerAssessment_optional (32.64s)
=== CONT  TestAccAuditManagerAssessmentDelegation_optional
--- PASS: TestAccAuditManagerAssessmentReport_basic (22.61s)
=== CONT  TestAccAuditManagerAssessmentDelegation_disappears
--- PASS: TestAccAuditManagerAssessmentDelegation_multiple (20.46s)
=== CONT  TestAccAuditManagerAssessmentDelegation_basic
--- PASS: TestAccAuditManagerAssessmentDelegation_disappears (20.70s)
=== CONT  TestAccAuditManagerFrameworkShare_disappears
--- PASS: TestAccAuditManagerAssessmentDelegation_basic (21.95s)
=== CONT  TestAccAuditManagerOrganizationAdminAccountRegistration_serial
=== RUN   TestAccAuditManagerOrganizationAdminAccountRegistration_serial/basic
    organization_admin_account_registration_test.go:33: Environment variable AUDITMANAGER_ORGANIZATION_ADMIN_ACCOUNT_ID is not set, skipping test
=== RUN   TestAccAuditManagerOrganizationAdminAccountRegistration_serial/disappears
    organization_admin_account_registration_test.go:62: Environment variable AUDITMANAGER_ORGANIZATION_ADMIN_ACCOUNT_ID is not set, skipping test
--- PASS: TestAccAuditManagerOrganizationAdminAccountRegistration_serial (0.00s)
    --- SKIP: TestAccAuditManagerOrganizationAdminAccountRegistration_serial/basic (0.00s)
    --- SKIP: TestAccAuditManagerOrganizationAdminAccountRegistration_serial/disappears (0.00s)
=== CONT  TestAccAuditManagerFramework_optional
--- PASS: TestAccAuditManagerAssessmentDelegation_optional (38.75s)
=== CONT  TestAccAuditManagerFramework_tags
--- PASS: TestAccAuditManagerFrameworkShare_disappears (20.21s)
=== CONT  TestAccAuditManagerFramework_disappears
--- PASS: TestAccAuditManagerFramework_optional (17.77s)
=== CONT  TestAccAuditManagerFramework_basic
--- PASS: TestAccAuditManagerFramework_disappears (9.60s)
=== CONT  TestAccAuditManagerFrameworkShare_optional
--- PASS: TestAccAuditManagerFramework_basic (11.37s)
=== CONT  TestAccAuditManagerFrameworkDataSource_standard
--- PASS: TestAccAuditManagerFramework_tags (24.51s)
=== CONT  TestAccAuditManagerAssessmentReport_disappears
--- PASS: TestAccAuditManagerFrameworkDataSource_standard (7.84s)
=== CONT  TestAccAuditManagerFrameworkShare_basic
--- PASS: TestAccAuditManagerFrameworkShare_basic (11.97s)
=== CONT  TestAccAuditManagerAssessment_tags
--- PASS: TestAccAuditManagerFrameworkShare_optional (25.51s)
=== CONT  TestAccAuditManagerFrameworkDataSource_custom
--- PASS: TestAccAuditManagerAssessmentReport_disappears (21.80s)
=== CONT  TestAccAuditManagerAssessment_disappears
--- PASS: TestAccAuditManagerFrameworkDataSource_custom (9.51s)
=== CONT  TestAccAuditManagerAssessment_basic
--- PASS: TestAccAuditManagerAssessment_disappears (15.93s)
=== CONT  TestAccAuditManagerAssessmentReport_optional
--- PASS: TestAccAuditManagerAssessment_tags (33.99s)
=== CONT  TestAccAuditManagerControl_optional
--- PASS: TestAccAuditManagerAssessment_basic (21.87s)
=== CONT  TestAccAuditManagerControl_optionalSources
--- PASS: TestAccAuditManagerControl_optionalSources (17.53s)
=== CONT  TestAccAuditManagerControl_tags
--- PASS: TestAccAuditManagerControl_optional (17.62s)
--- PASS: TestAccAuditManagerAssessmentReport_optional (39.48s)
--- PASS: TestAccAuditManagerControl_tags (23.85s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager	214.029s

ewbankkit added 11 commits May 16, 2025 14:59
% AUDITMANAGER_DEREGISTER_ACCOUNT_ON_DESTROY=1 make testacc TESTARGS='-run=TestAccAuditManagerAccountRegistration_serial' PKG=auditmanager
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.2 test ./internal/service/auditmanager/... -v -count 1 -parallel 20  -run=TestAccAuditManagerAccountRegistration_serial -timeout 360m -vet=off
2025/05/16 14:56:38 Creating Terraform AWS Provider (SDKv2-style)...
2025/05/16 14:56:38 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAuditManagerAccountRegistration_serial
=== PAUSE TestAccAuditManagerAccountRegistration_serial
=== CONT  TestAccAuditManagerAccountRegistration_serial
=== RUN   TestAccAuditManagerAccountRegistration_serial/basic
=== RUN   TestAccAuditManagerAccountRegistration_serial/disappears
=== RUN   TestAccAuditManagerAccountRegistration_serial/kms_key
--- PASS: TestAccAuditManagerAccountRegistration_serial (66.31s)
    --- PASS: TestAccAuditManagerAccountRegistration_serial/basic (13.23s)
    --- PASS: TestAccAuditManagerAccountRegistration_serial/disappears (14.47s)
    --- PASS: TestAccAuditManagerAccountRegistration_serial/kms_key (38.61s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager	71.050s
% AWS_DEFAULT_REGION=us-east-2 make testacc TESTARGS='-run=TestAccAuditManagerAssessmentDelegation_' PKG=auditmanager ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.2 test ./internal/service/auditmanager/... -v -count 1 -parallel 3  -run=TestAccAuditManagerAssessmentDelegation_ -timeout 360m -vet=off
2025/05/19 09:23:53 Creating Terraform AWS Provider (SDKv2-style)...
2025/05/19 09:23:53 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAuditManagerAssessmentDelegation_basic
=== PAUSE TestAccAuditManagerAssessmentDelegation_basic
=== RUN   TestAccAuditManagerAssessmentDelegation_disappears
=== PAUSE TestAccAuditManagerAssessmentDelegation_disappears
=== RUN   TestAccAuditManagerAssessmentDelegation_optional
=== PAUSE TestAccAuditManagerAssessmentDelegation_optional
=== RUN   TestAccAuditManagerAssessmentDelegation_multiple
=== PAUSE TestAccAuditManagerAssessmentDelegation_multiple
=== CONT  TestAccAuditManagerAssessmentDelegation_basic
=== CONT  TestAccAuditManagerAssessmentDelegation_optional
=== CONT  TestAccAuditManagerAssessmentDelegation_multiple
--- PASS: TestAccAuditManagerAssessmentDelegation_multiple (21.38s)
=== CONT  TestAccAuditManagerAssessmentDelegation_disappears
--- PASS: TestAccAuditManagerAssessmentDelegation_basic (23.25s)
--- PASS: TestAccAuditManagerAssessmentDelegation_optional (39.85s)
--- PASS: TestAccAuditManagerAssessmentDelegation_disappears (20.78s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager	46.854s
% AWS_DEFAULT_REGION=us-east-2 make testacc TESTARGS='-run=TestAccAuditManagerAssessmentReport_' PKG=auditmanager ACCTEST_PARALLELISM=3
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.2 test ./internal/service/auditmanager/... -v -count 1 -parallel 3  -run=TestAccAuditManagerAssessmentReport_ -timeout 360m -vet=off
2025/05/19 09:47:11 Creating Terraform AWS Provider (SDKv2-style)...
2025/05/19 09:47:11 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAuditManagerAssessmentReport_basic
=== PAUSE TestAccAuditManagerAssessmentReport_basic
=== RUN   TestAccAuditManagerAssessmentReport_disappears
=== PAUSE TestAccAuditManagerAssessmentReport_disappears
=== RUN   TestAccAuditManagerAssessmentReport_optional
=== PAUSE TestAccAuditManagerAssessmentReport_optional
=== CONT  TestAccAuditManagerAssessmentReport_basic
=== CONT  TestAccAuditManagerAssessmentReport_optional
=== CONT  TestAccAuditManagerAssessmentReport_disappears
--- PASS: TestAccAuditManagerAssessmentReport_basic (23.65s)
--- PASS: TestAccAuditManagerAssessmentReport_disappears (23.85s)
--- PASS: TestAccAuditManagerAssessmentReport_optional (40.81s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager	45.498s
% AWS_DEFAULT_REGION=us-east-2 make testacc TESTARGS='-run=TestAccAuditManagerFrameworkShare_' PKG=auditmanager ACCTEST_PARALLELISM=2
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.2 test ./internal/service/auditmanager/... -v -count 1 -parallel 2  -run=TestAccAuditManagerFrameworkShare_ -timeout 360m -vet=off
2025/05/19 10:38:56 Creating Terraform AWS Provider (SDKv2-style)...
2025/05/19 10:38:56 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAuditManagerFrameworkShare_basic
=== PAUSE TestAccAuditManagerFrameworkShare_basic
=== RUN   TestAccAuditManagerFrameworkShare_disappears
=== PAUSE TestAccAuditManagerFrameworkShare_disappears
=== RUN   TestAccAuditManagerFrameworkShare_optional
=== PAUSE TestAccAuditManagerFrameworkShare_optional
=== CONT  TestAccAuditManagerFrameworkShare_basic
=== CONT  TestAccAuditManagerFrameworkShare_optional
--- PASS: TestAccAuditManagerFrameworkShare_basic (12.78s)
=== CONT  TestAccAuditManagerFrameworkShare_disappears
--- PASS: TestAccAuditManagerFrameworkShare_optional (27.46s)
--- PASS: TestAccAuditManagerFrameworkShare_disappears (20.26s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager	37.860s
% AUDITMANAGER_ORGANIZATION_ADMIN_ACCOUNT_ID=... AWS_DEFAULT_REGION=us-east-2 make testacc TESTARGS='-run=TestAccAuditManagerOrganizationAdminAccountRegistration_serial' PKG=auditmanager
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.2 test ./internal/service/auditmanager/... -v -count 1 -parallel 20  -run=TestAccAuditManagerOrganizationAdminAccountRegistration_serial -timeout 360m -vet=off
2025/05/19 11:20:59 Creating Terraform AWS Provider (SDKv2-style)...
2025/05/19 11:20:59 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAuditManagerOrganizationAdminAccountRegistration_serial
=== PAUSE TestAccAuditManagerOrganizationAdminAccountRegistration_serial
=== CONT  TestAccAuditManagerOrganizationAdminAccountRegistration_serial
=== RUN   TestAccAuditManagerOrganizationAdminAccountRegistration_serial/basic
=== RUN   TestAccAuditManagerOrganizationAdminAccountRegistration_serial/disappears
--- PASS: TestAccAuditManagerOrganizationAdminAccountRegistration_serial (25.46s)
    --- PASS: TestAccAuditManagerOrganizationAdminAccountRegistration_serial/basic (13.67s)
    --- PASS: TestAccAuditManagerOrganizationAdminAccountRegistration_serial/disappears (11.78s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/auditmanager	30.303s
@ewbankkit ewbankkit requested a review from a team as a code owner May 23, 2025 12:36
Copy link

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.

@github-actions github-actions bot added tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/iam Issues and PRs that pertain to the iam service. service/auditmanager Issues and PRs that pertain to the auditmanager 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. size/XL Managed by automation to categorize the size of a PR. labels May 23, 2025
# Conflicts:
#	internal/service/auditmanager/account_registration.go
#	internal/service/auditmanager/account_registration_test.go
Copy link
Contributor

@johnsonaj johnsonaj left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@ewbankkit ewbankkit merged commit 02cf43b into release/6.0.0-beta Jun 3, 2025
38 checks passed
@ewbankkit ewbankkit deleted the td-auditmanager-use-autoflex branch June 3, 2025 13:05
Copy link

github-actions bot commented Jun 3, 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.

terraform-aws-provider bot pushed a commit that referenced this pull request Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. service/auditmanager Issues and PRs that pertain to the auditmanager service. service/iam Issues and PRs that pertain to the iam service. size/XL Managed by automation to categorize the size of a PR. 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