https://pulumi.com logo
Title
b

bulky-policeman-29913

09/04/2021, 12:30 AM
Is anyone aware of a way to make pulumi always replace a given resource in your stack. In my case a Digital Ocean droplet, I don't ever want an update in place.
s

steep-toddler-94095

09/04/2021, 12:38 AM
you can force this by giving the resource a name that depends on something like the unix time
b

bulky-policeman-29913

09/04/2021, 12:40 AM
oh ok the name is immutable forces a replacement eh?
s

steep-toddler-94095

09/04/2021, 12:47 AM
yup! by "name" I mean Pulumi resource name, which is the first parameter to a resource class instantiation
b

bulky-policeman-29913

09/04/2021, 12:48 AM
👍 perfect thanks @colossal-australia-65039
😛: 1
b

bored-table-20691

09/04/2021, 12:49 AM
I wonder if setting
delete before replace
will also do it, but have never tried.
s

steep-toddler-94095

09/04/2021, 1:06 AM
That setting applies to resources that are going to be replaced and forces that the resource is deleted before trying to create the new one. But it won't cause the resource to be replaced if there are no changes to it
b

bored-table-20691

09/04/2021, 1:08 AM
I understood the above desire to be “if you need to do an update, do a replace rather than an in-place update”, not a “replace this resource every time you run
pulumi up
b

bulky-policeman-29913

09/04/2021, 1:12 AM
because user-data only runs on spin up. If I push something new that impacts that I want it to be reflected (ie: a new container instance, an env var value etc.)
Sadly there seems to be other issues that block this approach from working without a full teardown