This message was deleted.
# general
s
This message was deleted.
l
Does using a
pulumi.RunError
work better?
l
¯\_(ツ)_/¯
lol. I’ll try it.
Looks like it still kills the outputs:
Copy code
Diagnostics:
  pulumi:pulumi:Stack (auth-service-auth-service.development):
    error: Image version is not present!

Outputs:
  - dbConnectionString     : "[secret]"
  - debugDBConnectionString: "[secret]"
That’s when I
throw new pulumi.RunError()
just doing a
new pulumi.RunError()
shows that things are succeeding and doesn’t exit the
up
l
To clarify your requirements: you want to run all the code, including all the export statements that create your outputs, but you want to prevent any changes to your resources or state?
If that is the case, then you don't want to apply the up. You would want to preview then not run up, or run up and choose n.
Perhaps the thing to do is to invoke your Pulumi code from automation-api, and do those sorts of don't-even-start checks outside the call to up.
l
It’s part of our CI process so we run
pulumi up --refresh --skip-preview --non-interactive --yes
. The
IMAGE_VERSION
comes from a k8s Deployment so we set that in the ENV. If it isn’t present the
up
should fail but didn’t want to outputs to be deleted. I guess I should rethink the architecture of this. Probably better to check in the script that runs the
up
for the variable and put the control flow there instead of in the Pulumi code. Haven’t played around with the automation-api yet but that’s definitely on the list of things to do during our tooling upgrades.
👍 1