FlexibleEngineCloud / provider-flexibleengine

Crossplane provider that exposes XRM-conformant managed resources for the FlexibleEngine API.
Apache License 2.0
10 stars 3 forks source link

[RDS] cannot delete database on PostgreSQL instance #86

Open dmicheneau opened 1 year ago

dmicheneau commented 1 year ago

Is there an existing issue for this?

Current Behavior

After database creation, impossible to delete the database, error in terraform:

terraform destroy

╷
│ Error: Instance cannot be destroyed
│ 
│   on main.tf.json line 1, in resource.flexibleengine_rds_database:
│    1: {"provider":{"flexibleengine":{"access_key":"xxxxxxxxxxxxxxx","domain_name":"xxxxxx","insecure":false,"region":"eu-west-0","secret_key":"xxxxxxxxxxxxx"}},"resource":{"flexibleengine_rds_database":{"example-rds-database":{"character_set":"UTF8","instance_id":"6b5ff3b1415f4696976f960046a2d10ein03","lifecycle":{"prevent_destroy":true},"name":"examplerdsdatabase"}}},"terraform":{"required_providers":{"flexibleengine":{"source":"FlexibleEngineCloud/flexibleengine","version":"1.35.1"}}}}
│ 
│ Resource flexibleengine_rds_database.example-rds-database has lifecycle.prevent_destroy set, but the plan calls for this resource to be destroyed. To avoid this error and continue
│ with the plan, either disable lifecycle.prevent_destroy or reduce the scope of the plan using the -target flag.

Expected Behavior

The database will be destroy

Steps To Reproduce

"resource": {
        "flexibleengine_rds_database": {
            "example-rds-database": {
                "character_set": "UTF8",
                "instance_id": "6b5ff3b1415f4696976f960046a2d10ein03",
                "name": "examplerdsdatabase"
            }
        }
    }

Environment

dmicheneau commented 1 year ago

https://github.com/FlexibleEngineCloud/terraform-provider-flexibleengine/issues/898

azrod commented 1 year ago

@dmicheneau Please use block code in your description

Official doc

`One line code`

Multi Line Code