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

Inconsistent Result Types #62

Open
wesnick opened this issue Jan 14, 2022 · 2 comments
Open

Inconsistent Result Types #62

wesnick opened this issue Jan 14, 2022 · 2 comments

Comments

@wesnick
Copy link

wesnick commented Jan 14, 2022

After upgrade to latest terraform, some of my user pools are invalid. I have errors like this:

│ Error: Inconsistent conditional result types
│
│   on .terraform/modules/acme_user_pool/main.tf line 214, in resource "aws_cognito_user_pool_client" "client":
│  214:   for_each = var.module_enabled ? local.clients : {}
│     ├────────────────
│     │ local.clients is object with 2 attributes
│
│ The true result value has the wrong type: attribute types must all match for conversion to map.

If I hotpatch the code to look like this, it fixes this for me.

for_each = var.module_enabled ? local.clients : map(object({}))

I am not sure if there is an error in my configuration or if this is a legitimate fix for this issue. I can open a PR if needed

@mariux
Copy link
Member

mariux commented Jan 17, 2022

hey @wesnick, thank you for reporting this. What Terraform version are you using?

@wesnick
Copy link
Author

wesnick commented Jan 18, 2022

Terraform v1.1.3
on darwin_amd64

SAOPP referenced this issue in SAOPP/terraform-aws-cognito-user-pool Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants