https://pulumi.com logo
#azure
Title
# azure
d

dazzling-rose-37445

03/04/2020, 10:24 AM
Hi! I'm creating a CosmosDB with multiple regions, that's the code:
Copy code
const gcosmos = new azure.cosmosdb.Account(config.globalCosmosDb.name,
    {
        name: config.globalCosmosDb.name,
        resourceGroupName: resourceGroup.name,
        location: "northeurope",
        offerType: "Standard",
        geoLocations: [...config.globalCosmosDb.regions],
        consistencyPolicy: { consistencyLevel: "Session" }
    }
);
And the config in my stack yaml file:
Copy code
regions:
  - location: "North Europe"
    failoverPriority: 0
  - location: "West US"
    failoverPriority: 1
  - location: "Southeast Asia"
    failoverPriority: 2
The problem is that if I change my config to add a new region, like:
Copy code
regions:
  - location: "North Europe"
    failoverPriority: 0
  - location: "West US"
    failoverPriority: 1
  - location: "Southeast Asia"
    failoverPriority: 2
  - location: "Canada East"
    failoverPriority: 3
My
pulumi up
deletes my cosmosDb and creates again instead of just updating the geolocations property, like in the image. Am I doing something wrong? 🤔
b

better-rainbow-14549

03/04/2020, 1:10 PM
seems like a bug to me
there's an open PR to update the terraform provider that backs this, maybe that will fix it
t

tall-librarian-49374

03/04/2020, 3:28 PM
That’s how the terraform provider is currently implemented… I had a try to fix it a while ago, but cosmos exposed numerous problems while changing the number of regions, so I couldn’t complete the work with a reliable set of tests.
d

dazzling-rose-37445

03/04/2020, 4:12 PM
Oh, that's unfortunate. But thanks for the feedback guys!
3 Views