Terraform module to create Amazon Cognito User Pools, configure its attributes and resources such as app clients, domain, resource servers. Amazon Cognito User Pools provide a secure user directory that scales to hundreds of millions of users.
When using the device_configuration code block, the values are not respected. Additionally, Terraform believes the current values have not been set and believes they are changes. But when applying Terraform, the existing values get reversed.
[ X ] ✋ I have searched the open/closed issues and my issue is not listed.
List steps in order that led up to the issue you encountered
Update module release version from 0.22.0 to 0.32.0
Expected behavior
Terraform plan is clean, no changes except to additional outputs.
Actual behavior
Terraform believes the cognito pool has changed. Specifically the device_configuration code block indicates that challenge_required_on_new_device = false and device_only_remembered_on_user_prompt = false have not already been set and indicates they are new additions to the state.
Terminal Output Screenshot(s)
19:23:45.156 INFO Downloading Terraform configurations from git::ssh://git@github.com/lgallard/terraform-aws-cognito-user-pool.git?ref=0.32.0 into ./.terragrunt-cache/tGkGequ8IAuRcK6PJi1bfX7QuOI/WG_s9iL0qo433IkacVEDiaWEY3w
19:23:47.970 STDOUT terraform: Initializing the backend...
19:23:48.508 STDOUT terraform:
19:23:48.508 STDOUT terraform: Successfully configured the backend "s3"! Terraform will automatically
19:23:48.508 STDOUT terraform: use this backend unless the backend configuration changes.
19:23:48.947 STDOUT terraform: Initializing provider plugins...
19:23:48.947 STDOUT terraform: - Finding hashicorp/aws versions matching ">= 5.5.0, < 6.0.0"...
19:23:49.827 STDOUT terraform: - Installing hashicorp/aws v5.76.0...
19:23:56.365 STDOUT terraform: - Installed hashicorp/aws v5.76.0 (signed by HashiCorp)
19:23:56.368 STDOUT terraform: Terraform has created a lock file .terraform.lock.hcl to record the provider
19:23:56.368 STDOUT terraform: selections it made above. Include this file in your version control repository
19:23:56.368 STDOUT terraform: so that Terraform can guarantee to make the same selections by default when
19:23:56.368 STDOUT terraform: you run "terraform init" in the future.
19:23:56.368 STDOUT terraform: Terraform has been successfully initialized!
19:23:56.368 STDOUT terraform:
19:23:56.368 STDOUT terraform: You may now begin working with Terraform. Try running "terraform plan" to see
19:23:56.368 STDOUT terraform: any changes that are required for your infrastructure. All Terraform commands
19:23:56.368 STDOUT terraform: should now work.
19:23:56.368 STDOUT terraform: If you ever set or change modules or backend configuration for Terraform,
19:23:56.368 STDOUT terraform: rerun this command to reinitialize your working directory. If you forget, other
19:23:56.368 STDOUT terraform: commands will detect it and remind you to do so if necessary.
19:24:05.524 STDOUT terraform: aws_cognito_user_pool.pool[0]: Refreshing state... [id=us-east-1_0RdemNajx]
19:24:06.040 STDOUT terraform: aws_cognito_user_pool_domain.domain[0]: Refreshing state... [id=company-private-auth-prod]
19:24:06.040 STDOUT terraform: aws_cognito_user_group.main[0]: Refreshing state... [id=us-east-1_0RdemNajx/Company-Internal]
19:24:06.040 STDOUT terraform: aws_cognito_identity_provider.identity_provider[0]: Refreshing state... [id=us-east-1_0RdemNajx:Company]
19:24:06.179 STDOUT terraform: aws_cognito_user_pool_client.client[0]: Refreshing state... [id=1h2lpep2qhsrom7nlf09ji0mgk]
19:24:06.405 STDOUT terraform: Terraform used the selected providers to generate the following execution
19:24:06.405 STDOUT terraform: plan. Resource actions are indicated with the following symbols:
19:24:06.405 STDOUT terraform: ~ update in-place
19:24:06.405 STDOUT terraform: Terraform will perform the following actions:
19:24:06.405 STDOUT terraform: # aws_cognito_identity_provider.identity_provider[0] will be updated in-place
19:24:06.405 STDOUT terraform: ~ resource "aws_cognito_identity_provider" "identity_provider" {
19:24:06.405 STDOUT terraform: id = "us-east-1_0RdemAaaa:Company"
19:24:06.405 STDOUT terraform: ~ provider_details = (sensitive value)
19:24:06.405 STDOUT terraform: # (5 unchanged attributes hidden)
19:24:06.405 STDOUT terraform: }
19:24:06.405 STDOUT terraform: # aws_cognito_user_pool.pool[0] will be updated in-place
19:24:06.405 STDOUT terraform: ~ resource "aws_cognito_user_pool" "pool" {
19:24:06.405 STDOUT terraform: id = "us-east-1_0RdemAaaa"
19:24:06.405 STDOUT terraform: name = "company-private-auth-prod"
19:24:06.405 STDOUT terraform: tags = {}
19:24:06.405 STDOUT terraform: # (16 unchanged attributes hidden)
19:24:06.406 STDOUT terraform: + device_configuration {
19:24:06.406 STDOUT terraform: + challenge_required_on_new_device = false
19:24:06.406 STDOUT terraform: + device_only_remembered_on_user_prompt = false
19:24:06.406 STDOUT terraform: }
19:24:06.406 STDOUT terraform: # (9 unchanged blocks hidden)
19:24:06.406 STDOUT terraform: }
19:24:06.406 STDOUT terraform: Plan: 0 to add, 2 to change, 0 to destroy.
19:24:06.406 STDOUT terraform:
19:24:06.406 STDOUT terraform: Changes to Outputs:
19:24:06.406 STDOUT terraform: + domain_cloudfront_distribution = "d1oia1etbbaaa1.cloudfront.net"
19:24:06.406 STDOUT terraform: + domain_cloudfront_distribution_zone_id = "A1FDTNDABCDEFG2"
19:24:06.406 STDOUT terraform: ~ last_modified_date = "2024-11-14T23:53:51Z" -> "2024-11-15T01:54:32Z"
19:24:06.406 STDOUT terraform: + name = "company-private-auth-prod"
19:24:06.406 STDOUT terraform:
19:24:06.406 STDOUT terraform: ─────────────────────────────────────────────────────────────────────────────
Additional context
Downgrading the module release tag to 0.30.0 results in Terraform deleting the device_configuration changes and effectively reverting the values back to their original state of false
Description
When using the device_configuration code block, the values are not respected. Additionally, Terraform believes the current values have not been set and believes they are changes. But when applying Terraform, the existing values get reversed.
Versions
Reproduction Code
Steps to reproduce the behavior:
Are you using workspaces?
No
Have you cleared the local cache?
Yes
List steps in order that led up to the issue you encountered
Update module release version from 0.22.0 to 0.32.0
Expected behavior
Terraform plan is clean, no changes except to additional outputs.
Actual behavior
Terraform believes the cognito pool has changed. Specifically the device_configuration code block indicates that
challenge_required_on_new_device = false
anddevice_only_remembered_on_user_prompt = false
have not already been set and indicates they are new additions to the state.Terminal Output Screenshot(s)
Additional context
Downgrading the module release tag to 0.30.0 results in Terraform deleting the device_configuration changes and effectively reverting the values back to their original state of
false