sparse-intern-71089
07/11/2022, 9:47 AMlittle-cartoon-10569
07/11/2022, 9:27 PMdependsOn
opt to everything that should have been deleted before the instance.little-cartoon-10569
07/11/2022, 9:27 PMlittle-cartoon-10569
07/11/2022, 9:27 PMdazzling-oxygen-84405
07/12/2022, 10:30 AMCommand
tries to run it’s delete
action on an instance that no longer exists.little-cartoon-10569
07/12/2022, 9:08 PMpulumi refresh
.dazzling-oxygen-84405
07/12/2022, 10:04 PMCommand
action - there’s no way for it to know that “this instance was deleted” means “this command is deleted too”. That’s what I want to be able to express.
As far as I can tell, dependsOn
doesn’t seem to include that kind of relationship. If I delete my instance, pulumi refresh
, and then pulumi up
, it correctly recreates the instance, but it tries to run the command’s delete
operation (on the old instance, which no longer exists) before creating the new command on the new instance.little-cartoon-10569
07/12/2022, 10:31 PMpulumi refresh
removes resource from state.
• pulumi up
updates state and cloud from code.
In that sequence, Pulumi isn't deleting anything. If the Command is being deleted, maybe it's because you have a dependsOn that you don't want?
It does seem like you're stuck though: I don't think there is a way to have refresh
delete resources that have no cloud presence (Command).
You don't need to manually edit the state file though, you just need to run pulumi state delete urn
.dazzling-oxygen-84405
07/13/2022, 8:44 AMYou don’t need to manually edit the state file though, you just need to runYeah, this is what I meant - I was using.pulumi state delete urn
jq
to delete a bunch of commands at once, since pulumi state delete
doesn’t support wildcards afaik.
Why does it delete anything? I’d have thought it’d go something like this:
• Resource is deleted in cloud.
•removes resource from state.pulumi refresh
•Exactly -updates state and cloud from code.pulumi up
pulumi refresh
only removes the Instance, it doesn’t detect that the Command is also effectively removed by the instance not existing anymore. Then the pulumi up
sees that the connection
input to the Command has changed, so this triggers a replace
operation, which tries to run the delete
of the command on the previous instance, and the create
on the new instance. But the delete
part fails of course.No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by