mineiros-io / terraform-aws-cognito-user-pool

A Terraform module to create and manage Cognito User Pools (Simple and Secure User Sign-Up, Sign-In, and Access Control) on Amazon Web Services (AWS). https://aws.amazon.com/cognito
Apache License 2.0
59 stars 45 forks source link

Inconsistent Result Types #62

Open wesnick opened 2 years ago

wesnick commented 2 years ago

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 commented 2 years ago

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

wesnick commented 2 years ago
Terraform v1.1.3
on darwin_amd64