我有一个用于配置 Cloud SQL 实例的 tf 脚本,以及几个数据库和一个管理员用户。我已重命名该实例,因此创建了一个新实例,但 terraform 在删除旧实例时遇到了问题。
Error: Error, failed to delete instance because deletion_protection is set to true. Set it to false to proceed with instance deletion
Run Code Online (Sandbox Code Playgroud)
我试过将 设置为deletion_protection,false但我不断收到相同的错误。有没有办法检查哪些资源需要deletion_protection设置为 false 才能被删除?我只将它添加到google_sql_database_instance资源中。
我的 tf 脚本:
// Provision the Cloud SQL Instance
resource "google_sql_database_instance" "instance-master" {
name = "instance-db-${random_id.random_suffix_id.hex}"
region = var.region
database_version = "POSTGRES_12"
project = var.project_id
settings {
availability_type = "REGIONAL"
tier = "db-f1-micro"
activation_policy = "ALWAYS"
disk_type = "PD_SSD" …Run Code Online (Sandbox Code Playgroud)