Hi team, I’m migrating from Terraform to Pulumi an...
# general
e
Hi team, I’m migrating from Terraform to Pulumi and am new to Pulumi. In Terraform, we have an ECS module that accepts the image tag as an input. During deployment, CI pushes a new image and runs something like:
terraform apply -var="image_tag=<new-tag>"
The image tag is therefore a deployment-time input rather than persistent environment configuration. I’m trying to understand the idiomatic Pulumi equivalent. I know I can use stack configuration but
pulumi up --config imageTag=...
persists the value to the stack config, whereas I’d prefer not to persist something that changes on every deployment. I could use an environment variable, but I’d prefer a more explicit input mechanism where a missing value produces a clear validation error. Is there an idiomatic way in Pulumi to pass ephemeral/runtime inputs to
pulumi up
, similar to
terraform apply -var
, without persisting them as stack configuration?
a
In my project, I use stack config. I use a placeholder value for the specific config, if the config always needs a runtime value.
Copy code
pulumi config set key=value
pulumi up
The point is that, when other engineers read the stack yaml, they know the stack requires that config, just as you mentioned. Your code can have the config validation, too.
s
You should use stack configuration for this, or ESC if you are a Pulumi Cloud customer. You'll want to use the
config.requireX()
methods to make the values required in your program.