bored-kangaroo-88486
06/18/2025, 8:39 AMpulumi up
to deploy a GCP Postgres SQL DB, I ran pulumi destroy
but got the error:
failed to delete instance because deletion_protection is set to true. Set it to false to proceed with instance deletion
I then updated my pulumi typescript code to disable delete protection on the DB and ran pulumi up
to apply that change. I checked in GCP Console to confirm that delete protection was indeed disabled.
I then reran pulumi destroy
but got the same error again. I then ran pulumi refresh
and tried pulumi destroy
once more but still get the same error.
I have pulumi v3.177.0, typescript 5.8.3, and node v20.18.3bored-kangaroo-88486
06/18/2025, 10:44 AMdeletionProtection
and deletionProtectionEnabled
as follows:
const dbInstance = new gcp.sql.DatabaseInstance(
"...",
{
...,
deletionProtection: false,
settings: {
...,
deletionProtectionEnabled: false,
},
},
{
...
}
);
I was originally only setting deletionProtectionEnabled
. With the above change, running pulumi up
followed by pulumi destroy
finally worked.bored-kangaroo-88486
06/18/2025, 10:49 AMdeletionProtectionEnabled
to false
is required to affect the actual GCP DB. Setting deletionProtection
to false
allows pulumi to delete this resource (but only if deletionProtectionEnabled
is also false
).No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by