e

    enough-potato-36582

    2 weeks ago
    hey folks 👋 I'm trying to use Pulumi plans, but is there a way to verify a plan can be applied? During my tests, if I apply an "old" plan (someone modified the stack after I generated the plan), it fails to apply. I would like to verify it can be applied before running the
    pulumi up
    v

    victorious-church-57397

    2 weeks ago
    you can add
    -r
    to your
    pulumi up
    or
    pulumi preview
    commands to trigger a state refresh before running
    e

    enough-potato-36582

    2 weeks ago
    interesting. This will check if the plan is ok to apply?
    will try
    v

    victorious-church-57397

    2 weeks ago
    no, it refreshes the state so that if someones changed it when youre working on it it will pick up the changes
    e

    enough-potato-36582

    2 weeks ago
    ok... that doesn't help with the issue I described with the plan though
    v

    victorious-church-57397

    2 weeks ago
    During my tests, if I apply an "old" plan (someone modified the stack after I generated the plan), it fails to apply.
    does it not?
    sorry i think i misunderstood the question, when you say verify the plan can be applied, doesn't
    pulumi preview
    do this? and
    pulumi preview
    by default is ran during a
    pulumi up
    e

    enough-potato-36582

    2 weeks ago
    I´m using the "plan" feature using the automation API. I generate a plan using the preview. It's a json file that then I pass to the Up command and it applies exactly what is defined in that json file
    the problem is the Up doesn't check if the plan is compatible with the state of the Stack at that point
    and the Up may fail to apply the whole changeset, but it's not an atomic operation, the Up may partially apply the plan
    v

    victorious-church-57397

    2 weeks ago
    ah ok, sorry wasnt aware you were using automation api - is there no way you can run a preview against that plan again? like a second check on it
    ive not used the automation api im afraid so not much help now 😂
    e

    enough-potato-36582

    2 weeks ago
    hehe no worries. The only way to make it a reliable process is for the Up command to verify it can be applied after locking the Stack, otherwise there's always a window of opportunity for another Up process to start between a preview and an up