https://pulumi.com logo
Title
s

straight-crayon-4578

05/09/2022, 7:50 PM
Is there anyway to undo an import? (python) I've imported a resource using CLI, saw it's code but decided not to bring the code to the
__main__.py
file, even though the imported code isn't at main file, the CLI keeps prompting
Preview failed: unable to delete resource...
b

billowy-army-68599

05/09/2022, 7:59 PM
@straight-crayon-4578 get the resources urn using
pulumi stack --show-urns
and then delete it from the state:
pulumi state delete <urn>
s

straight-crayon-4578

05/09/2022, 8:02 PM
@billowy-army-68599 I tried that but got:
error: This resource can't be safely deleted because it is protected. Re-run this command with --force to force deletion
This will delete only from pulumi stack or also from cloud provider? I dont want to delete from cloud provider... Thanks!
b

billowy-army-68599

05/09/2022, 8:13 PM
it won't delete anything from the cloud provider, it just removes it from the Pulumi state
🙂 1
1