hi All, looking for assistance in fixing a broken ...
# azure
t
hi All, looking for assistance in fixing a broken state file!
I've tried doing a
pulumi refresh
on the specific resource i'm having issues with, but doing a pulumi preview right after still shows that it's trying to create the resource.
l
That means it's not managed, Pulumi doesn't know about it in the cloud. No amount of refreshing can fix that. Does the resource exist in cloud? If it does, then you'll have to link it to your code via the state file by using the
import
opt. Read about it here: https://www.pulumi.com/docs/iac/concepts/options/import/
🤔 1
t
it was managed at some point as i deployed that storage account through pulumi. i did try
import
as well but it doesn't add the dependent resources.
l
Yes, you need to use the import on all the dependencies. Or if they are already in state, you'll need to export, edit, and import. Removing a managed resource from state can have a lot of inconvenient side effects.
f
tenwit is correct - you'll need to either import all the dependent resources or fixup the state
if you've more than a couple (looks like you do) then bulk importing would be easier