https://pulumi.com logo
#general
Title
# general
h

handsome-xylophone-18806

10/18/2019, 11:29 AM
Terraform has input variables. That allows user inputs value when run commands. Is there similar solution for Pulumi?
s

stocky-island-3676

10/18/2019, 11:34 AM
h

handsome-xylophone-18806

10/18/2019, 11:48 AM
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

stocky-island-3676

10/18/2019, 12:26 PM
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

tall-librarian-49374

10/18/2019, 12:44 PM
@handsome-xylophone-18806 You can pass config values with the
--config stringArray
parameter
👍 1
h

handsome-xylophone-18806

10/19/2019, 6:43 AM
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

stocky-island-3676

10/21/2019, 11:00 AM
@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.