-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
aws_cognito_user_pool_client data source missing 'name' attribute #22593
Comments
@danquack : Thanks for implementing this datasource, but appears there is a bug with it (unless I'm missing something). I've raised this issue accordingly. |
This is bad documentation on my part. I just ran this locally and was able to get a list of client names, but there might be a cleaner solution: resource "aws_cognito_user_pool" "pool" {
name = "pool"
}
data "aws_cognito_user_pool_clients" "main" {
user_pool_id = aws_cognito_user_pool.pool.id
}
data "aws_cognito_user_pool_client" "client" {
for_each = toset(data.aws_cognito_user_pool_clients.main.client_ids)
client_id = each.value
user_pool_id = aws_cognito_user_pool.pool.id
}
output "names" {
value = [
for k,v in data.aws_cognito_user_pool_client.client : v
].*.name
} |
@danquack : I've copied and pasted what you put in your output section changing it out for my use case and it's returned exactly what I needed. Thanks for that!! |
@keitharogers Any chance you can PR to improve the docs with your code? I feel more folks will have a similar use case. |
Yep, I was planning on it, more than happy to do! |
I've pull requested the above solution, but your example would be way better @keitharogers, if youre still considering contributing ! |
Thanks @danquack . Yep, I was still planning on contributing, although due to a bit of a chicken and egg situation, my solution is breaking the traditional good practices of how Terraform should work and it's quite messy!! I only just came up with it yesterday as well so wanted to review it again before committing to putting something out there, but yes, very much looking to contribute where I can, just want to make sure it's understandable and following best practice so I don't muddy any waters :-) Thanks again for your help with all this! |
This functionality has been released in v3.73.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)
Terraform Configuration Files
Expected Behaviour
Output should list all Cognito user pool app-client names for given user pool.
Actual Behaviour
Tried to fix this error by utilising
toset
as follows:Which appeared to get past the first error, but then I encountered an
unsupported attribute
error instead:Steps to Reproduce
terraform plan
Important Factoids
This is a brand new datasource released yesterday.
References
The text was updated successfully, but these errors were encountered: