better-shampoo-48884
05/19/2021, 6:52 AMurn:pulumi:mystack::myproject::purpose:components:provider$purpose:components:group$purpose:components:k8s$azure-native:containerservice:ManagedCluster$random:index/randomUuid:RandomUuid::mystack-cluster-k8s-location-diskcrypto-to-kv-cert-RA
I'm guessing the :components:k8s$azure-native:
bit is what's going to change.
Initial thought: export the stack + search and replace + reimport stack? Any other ideas? Doing pulumi import
on each one is.. just not going to work, besides taking a huge amount of time, it will just be really really really tricky to ensure I have the right URN specified for each resource.little-cartoon-10569
05/19/2021, 8:37 PMpulumi stack output --file x.json
).
2. Comment / flag out all the resources that will be changing, so that you create all their parents correctly without importing anything.
3. Comment / flag out the original resources and remove them from state (pulumi state delete
).
4. Run pulumi import --parent ...
to import the resources to the correct place.
5. Comment / flag in the new code for the resources, making it look like the code that Pulumi generated.
6. Tidy up old commented / flagged-out code.
7. pulumi preview
to check everything in state matches.