我使用 Hashicorp 的 Terraform 来管理 AWS 基础设施。某些迁移任务需要重命名多个资源,例如 db_option_group。
我不知道为什么 Terraform 只通过重命名 db_option_group 就说“强制替换”。在 API 文档中,它说“描述”是一个可选属性,不需要替换。
# module.db_instance.aws_db_option_group.db-option-group must be replaced
-/+ resource "aws_db_option_group" "db-option-group" {
~ arn = "arn:aws:rds:eu-central-1:xxxxxxxxxx:xx:xxxxx-xx-xxxx-cc01-sqlserver-se-14-00" -> (known after apply)
engine_name = "sqlserver-se"
~ id = "xxxxxx-xxx-xxxxx-cc01-sqlserver-se-14-00" -> (known after apply)
major_engine_version = "14.00"
name = "xxxxxx-xxx-xxxxx-cc01-sqlserver-se-14-00"
+ name_prefix = (known after apply)
~ option_group_description = "xxxxxx-xxx-xxxxx-cc01-sqlserver-se-14-00" -> "Option group for xxxxx-xxx-xxxxx-cc01" # forces replacement
~ tags = {
+ "Project" = "xxxxx"
+ "ProjectId" = "xxxxx"
+ "global.app" = "xxxxx"
+ "global.cbp" = "xxxxx"
+ "global.dcs" = "xxxxx"
+ "global.env" = "qa"
+ "global.opco" = "xxxxx"
+ "global.project" = "xxxxx"
}
是什么导致 Terraform 出现这种行为?