I have a custom attribute that I am no longer using, and it is forcing terraform to destroy the user pool each time. Is there away to avoid the user pool's destruction?
My terraform:
resource "aws_cognito_user_pool" "my_pool" {
name = "${var.la} Pool"
alias_attributes = [
"email"
]
/* Auto-verify these fields */
auto_verified_attributes = [
"email"
]
...
schema {
attribute_data_type = "String"
name = "my_custom_attribute1"
required = "false"
mutable = "true"
}
}
terraform plan gives the following result:
schema.xxx.attribute_data_type: "String" => "" (forces new resource)
schema.xxx.developer_only_attribute: "false" => "false"
schema.xxx.mutable: "true" => "false" (forces new resource)
schema.xxx.name: "my_custom_attribute1" => "" (forces new resource)
schema.xxx.number_attribute_constraints.#: "0" => "0"
schema.xxx.required: "false" => "false"
schema.xxx.string_attribute_constraints.#: "1" => "0" (forces new resource)
schema.xxx.string_attribute_constraints.0.max_length: "" => ""
schema.xxx.string_attribute_constraints.0.min_length: "" => ""
I've not made changes to these, but every time I try to plan it says that there are changes and I need to destroy my user pool (which I don't want to do).
I've tried running terraform refresh, but it didn't seem to have an effect.
I found the following, but the suggestions don't seem to fix my issue: https://github.com/terraform-providers/terraform-provider-aws/issues/3891
I don't think it's a bug really. How do I avoid destroying my Cognito user pool?
terraform version: 0.11.5 aws version: 0.17 (also tried 0.15)