:wave: Hello, team! I am trying to create an `azur...
# azure
m
👋 Hello, team! I am trying to create an
azure-native:dbforpostgresql:Server
. It failed for the first couple of runs (my mistake), and the database server was never created. Now it discovers a drift, and tries to delete the database server before it will create a new database server. But the original database server was never created. How do I hint the Pulumi task that it should ignore if the delete fails? This is my yaml:
Copy code
server:
    type: azure-native:dbforpostgresql:Server
    properties:
      resourceGroupName: ${resourceGroup.name}
      serverName: testserver
      version: "14"
This is some of the output. Pulumi runs in a Github Action.
Copy code
@ updating....
  
      azure-native:containerservice:ManagedCluster aksCluster  
  
   -- azure-native:dbforpostgresql:Server server deleting original (0s) 
  
   +  azure-native:dbforpostgresql:Database database creating (0s) 
  
  @ updating....
  
   -- azure-native:dbforpostgresql:Server server deleting original (1s) error: Code="OperationIdNotFound" Message="The operation with Id: 'testserver' does not exist."
t
That's odd that it thinks the server was created while it wasn't. But I think
pulumi refresh
should delete it from you state if it does not exist in the cloud.
m
I tried to add
refresh: true
without success
Copy code
- name: 🔼 Provision Dev Cluster
        id: pulumi
        uses: pulumi/actions@v5
        env:
          ...
        with:
          command: up
          refresh: true
          stack-name: dev
          cloud-url: ...
          secrets-provider: ...
          work-dir: pulumi
The refresh command seem to run in Github Action
t
Huh, that's surprising again. There is also a
pulumi state delete
command to delete a resource from your state. But honestly, I don't understand what is going on. Any chance you have a repro program that I could run to get in the same state locally?
m
After changing the serverName I got further, and the server was created.
The debug log statement that sent me this way was
Copy code
provider_plugin.go:1883] provider received rpc error `Unknown`: `resource created but read failed autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The requested resource of type 'Microsoft.DBforPostgreSQL/flexibleServers' with name 'testserver' was not found.": Code="ServerGroupDropping" Message="Operations on a server group in dropping state are not allowed."`
t
Oh wow, interesting!