Skip to content

Implicitly delete commands on instance removal #104

Open
@kwohlfahrt

Description

@kwohlfahrt

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

I would like to be able to define a relationship between a remote.Command and another resource (e.g. an Instance), so that the Command is implicitly deleted when the instance disappears. My problem is this sequence of steps:

  1. Create an aws.ec2.Instance with Pulumi
  2. Create a Command, with create and delete options on this instance
  3. Delete the instance outside of Pulumi
  4. Run pulumi refresh (detects the instance as removed, but not the command)
  5. Run pulumi up

In the last step, pulumi correctly tries to create the instance, but tries to replace the command. This involves running the delete step on the old instance, which no longer exists, so it fails.

I would like to be able to tell Pulumi that if the instance disappears during pulumi refresh, any command run on that instance should be considered deleted. This shouldn't be the default, since a command might create aribitrary resources and it might be correct to fail if it can't be cleaned up from the original instance. However, right now I have to delete a lot of commands from my stack manually whenever an instance is removed outside of Pulumi.

For some additional discussion, see this slack conversation.

Affected area/feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions