This message was deleted.
# general
s
This message was deleted.
b
@rich-breakfast-87724 you can use Pulumi state delete <urn>
That will delete it the from state BUT not the resource
As you imports the resource it is marked as protected so it can’t be deleted immediately - you would need to ensure to unprotect it first
So Pulumi state unprotect <urn> will remove that protection bot
Bit*
r
Worked perfectly, thank you!
b
👌👌
You can even self answer the SO post so others can learn from it ;)
r
Yep, doing that right now
Also, could you please provide a brief explanation (or a link to it) on the difference between importing a resource and using the ".get()" method on the resources class? I tried both and the difference is not clear.
Actually, it feels "safer" to import the resources with the .get() method, but I can't put in words why I fell this.
b
Importing a resource allows you to bring the resource into state so that Pulumi can manage it The .get() looks up the information - thing read only - and the resource cannot be changed
r
hmmm ok, so please just confirm if I'm correct and understood this: my company has vpc's and security groups that are manually managed, I don't want to mess things for them and other projects that use these resources, but I want to use them in my pulumi program. In this case, I should only use the get() method, right? It feels dumb to ask this after your clear answer but I'm afraid to do something wrong in the company's account, so it's better to confirm.
Nevermind, your answer is clear enough, you don't need to answer this last question haha Thanks a lot for your time
b
Yeah that’s exactly correct - if you just need to look up information then you can use the get() and there is no risk to any change :)
🚀 1