pulumi / pulumi-gcp

A Google Cloud Platform (GCP) Pulumi resource package, providing multi-language access to GCP
Apache License 2.0
183 stars 53 forks source link

TestRegression794 possibly leaking an expensive DB instance in the test account #1311

Closed t0yv0 closed 1 year ago

t0yv0 commented 1 year ago

What happened?

Per https://github.com/pulumi/gcp-account-cleanup/issues/21 these are auto-cleaned up but the test is still creating instances:

[
  {
    "name": "test-regression-794-069fea6b",
    "createTime": "2023-11-01T21:19:51.992Z"
  },
  {
    "name": "test-regression-794-ac4ed450",
    "createTime": "2023-11-01T23:57:17.116Z"
  },
  {
    "name": "test-regression-794-e937e342",
    "createTime": "2023-11-01T23:56:58.468Z"
  },
  {
    "name": "test-regression-794-f925ef9b",
    "createTime": "2023-11-01T18:55:40.790Z"
  },
  {
    "name": "test-regression-794-a3e6c40b",
    "createTime": "2023-11-01T23:57:07.330Z"
  },
  {
    "name": "test-regression-794-a57a89e1",
    "createTime": "2023-11-01T23:56:35.194Z"
  },
  {
    "name": "test-regression-794-8ee4c45e",
    "createTime": "2023-11-01T23:57:11.678Z"
  }
]

Removing them immediately would further help cost control.

Example

N/A

Output of pulumi about

N/A

Additional context

N/A

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).

rquitales commented 1 year ago

Looks like a couple issues here:

  1. DeletionProtection: pulumi.BoolPtr(false), needs to be explicitly set when creating the DB Instance as the default is true (https://www.pulumi.com/registry/packages/gcp/api-docs/sql/databaseinstance/)
  2. The cleanup function is destroying an empty stack, so the actual DB instance isn't being deleted - needs more investigation