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

New Data Source : aws_iam_roles #14470

Closed
Marcvd316 opened this issue Aug 4, 2020 · 5 comments · Fixed by #18585
Closed

New Data Source : aws_iam_roles #14470

Marcvd316 opened this issue Aug 4, 2020 · 5 comments · Fixed by #18585
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-data-source Introduces a new data source. service/iam Issues and PRs that pertain to the iam service.
Milestone

Comments

@Marcvd316
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

Description

It would be helpful to have a terraform data source that lists all the AWS IAM roles that exists in an account. An example of a use case where this would be useful is for roles created by AWS SSO in different accounts in an AWS Organization, the roles end up with a known prefix, but the last few characters are randomly generated (e.g.: AWSReservedSSO_Administrators_3785d47bba2d9cde4).

New or Affected Resource(s)

  • data.aws_iam_roles

Potential Terraform Configuration

data "aws_iam_roles" "administrators" {
  filter {
      name   = "role-name"
      values = ["AWSReservedSSO_Administrators_*"]
  }
}

References

@Marcvd316 Marcvd316 added the enhancement Requests to existing resources that expand the functionality or scope. label Aug 4, 2020
@ghost ghost added the service/iam Issues and PRs that pertain to the iam service. label Aug 4, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Aug 4, 2020
@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 Aug 4, 2020
@michelzanini
Copy link

I had exactly that same requirement today 👍

@sidewinder12s
Copy link

Related to the ask: #14173

A resource like this more closely matches similar lookup requirements like the aws_subnet_ids data source.

@seddarj
Copy link

seddarj commented Mar 11, 2021

Hello, I've taken a bit of a different approach to solve this issue in #18048. Instead of listing all roles based on a filter, I try to find the role that matches the Permission Set for which it was created.

Feel free to have a look there and to comment on it 😅

@github-actions
Copy link

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

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 Sep 19, 2021
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. new-data-source Introduces a new data source. service/iam Issues and PRs that pertain to the iam service.
Projects
None yet
6 participants