Open moulip opened 10 months ago
Hey @moulip. I'm sorry you're having this problem. Just to confirm, have you run pulumi up
with deletion_protection_enabled = False
before running pulumi destroy
?
Hi @iwahbe, in fact the DB is created with deletion_protection_enabled = False. And checking in the portal the protection is actually disabled.
Thanks for confirming.
@moulip can you try setting the delete_protection that is outside the settings block like this:
database = gcp.sql.DatabaseInstance(
"amdatabase",
name=f"{PROJECT_NAME}-amdatabase",
database_version="MYSQL_8_0",
root_password=DB_ROOT_PASSWORD,
region="us-central1",
deletion_protection=False,
settings=gcp.sql.DatabaseInstanceSettingsArgs(
tier=DB_MACHINE_TYPE,
availability_type="ZONAL",
edition="ENTERPRISE",
# deletion_protection_enabled=False,
),
)
What happened?
Performing destroy operation and pulumi keeps throwing this error:
Error, failed to delete instance because deletion_protection is set to true. Set it to false to proceed with instance deletion
the deletion_protection_enabled is set to False and the Delete button is available in GCP Portal.
Example
Output of
pulumi about
Additional context
I have to delete manually the DB from GCP Portal and then edit the pulumi state to remove the DB URN.
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).