Skip to main content

Option on spacelift_run resource to continue even if target stack is disabled

The spacelift_run resource has an optional wait block that allows it to continue if the run is in a defined run state, and to continue if it did not reach any defined end state. I would like to configure the resource to also continue if a run cannot be triggered because the target stack is disabled.

Workaround
Problem
Status: ⬆️ Gathering votes2 comments

Log in to comment and vote

Comments2

  • Black Breeze

    •

    Jan 30

    Thanks for raising that @King Huang. Have you considered making this run resource conditional on the state of the stack? The spacelift_stack data source exposes an enabled attribute that can be used to determine if the run resource should be created or not.

    At least to me this sounds like an option worth exploring, more explicit and perhaps even more in line with the Terraform aesthetics.

    • Coffee Mug

      •

      Jan 30

      Yeah, that’s basically what I’m doing now (noted in the workaround). The only difference is that a run gets triggered when the stacks get re-enabled, because the spacelift_run resource is re-created anew, even though the keepers haven’t changed. It’s not a huge problem, though it does produce extra runs for me.