简体   繁体   English

普鲁米 SDK SQL 删除保护不起作用

[英]Pulumi SDK SQL deletion protection not working

I have provisioned SQL (PostrgresSQL) on GCP cloud using Pulumi SDK (Go).我已经使用 Pulumi SDK (Go) 在 GCP 云上配置了 SQL (PostrgresSQL)。 I have set deletionProtection as true - but checking GCP console I can see the SQL is not protected.我已将删除保护设置为 true - 但检查 GCP 控制台我可以看到 SQL 不受保护。 I was able to delete the instance using console by that breaking Pulumi state.通过破坏 Pulumi state,我能够使用控制台删除实例。

+ gcp:sql/databaseInstance:DatabaseInstance: (create)
            [urn=urn:pulumi:us-east4-dev-google-cloud-sql-example::google-cloud-sql-example::gcp:myproject/sql:Database$gcp:sql/databaseInstance:DatabaseInstance::google-cloud-sql]
            databaseVersion   : "POSTGRES_12"
            deletionProtection: true
            name              : "google-cloud-sql-0b96b6d"
            project           : "my-project"
            region            : "us-east4"
            settings          : {
                availabilityType   : "REGIONAL"
                backupConfiguration: {
                    enabled                   : false
                    pointInTimeRecoveryEnabled: false
                }
                databaseFlags      : [
                    [0]: {
                        name      : "auto_explain.log_analyze"
                        value     : "on"
                    }
                    [1]: {
                        name      : "max_connections"
                        value     : "800"
                    }
                ]
                diskAutoresize     : true
                diskAutoresizeLimit: 0
                diskSize           : 200
                diskType           : "PD_SSD"
                insightsConfig     : {
                    queryInsightsEnabled: false
                    queryStringLength   : 1024
                }
                ipConfiguration    : {
                    ipv4Enabled   : false
                    privateNetwork: "projects/my-project/global/networks/dev-vpc"
                }
                pricingPlan        : "PER_USE"
                tier               : "db-custom-32-122880"
                userLabels         : {
                    compliance : "cisl1"
                    criticality: "2"
                    environment: "dev"
                    monitored  : "true"
                    name       : "myusername"
                    owner      : "devops_backend"
                    persistence: "persistent"
                    purpose    : "pulumi-common-google-cloud-sql-example"
                }
            }

Google cloud doesn't have an API mechanism to prevent deletion of SQL database, only for virtual machines.谷歌云没有 API 机制来防止删除 SQL 数据库,仅适用于虚拟机。

If you look at the description of the deletionProtection property is says the following:如果您查看deletionProtection属性的描述,则说明如下:

Whether or not to allow the provider to destroy the instance.是否允许提供者销毁实例。 Unless this field is set to false in state, a destroy or update command that deletes the instance will fail.除非在 state 中将此字段设置为 false,否则删除实例的销毁或更新命令将失败。

Deletion protection is a Pulumi state only operation.删除保护是 Pulumi state 唯一的操作。 It isn't actually modifying the Database in Google cloud at all, because Google doesn't support it.它实际上根本没有修改谷歌云中的数据库,因为谷歌不支持它。

You will not be able to prevent deletion of a Google Cloud SQL instance outside of Pulumi您将无法阻止删除 Pulumi 之外的 Google Cloud SQL 实例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GCP Dataproc 删除保护 - GCP Dataproc Deletion Protection GCP Cloud SQL 无法删除实例,因为“deletion_protection”设置为 true - gcloud 切换? - GCP Cloud SQL failed to delete instance because `deletion_protection` is set to true - gcloud toggle? 防止删除 S3 服务器访问日志 - Protection against deletion of S3 server access logs 如何使用 ApplicationLoadBalancedFargateService cdk 构造为负载均衡器启用删除保护 - How do I enable deletion protection for load balancer using ApplicationLoadBalancedFargateService cdk construct 谷歌云 SQL 数据库删除保护 - Google Cloud SQL Database Delete Protection 高级威胁防护 REST API 不工作 - Advanced Threat Protection REST API Not Working Pulumi GKE Ingress SSL - Pulumi GKE Ingress with SSL 暴露 Pulumi 加密密钥安全吗? - Is exposing Pulumi ecnryptedKey safe? 删除节点在 Firebase 中不起作用 Android 中的实时数据库 Java - Deletion of Node is not working in Firebase Realtime Database in Android Java 有没有办法在删除 Azure SQL 表中的记录时触发逻辑应用程序? - Is there a way to trigger a Logic App on a deletion of a record in an Azure SQL table?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM