Terraform-provider-aws: New Data Resource for AWS Organization

Created on 13 Dec 2018  ·  6Comments  ·  Source: hashicorp/terraform-provider-aws

Would be nice to have a data resource to list all accounts under the organization

https://docs.aws.amazon.com/cli/latest/reference/organizations/list-accounts.html

new-data-source servicorganizations

Most helpful comment

Support for a new aws_organizations_organization data source has been merged and will release with version 2.21.0 of the Terraform AWS Provider, in about a week. 🎉

This new data source has a few modes of operation:

  • If used in an account that is not part of an Organization, it will return an error
  • If used within an Organization but outside the master account, it will return the Organization ID, ARN, and master account ID information
  • In used within the Organization master account, it will return all the arguments and attributes available in the aws_organizations_organization resource including all member account information such as account ARNs and account IDs

We want to thank everyone for being patient through this whole process while we evaluated use cases and special thanks to @alucillo, @brandonstevens, @breser, @nirhaas, and @scottwinkler for their various contributions with this functionality!

All 6 comments

In addition to tracking just support for fetching all Organization account IDs, this issue will be used for tracking adding the aws_organizations_organization data source in general as part of closing #571 shortly. 👍 There is a high probability that both will be implemented under the same data source.

Would love to see aws_organizations_organization data source, since being able to to extract Organization ID from any child account, allows to leverage the global policy condition key aws:PrincipalOrgID in various resource (e.g. S3) and IAM Role trust policies.

Support for a new aws_organizations_organization data source has been merged and will release with version 2.21.0 of the Terraform AWS Provider, in about a week. 🎉

This new data source has a few modes of operation:

  • If used in an account that is not part of an Organization, it will return an error
  • If used within an Organization but outside the master account, it will return the Organization ID, ARN, and master account ID information
  • In used within the Organization master account, it will return all the arguments and attributes available in the aws_organizations_organization resource including all member account information such as account ARNs and account IDs

We want to thank everyone for being patient through this whole process while we evaluated use cases and special thanks to @alucillo, @brandonstevens, @breser, @nirhaas, and @scottwinkler for their various contributions with this functionality!

This has been released in version 2.21.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, documentation updates, or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

Was this page helpful?
0 / 5 - 0 ratings