Delete a Cloud SQL instance without deleting your application. Deleting the application doesn't delete the instance by default.

Enable cascading deletion ΒΆ

Set cascadingDelete to true on the instance in your application manifest:

app.yaml

Deploy your application with the instance still in the manifest. Wait for the deployment to succeed before removing the instance.

Remove the instance from the manifest ΒΆ

Remove sqlInstances from spec.gcp. Keep any other settings under gcp. If none remain, remove gcp too, as shown below:

app.yaml

Deploy your application again. Nais deletes the instance after the deployment.

Verify deletion ΒΆ

  1. Open Nais Console and select your team.
  2. Select Cloud SQL.
  3. Check that the instance no longer appears in the list for its environment.

List the Cloud SQL instances for your team and environment:

bash

Check that the instance no longer appears in the output.