Just deployed some resources (including AKS and Co...
# general
c
Just deployed some resources (including AKS and CosmosDB) and ran
pulumi preview
right after it successfully deployed the stack and it's now saying that it wants to replace the cosmosDB database. Why is that? Looks like this all starts because the
consistencyPolicy
needs updating?!
Copy code
cosmos_db_account = Account(
    "cosmosdbaccount",
    consistency_policy={
        "consistencyLevel": "Strong",
        "maxIntervalInSeconds": 5,
        "maxStalenessPrefix": 10
    },
    geo_locations=[
        {
        "location": resource_group.location,
        "failoverPriority":0
        }
    ],
    kind="GlobalDocumentDB",
    location=resource_group.location,
    offer_type="Standard",
    resource_group_name=resource_group.name
)
I check the consistency setting in the Azure portal and it shows that it's set to "Strong", so no idea why pulumi thinks it has to reconfigure it to "Strong" and then replace all the other resources. When I execute
pulumi up
it applies a change to cosmosDB, not to any of the other resources it said it would. Once done, I can run
pulumi preview
again and I get the same output as before where pulumi thinks it has to update and even replace multiple resources.
t
That sounds bad. Could you open an issue with a sample code?
b
Also, what does the detailed diff look like?
t
I had a look at this and the diff that shows up is
maxStalenessPrefix: 100 => 10
. I believe
maxStalenessPrefix
has no meaning for the strong consistency, so it's just reported as default
100
while we try to set it it
10
. You should change your code to
Copy code
consistency_policy={
        "consistencyLevel": "Strong"
},
c
Thanks @tall-librarian-49374 I'll test that out. Just about to fly back home after a conference. Will update you tomorrow.