pulumi / pulumi-digitalocean

A DigitalOcean Pulumi resource package, providing multi-language access to DigitalOcean
Apache License 2.0
83 stars 13 forks source link

How to safely upgrade database cluster version without losing data? #121

Open snipebin opened 4 years ago

snipebin commented 4 years ago

Hi, thanks in advance for the support.

Digital ocean explains how we one upgrade cluster versions: https://www.digitalocean.com/docs/databases/postgresql/how-to/upgrade-version/

what's the equivalent for Pulumi?

Here's my definition

new digitalocean.DatabaseCluster(`${stackName}-shared`, {
    engine: "pg",
    nodeCount: config.requireNumber('postgres-cluster-shared-node-count'),
    region: doRegion,
    size: digitalocean.DatabaseSlugs.DB_1VPCU2GB,
    version: "11",
    privateNetworkUuid: vpc.id
  }, { dependsOn: [vpc], protect: true  })

I want to upgrade to version 12.

Do I simply change to version: "12", run pulumi up?

lukehoban commented 4 years ago

Do I simply change to version: "12", run pulumi up?

I don't personally know the DigitalOcean API well, but have you tried previewing doing this? The preview should tell you whether it can update in place, or whether the change would require a replacement of the resource (which will then be prevented due to your protect: true.