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

data.aws_organizations_organization doesn't pull all accounts when used from child account #20899

Closed
rnikoopour opened this issue Sep 14, 2021 · 3 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/organizations Issues and PRs that pertain to the organizations service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.

Comments

@rnikoopour
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • 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
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform CLI and Terraform AWS Provider Version

Terraform v0.15.3
on darwin_amd64

  • provider registry.terraform.io/hashicorp/aws v3.58.0

Affected Resource(s)

  • data.aws_organizations_organization

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

terraform {}
provider "aws" {region = "us-west-2"}
data "aws_organizations_organization" "org" {}

output "org" {
  value = data.aws_organizations_organization.org
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

When using a child account to run the terraform I expect to see all my organizations accounts in data.aws_orgnizations_organization.org.accounts just like I do when I call aws organizations list-accounts.

Actual Behavior

data.aws_orgnizations_organization.org.accounts is null

Steps to Reproduce

  1. Log into child account cia the CLI
  2. terraform apply the above hcl

Important Factoids

Adding to the account fields in blocked by requiring the terraform to be running as the root account:

if aws.StringValue(org.Organization.MasterAccountId) == meta.(*AWSClient).accountid {

References

N/A

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/organizations Issues and PRs that pertain to the organizations service. labels Sep 14, 2021
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 14, 2021
@cob16
Copy link
Contributor

cob16 commented Sep 20, 2021

This looks to be a duplicate of #18590

@github-actions
Copy link

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

@github-actions github-actions bot added the stale Old or inactive issues managed by automation, if no further action taken these will get closed. label Sep 10, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2023
Copy link

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 have found a problem that seems similar to this, 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 Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/organizations Issues and PRs that pertain to the organizations service. stale Old or inactive issues managed by automation, if no further action taken these will get closed.
Projects
None yet
Development

No branches or pull requests

3 participants