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

hundreds-gpu-71155

03/04/2024, 4:40 PM
How do I force regeneration of a
pulumi_random.RandomPassword
?
Just call
pulumi state delete
on the URN?
d

dry-potato-52542

03/04/2024, 4:48 PM
there is keepers you are setting
set another keepers to kick of the drift
h

hundreds-gpu-71155

03/04/2024, 4:49 PM
manually, for reasons outside of pulumi's sphere of influence
d

dry-potato-52542

03/04/2024, 4:50 PM
export pulumi state and modily it to make pulumi think previus keepers where different
or delete resource from the state. but it will be depdendnt on how you coded everything. if dependency chain coded correctly then pulumi will recognize that resource are missing and will trigger creation that will force dependent resources to change as well
h

hundreds-gpu-71155

03/04/2024, 4:56 PM
yeah, pulumi's dependencies system prevents me from just simply deleting it
d

dry-potato-52542

03/04/2024, 4:57 PM
then do: •
pulumi state export > out.josn
• change keepers in that large json •
pulumi stack import --file out.json
this will make pulumi thing it need to recreate that resource.
h

hundreds-gpu-71155

03/04/2024, 4:58 PM
ok
thanks i hate it, but the only other option appears to be editing the keepers in the code and regenerating every similar password
d

dry-potato-52542

03/04/2024, 5:00 PM
yeah.
h

hundreds-gpu-71155

03/04/2024, 8:35 PM
I've settled on
keepers={'regenerate':False}
in the code and touching that in the state when i need to redo this
d

dry-potato-52542

03/04/2024, 8:48 PM
There you go