This message was deleted.
# getting-started
s
This message was deleted.
b
Hi, to import you’ll either need to run the
pulumi import
command or the add the id to the resource. There’s some guidance on what to do (I would use the
pulumi import
command personally) on this page: https://www.pulumi.com/docs/using-pulumi/adopting-pulumi/import/
a
Thanks, I'll give that a go. I am a bit confused though, based on "The Solution" section of https://www.pulumi.com/blog/repairing-state-with-pulumi-refresh/ blog post, I was expecting
pulumi refresh
to interactively walk me through the imports I needed Are these two different kinds of imports?
b
Are you talking about “out of band” changes?
Oh I see what you’re referring to
No that’s if the update is cancelled before the resources is created, but it’s still in Pulumi’s internal “todo list” (so it knows that it needs to create the resource but it hasn’t yet)
a
Thanks for clarifying that. Is there a technical reason why
pulumi refresh
couldn't detect these changes, or is simply something that hasn't been written. I'm coming with a lot of familiarity deploying with ARM / bicep templates which don't include a state file, so I'm still trying to wrap my head around what the state file is doing)
b
Do you mean why doesn’t refresh know about resources that you want to import?
a
yup
b
Pulumi can only refresh what it knows about, i.e. what’s in the state. It can’t just look through Azure and hoover up all the resources that you can read in Azure Azure kinda has state in that the whole of the ARM API is the state.
a
ah ok, I think I see.
pulumi refresh
is purely looking at the state. And because pulumi's initial creation never got far enough to insert into the statefile,
pulumi refresh
never knows about the other resources. My thinking was that since
plumui up
knew enough about what resource to create (and that conflicted), that it could therefore be able to work out the specific resource to import. However I never see a call to
dotnet build
when running
pulumi refresh
, so it never has any of that information available to it.
Thank you very much for helping explain this to me Piers
b
exactly
no problem. Happy to help 🙂