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 source for AWS Organizations account tagging #11511

Closed
pascal-hofmann opened this issue Jan 7, 2020 · 4 comments · Fixed by #22371
Closed

Data source for AWS Organizations account tagging #11511

pascal-hofmann opened this issue Jan 7, 2020 · 4 comments · Fixed by #22371
Labels
new-data-source Introduces a new data source. service/organizations Issues and PRs that pertain to the organizations service.
Milestone

Comments

@pascal-hofmann
Copy link
Contributor

pascal-hofmann commented Jan 7, 2020

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

Description

#8896 added support for AWS Organizations account tagging to aws_organizations_account.
Unfortunately there is no way to get the list of tags for an account via data source.

  • I suggest to introduce a new data source aws_organizations_account that exposes account details including tags.
  • Alternatively there could be a new data source aws_organizations_account_tags.
  • Or maybe even a more generic data source aws_resource_tags.

Related API calls: ListTagsForResource, ListAccounts

New or Affected Resource(s)

  • new data source aws_organizations_account or
  • new data source aws_organizations_account_tags or
  • new data source aws_resource_tags

Potential Terraform Configuration

data "aws_organizations_account" "example" {
  filter {
    name   = "id"
    values = ["987654321234"]
  }
  filter {
    name   = "name"
    values = […]
  }
  …
}
data "aws_organizations_account_tags" "example" {
  id = "987654321234"
}
data "aws_resource_tags" "example" {
  id = "987654321234"
}

References

@pascal-hofmann pascal-hofmann added the enhancement Requests to existing resources that expand the functionality or scope. label Jan 7, 2020
@ghost ghost added the service/organizations Issues and PRs that pertain to the organizations service. label Jan 7, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jan 7, 2020
@bflad bflad added new-data-source Introduces a new data source. and removed enhancement Requests to existing resources that expand the functionality or scope. needs-triage Waiting for first response or review from a maintainer. labels Jan 10, 2020
@AMMullan
Copy link

Can definitely see massive use-cases for this - especially if we can get a list of accounts based on a tag. Potentially we could look at expanding AWS behaviour to allow applying SCP's based on a Tag which would be amazing!

@gramsa49
Copy link
Contributor

My use case for this capability is to store key information, per AWS account, that can be used to retrieve data from external systems (Terraform data source) to drive Terraform automation. As an example, if AWS account X hosts application system Y, the AWS Orgs Account tags should have an identifier for application system Y. This can be used to retrieve other critical information regarding cost allocations, availability goals, contact information, criticality rating, etc., which can in turn be used to drive other Terraform automation.

In our case, AWS accounts are not created using Terraform, so this information is otherwise inaccessible.

@github-actions github-actions bot added this to the v3.71.0 milestone Jan 3, 2022
@github-actions
Copy link

github-actions bot commented Jan 6, 2022

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

@github-actions
Copy link

github-actions bot commented May 9, 2022

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 May 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-data-source Introduces a new data source. service/organizations Issues and PRs that pertain to the organizations service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants