Comments (10)
@Modestasthinkt try defining var.case_sensitive
with the same value it tries to replace.
from terraform-aws-cognito-user-pool.
Even with the same value, terraform wants to force replacement because the entire username_configuration block is absent (it's optional and the resource was originally provisioned via the console). Would converting username_configuration to a dynamic block solve this?
Maybe something like this:
locals {
username_configuration_attributes = length(var.username_configuration) == 0 ? {} : {
case_sensitive = lookup(var.username_configuration, "case_sensitive", true)
}
username_configuration = length(local.username_configuration_attributes) == 0 ? [] : [local.username_configuration_attributes]
}
dynamic "username_configuration" {
for_each = local.username_configuration
content {
case_sensitive = lookup(username_configuration.value, "case_sensitive")
}
}
from terraform-aws-cognito-user-pool.
@Modestasthinkt @bentlema I couldn't reproduce the issue. I created a new user pool from the console and then imported with Terraform.
Can you give me more information?
- AWS provider version?
- Terraform version?
from terraform-aws-cognito-user-pool.
@bentlema I can add the suggested code, but username_configuration
is just one bock definition.
from terraform-aws-cognito-user-pool.
In my case, I'm using: Terraform v0.12.29, provider.aws v2.70.0
About that code snippet: I was just looking for a way to omit the username_configuration block entirely and it seems like the dynamic block achieves that when given an empty list, but I didn't spend too much time on it...could be a better way I'm missing.
Also, I had imported a user pool that was created over a year ago. Let me see if it does the same thing with a new pool...
from terraform-aws-cognito-user-pool.
@eduzera I see...I'm adding your code to avoid defining username_configuration
from terraform-aws-cognito-user-pool.
Yeah, same here, I was unable to repo on a newly-created user pool via the console.
But, I did find a case where I could repo the issue:
- Create a new user pool via terraform using resource aws_cognito_user_pool directly and omitting the username_configuration block
- Build out a new root module using this module & import the pool created in the previous step
- Run a terraform plan, and you'll see that it wants to destroy/re-create due to the case_sensitive option
from terraform-aws-cognito-user-pool.
@bentlema you can try with this branch https://github.com/lgallard/terraform-aws-cognito-user-pool/tree/dynamic_username_configuration_block
If you omit the user_configuration
variable it shouldn't create the block (I used you code and jus rename the local).
If it works for you, I merge it after updating the README and the examples.
from terraform-aws-cognito-user-pool.
Thanks @lgallard ! Tested it, and works great.
from terraform-aws-cognito-user-pool.
@Modestasthinkt @bentlema release 0.6.0 fixes this issue!
from terraform-aws-cognito-user-pool.
Related Issues (20)
- client_prevent_user_existence_errors = "ENABLED" is not working HOT 2
- deletion_protection added in 0.20.0 now requires AWS provider V4.38 HOT 1
- New auth_session_validity parameter in user pool client HOT 2
- Call to function "lookup" failed: lookup failed to find key "attributes_require_verification_before_update" HOT 1
- FYI: Terraform AWS Provider 4.58.0 requires recovery_mechanism HOT 1
- noobie: cannot create user pool with assume role terraform permissions HOT 1
- new value: .write_attributes: was cty.SetValEmpty(cty.String), but now │ null HOT 1
- Definitive List for: client_supported_identity_providers HOT 1
- Unable to have devices remembered and force MFA sign in every time HOT 1
- device configuration Options are wrong
- String schemas are updated on every terraform run due to missing string_attribute_constraints attribute HOT 3
- Unable to find "Self-service sign-up" option in the module HOT 4
- InvalidParameterException: The provider XXXXXX does not exist for User Pool YYYYYY.
- Invalid MFA configuration given, can't turn off MFA and configure an MFA together. HOT 5
- Update to allow AWS provider version 4.x HOT 3
- lamdba configuration HOT 3
- lambda_config keeps changing. HOT 4
- String schema issue
- feat: grant cognito lambda execution permissions to all functions HOT 1
- Identity providers keep changing to null HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-aws-cognito-user-pool.