Terraform v0.12.20
Provider AWS 2.47
resource "aws_cognito_user_pool" "this" {
name = var.pool_name
password_policy {
minimum_length = 8
require_lowercase = true
require_numbers = true
require_symbols = true
require_uppercase = true
temporary_password_validity_days = 90
}
admin_create_user_config {
allow_admin_create_user_only = true
}
schema {
attribute_data_type = "String"
developer_only_attribute = false
mutable = true
name = "email"
required = true
string_attribute_constraints {
min_length = 0
max_length = 2048
}
}
schema {
attribute_data_type = "String"
developer_only_attribute = false
mutable = true
name = "name"
required = true
string_attribute_constraints {
min_length = 0
max_length = 2048
}
}
schema {
attribute_data_type = "String"
developer_only_attribute = false
mutable = true
name = "family_name"
required = true
string_attribute_constraints {
min_length = 0
max_length = 2048
}
}
schema {
attribute_data_type = "String"
developer_only_attribute = false
mutable = true
name = "profile"
required = false
string_attribute_constraints {
min_length = 0
max_length = 2048
}
}
tags = merge(var.common_tags)
}
https://gist.github.com/alemazz/e7f72c95f47405107ff1c8686f10b611
Terraform report a clean plan/apply with new value "temporary_password_validity_days = 90"
Terraform keep re add the old configuration with deprecated value "unused_account_validity_days"
terraform apply
From what I've noticed the aws-provider reports the existence of the unused_account_validity_days
even if it was never declared, automatically matching the new temporary_password_validity_days
, presumably there's some mapping that remains, or that will need to be done due to how aws configures things internally.
Also getting this with TF 0.12.18 and AWS provider 2.47, guessing it's because the old attribute is still in the state.
@nickdgriffin I thought so, I tried to pull (terraform pull) and repush (terraform push) the state dropping the keyword "unused_account_validity_days"
I am also seeing this issues. 12.18 and provider 2.47
In the mean time i am getting around it with this:
lifecycle {
ignore_changes = [
admin_create_user_config.0.unused_account_validity_days
]
}
Also getting this with TF 0.12.18 and AWS provider 2.47, guessing it's because the old attribute is still in the state.
@nickdgriffin I thought the same, but also had this on a completely new state (had several environments to set up, coincidentally :) )
See https://github.com/terraform-providers/terraform-provider-aws/pull/10890 for wider context, this is AWS API.
Ah, looks like the unused_account_validity_days
field is missing Computed: true
on the schema, since we want to ignore when folks are not adding it to their Terraform configurations. Will submit fix shortly.
The fix for this has been merged and will release with version 2.49.0 of the Terraform AWS Provider, tomorrow. 👍
This has been released in version 2.49.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 for triage. Thanks!
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.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!
Most helpful comment
From what I've noticed the aws-provider reports the existence of the
unused_account_validity_days
even if it was never declared, automatically matching the newtemporary_password_validity_days
, presumably there's some mapping that remains, or that will need to be done due to how aws configures things internally.