pulumi-digitalocean icon indicating copy to clipboard operation
pulumi-digitalocean copied to clipboard

DB Cluster maintenance window always showing as needing an update

Open gjolund opened this issue 4 years ago • 4 comments

Given a cluster configuration like this:

const pgCluster = new digitalocean.DatabaseCluster(
      "do-pg-cluster",
      {
        name: pgClusterName,
        engine: "pg",
        nodeCount: isProduction ? cluster.prod.nodes : cluster.dev.nodes,
        region: "sgp1",
        size: isProduction ? cluster.prod.size : cluster.dev.size,
        version: "12",
        maintenanceWindows: [
          {
            day: "friday", // saturday 00:00 +07
            hour: "18:00",
          },
        ],
      },
      resourceOptions
    );

Pulumi is showing the following diff on every update even though the window has been applied.

pulumi:pulumi:Stack                       platform-dev-austinrivas              
     └─ DigitalOcean                           digitalocean                          
 ~      └─ digitalocean:index:DatabaseCluster  do-pg-cluster             updated     [diff: ~maintenanceWindows]

gjolund avatar Feb 10 '21 09:02 gjolund

The terraform provider also seems to throw some errors when removing a maintenance window that was already created.

gjolund avatar Feb 10 '21 09:02 gjolund

Hi @austinrivas

My apologies for this - please can you show me the diff - what is the value changed from / to

You can get it when using "pulumi up" and then looking at the details

Paul

stack72 avatar Feb 10 '21 11:02 stack72

My mistake, its was a time format issue.

pulumi:pulumi:Stack: (same)
    [urn=urn:pulumi:dev::platform::pulumi:pulumi:Stack::platform-dev]
        ~ digitalocean:index/databaseCluster:DatabaseCluster: (update)
            [id=ba969d15-848f-4fe6-b97d-08a088f3f05b]
            [urn=urn:pulumi:dev::platform::DigitalOcean$digitalocean:index/databaseCluster:DatabaseCluster::do-pg-cluster]
            [provider=urn:pulumi:dev::platform::pulumi:providers:digitalocean::default_3_5_0::3fb024d6-a3e2-4d8b-a5b0-f84e834ac0f3]
          ~ maintenanceWindows: [
              ~ [0]: {
                      ~ hour: "18:00:00" => "18:00"
                    }
            ]

However do still see an error when removing all maintenance windows.

gjolund avatar Feb 10 '21 16:02 gjolund

What error are you seeing @austinrivas ?

stack72 avatar Feb 10 '21 17:02 stack72

Exact same issue still happens today. My repro:

import * as pulumi from "@pulumi/pulumi";
import * as digitalocean from "@pulumi/digitalocean";

const pgCluster = new digitalocean.DatabaseCluster("do-pg-cluster", {
    name: "test",
    engine: "mysql",
    nodeCount: 1,
    region: "nyc3",
    size: "db-s-1vcpu-1gb",
    version: "8",
    maintenanceWindows: [
      {
        day: "friday", // saturday 00:00 +07
        hour: "18:00",
      },
    ],
});

Diff:

maintenanceWindows: [
          ~ [0]: {
                  ~ hour: "18:00:00" => "18:00"
                }
        ]

The workaround is very simple though, just change your code to

        hour: "18:00:00",

I'm quite sure it's an upstream issue, and given how simple the workaround is, I'm inclined to close this issue as won't fix.

mikhailshilkov avatar Nov 30 '23 15:11 mikhailshilkov