https://pulumi.com logo
#general
Title
# general
i

incalculable-midnight-8291

06/22/2022, 7:17 AM
Is there someway to change the “strategy” from “replace” (aka remove before adding new) to “rollout” (as in add new, then delete old)?
l

little-cartoon-10569

06/22/2022, 7:19 AM
The default is to add new then delete old. This is controlled via the deleteBeforeReplace opt.
For resources that have conflicting unique values, then that automatically prevents adding before deleting. Names are often required to be unique (e.g. bucket names).
If you're setting the name arg, then you're probably coming up against this issue. You're setting a must-be-unique value but not allowing Pulumi to generate non-unique values for it.
i

incalculable-midnight-8291

06/26/2022, 9:50 AM
Its true that I am setting a name, but all resources get a unique alphanumeric string at the end anyways. So it still doesnt really make sense. Or maybe Im missing something else?
l

little-cartoon-10569

06/26/2022, 10:37 AM
For most resources, when you set name, that overrides the random string. To set the name but keep the random string, you need to set namePrefix. Check the specific resource that is causing the problem, you may find that its name doesn't have the random suffix.
Another possibility is that you're changing the Pulumi resource id (the 1st arg to the constructor). If you're doing that, then technically Pulumi isn't deleting before creating; it's deleting a removed resource and creating an entirely new one. Are you changing the value of the name parameter?
12 Views