-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Fetching SSO IAM role ARNs dynamically #14173
Comments
Anyone know how easy it might be to update the aws_iam_role data source to search for roles based on part of the name or by tags? |
This issue is nearly identical to the one I opened in August last year : #14470. Maybe they should be merged? |
I believe #18048 would fix this issue 😅 |
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! |
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. |
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Expected Behavior
We're using AWS SSO to authenticate into our different AWS accounts. This creates roles in each account that maps to the permission sets in AWS SSO. I'm wondering how I can get these role names in a dynamic fashion in terraform.
For example, I want to allow our developers access to our Kubernetes cluster. I do this by creating a role that has access that a developer can call
AssumeRole
on, like so.Right now I'm having to hard code that role ARN in the assume role policy document - I would like for this to be fetched dynamically.
I could use the
aws_iam_role
data source but for that I need the role name. The name structure of the role seems to be something likeAWSReservedSSO_<permission set>_<unique hash>
(Example role name:AWSReservedSSO_AWSPowerUserAccess_aaaaaabbbbbbcccc
). Is there a reliable/deterministic way to compute that hash in terraform?The text was updated successfully, but these errors were encountered: