Terraform has input variables. That allows user in...
# general
h
Terraform has input variables. That allows user inputs value when run commands. Is there similar solution for Pulumi?
s
h
Config in pulumi is not really the same as terraform input variables. In Terraform, I can pass value for a variable from command line without set the value in code:
terraform apply -var="image_id=ami-abc123"
. And if a variable is not yet set, terraform asks for input value interactively in console (see https://learn.hashicorp.com/terraform/getting-started/variables.html#ui-input). That's a powerful feature.
s
I see. What’s the use-case for it? Normally you declare all parameters in code, at best. If it’s a secret, then you’ll use a
pulumi.Config()
with type secret.
t
@handsome-xylophone-18806 You can pass config values with the
--config stringArray
parameter
👍 1
h
The behavior of --config stringArray is to save value to Pulumi.<stack>.yaml file. It mean only the shortcut to pulumi config set command. That is not so useful in case you want ad-hoc value. The value in Pulumi.<stack>.yaml should be considered as default value. The value if provided in command line should be used at runtime and shouldn't be saved to the yaml file.
s
@handsome-xylophone-18806 I think it would help the Pulumi developers when you explain your use-case/the purpose/why you need ad-hoc values.