handsome-state-59775
04/26/2021, 2:00 PMbroad-dog-22463
04/26/2021, 2:03 PMresource_name
as a param to do thathandsome-state-59775
04/26/2021, 2:41 PMcs.ManagedCluster(
resource_name='aks',
...
on azure portal: aks566fe557broad-dog-22463
04/26/2021, 2:42 PMtall-librarian-49374
04/26/2021, 2:44 PMresource_name
parameter vs. resource_name
property of the resource in Python…resource_name_
handsome-state-59775
04/27/2021, 4:27 AMprotect=True
and delete_before_replace=True
(as I should, I believe, when overriding autonaming?), I expect Pulumi to block any updates to that resource if that update requires replacement - and thus, deletion in this case. Is my intuition correct?tall-librarian-49374
04/27/2021, 5:59 AMdelete_before_replace
is applies automatically if you switch off auto-naming. and yes, protect=true should prevent any deletion.resource_name_
in the argument type.handsome-state-59775
04/27/2021, 7:24 AMcs.ManagedCluster(
resource_name=resource_name,
resource_name_=resource_name, # Overrides auto-naming
resource_group_name=resource_group.name,
...
tall-librarian-49374
04/27/2021, 7:46 AMhandsome-state-59775
04/27/2021, 7:56 AMquoting https://www.pulumi.com/docs/intro/concepts/resources/#autonamingis applies automatically if you switch off auto-namingdelete_before_replace
Overriding auto-naming makes your project susceptible to naming collisions. As a result, for resources that may need to be replaced, you should specifyso which is it?in the resource’s options. This option ensures that old resources are deleted before new ones are created, which will prevent those collisions.deleteBeforeReplace: true
tall-librarian-49374
04/27/2021, 8:19 AMdeleteBeforeReplace: true
has no downside too, so it’s okay to include ithandsome-state-59775
04/27/2021, 9:11 AMdelete_before_replace=True
,
p state unprotect --all -y && p up -r --show-replacement-steps -y
results in:
azure-native:containerservice:ManagedCluster (aks):
error: cannot create already existing resource '/subscriptions/****/resourceGroups/****/providers/Microsoft.ContainerService/managedClusters/****-aks'
I was expecting this combination of config and commands to let pulumi delete and recreate the resource if necessary.
where could i be going wrong?