我正在尝试使用Terraform部署AWS Cognito用户池。
第一次部署时,一切都运行正常,但是当我尝试在没有修改任何配置的情况下再次运行
我正在使用Terraform版本0.13.0和Terragrunt 0.25.0。
这是Terraform配置资源,我使用S3作为后端。
第一次部署时,一切都运行正常,但是当我尝试在没有修改任何配置的情况下再次运行
terraform apply-all
时,出现以下错误:
Error: error updating Cognito User Pool (us-east-1_XXX): cannot modify or remove schema items
请帮帮我!我正在使用Terraform版本0.13.0和Terragrunt 0.25.0。
这是Terraform配置资源,我使用S3作为后端。
terraform {
required_providers {
aws = {
version = ">= 3.0"
source = "hashicorp/aws"
}
}
}
provider "aws" {
region = var.region
profile = var.aws_profile
}
resource "aws_cognito_user_pool" "pool" {
name = "my-user-pool"
mfa_configuration = "OFF"
username_attributes = ["email"]
password_policy {
minimum_length = 8
}
schema {
name = "name"
attribute_data_type = "String"
developer_only_attribute = false
mutable = true
required = true
string_attribute_constraints {
max_length = 256
}
}
schema {
name = "family_name"
attribute_data_type = "String"
developer_only_attribute = false
mutable = true
required = true
string_attribute_constraints {
max_length = 256
}
}
schema {
name = "phone_number"
attribute_data_type = "String"
developer_only_attribute = false
mutable = true // false for "sub"
required = true // true for "sub"
string_attribute_constraints {
max_length = 256
}
}
account_recovery_setting {
recovery_mechanism {
name = "verified_email"
priority = 1
}
}
auto_verified_attributes = [
"email"
]
user_pool_add_ons {
advanced_security_mode = "OFF"
}
}
谢谢