Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alexwilcox9
Copy link
Contributor

@alexwilcox9 alexwilcox9 commented Dec 10, 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

Adding aws_organizations_account Data Source to allow retrieving of infomation for child accounts created outside of Terraform

Relations

Closes #30656

References

Output from Acceptance Testing

Unfortunately I have hit the limit in my org for account deletions so the test doesn't run cleanly. I have compiled and tried the provider outside of the tests for sanity but I would be grateful if you could run the tests in your environment.

% make testacc TESTS=TestAccAccountDataSource_basic PKG=organizations
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 account_data_source 🌿...
TF_ACC=1 go1.24.11 test ./internal/service/organizations/... -v -count 1 -parallel 20 -run='TestAccAccountDataSource_basic'  -timeout 360m -vet=off
2025/12/11 10:14:53 Creating Terraform AWS Provider (SDKv2-style)...
2025/12/11 10:14:54 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAccountDataSource_basic
    account_data_source_test.go:27: Error running post-test destroy, there may be dangling resources: exit status 1
        
        Error: deleting AWS Organizations Account (000000000000): operation error Organizations: CloseAccount, https response error StatusCode: 400, RequestID: 23bf8b73-4598-48b1-8e20-d35afabc19a5, ConstraintViolationException: You have exceeded close account quota for the past 30 days.
        
--- FAIL: TestAccAccountDataSource_basic (27.66s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/organizations      33.099s
FAIL
make: *** [testacc] Error 1
...

@github-actions
Copy link
Contributor

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 needs-triage Waiting for first response or review from a maintainer. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/organizations Issues and PRs that pertain to the organizations service. generators Relates to code generators. size/L Managed by automation to categorize the size of a PR. labels Dec 10, 2025
@alexwilcox9 alexwilcox9 force-pushed the account_data_source branch 2 times, most recently from 5686227 to 5c7b3af Compare December 10, 2025 23:47
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Dec 10, 2025
@alexwilcox9 alexwilcox9 marked this pull request as ready for review December 11, 2025 07:33
@alexwilcox9 alexwilcox9 requested a review from a team as a code owner December 11, 2025 07:33
@myerscf
Copy link
Contributor

myerscf commented Dec 11, 2025

make testacc TESTS=TestAccAccountDataSource_basic PKG=organizations TEST_AWS_ORGANIZATION_ACCOUNT_EMAIL_DOMAIN=amazon.co.uk
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 account_data_source 🌿...
TF_ACC=1 go1.24.11 test ./internal/service/organizations/... -v -count 1 -parallel 20 -run='TestAccAccountDataSource_basic'  -timeout 360m -vet=off
2025/12/11 14:21:51 Creating Terraform AWS Provider (SDKv2-style)...
2025/12/11 14:21:51 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccAccountDataSource_basic
--- PASS: TestAccAccountDataSource_basic (902.90s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/organizations	910.832s

output from passing test

@YakDriver
Copy link
Member

I think we're in the same boat. We have access to one org and it's all messed up from so many tests run. If only we knew someone at AWS.

@YakDriver YakDriver self-assigned this Dec 11, 2025
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 11, 2025
YakDriver
YakDriver previously approved these changes Dec 11, 2025
Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

==> Checking that code complies with gofmt requirements...
make: Running acceptance tests on branch: 🌿 account_data_source 🌿...
TF_ACC=1 go1.24.11 test ./internal/service/organizations/... -v -count 1 -parallel 20 -run='TestAccOrganizations_serial/Account/DataSource_basic'  -timeout 360m -vet=off
2025/12/11 12:28:48 Creating Terraform AWS Provider (SDKv2-style)...
2025/12/11 12:28:48 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccOrganizations_serial
=== PAUSE TestAccOrganizations_serial
=== CONT  TestAccOrganizations_serial
=== RUN   TestAccOrganizations_serial/Account
=== RUN   TestAccOrganizations_serial/Account/DataSource_basic
--- PASS: TestAccOrganizations_serial (875.97s)
    --- PASS: TestAccOrganizations_serial/Account (875.97s)
        --- PASS: TestAccOrganizations_serial/Account/DataSource_basic (875.97s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/organizations	882.319s

Copy link
Member

@YakDriver YakDriver left a comment

Choose a reason for hiding this comment

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

Still approve... LGTM 🎉

@ewbankkit ewbankkit added new-data-source Introduces a new data source. and removed needs-triage Waiting for first response or review from a maintainer. labels Dec 11, 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 🚀.

@YakDriver YakDriver merged commit b6c16ac into hashicorp:main Dec 11, 2025
51 of 52 checks passed
@github-actions
Copy link
Contributor

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 v6.27.0 milestone Dec 11, 2025
@github-actions github-actions bot removed the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Dec 18, 2025
@github-actions
Copy link
Contributor

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

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. generators Relates to code generators. new-data-source Introduces a new data source. service/organizations Issues and PRs that pertain to the organizations 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.

[New Data Source]: AWS Organizations Account

4 participants