Good morning. I am trying to create some GCP uptim...
# getting-started
s
Good morning. I am trying to create some GCP uptime checks with Pulumi but on every apply it wants to replace them despite despite no actual difference. I've split the code into a class in Python to be able to loop over it to create multiple instances. the code as follows.
Copy code
from pulumi_gcp import monitoring

class GCPUptimeCheck:

    def __init__(self, hostname, projectid):
        self.hostname = f"{hostname}.<http://verifybrand.com|verifybrand.com>"
        self.projectid = projectid  

    def createUptimeCheck(self):
        project_id = self.projectid
        https = monitoring.UptimeCheckConfig(f"{self.hostname}-UptimeCheck",
            display_name=self.hostname,
            http_check=monitoring.UptimeCheckConfigHttpCheckArgs(
                path="/home/heartbeat",
                port=443,
                use_ssl=True,
                validate_ssl=True
            ),
            monitored_resource=monitoring.UptimeCheckConfigMonitoredResourceArgs(
                labels={
                    "host":self.hostname,
                    "projectId":project_id,
                },
                type="uptime_url",
            ),
                timeout="10s",
                project=self.projectid
        )
        return https
On each apply it says the reason to replace is because of the monitoredResource. Runnin a preview --json I have the following detailed reasons.
Copy code
"detailedDiff": {
                "monitoredResource.labels.projectId": {
                    "kind": "add-replace",
                    "inputDiff": false
                },
                "monitoredResource.labels.project_id": {
                    "kind": "delete-replace",
                    "inputDiff": false
                }
            }
But looking at the old state and new state it lists the same json output. I's like to not to replace the uptime checks to be able to keep historical data. Any help is appreciated.
b
can you open an issue if you can repro?