Hello team I found `pulumi new` has a `--config st...
# getting-started
f
Hello team I found
pulumi new
has a
--config stringArray
option. But it seems not say what
stringArrary
should look like. I try
--config aws:region:us-east-1
but it complains a error: (my terminal is PowerShell)
Copy code
error: could not parse aws:region:us-east-1 as a configuration key (configuration keys should be of the form `<namespace>:<name>`)
so what it should look like?
"aws:region:us-east-1"
or
aws:region us-east-1
(will complain too much args) seems both not the correct answer. Thanks~
b
hi @fancy-bird-54024! can you share a little bit more about what you are trying to do?
f
@brainy-church-78120 Sure. I want to create new project with
pulumi new aws-java --name xxx --stack dev --description xxxx --config someconfigurationhere
. If I omit
--config
part, the Pulumi will ask me to input with
aws:region: The AWS region to deploy into: (us-east-1)
message. SO I guess maybe I can manual add this required field in advance within the
pulumi new
command line. And maybe
--config
option, could help me directly to fill this field as
--config aws:region:ap-east-1
or whatever format. But when I input
pulumi new -h
to search the format, the helper info show
-c, --config stringArray        Config to save
in the Flags. I try
"aws:region:ap-east-1"
and
aws:region ap-east-1
but it seems not correct format, SO I wonder how it
stringArray
should look like in PowerShell , and whether I could use this option to skip that interactive input procedure.(I am not a native English speaker, sorry for my Grammar. Hope I can express my thoughts 😂)
b
so ur goal is to not have to provide values in the interactive prompts? i also tried a whole bunch of ways to get this to work and couldn't figure it out. I've asked for some help internally, should be able to get back to you with a better answer tomorrow.
b
if I do
Copy code
pulumi new typescript --config="foo=bar"
i end up with
Copy code
cat Pulumi.dev.yaml
config:
  project:foo: bar
If I do:
Copy code
pulumi new aws-typescript --config="aws:region=us-west-2"
i end up with
Copy code
config:
  aws:region: us-west-2
final example:
Copy code
pulumi new aws-typescript --config="aws:region=us-west-2" --config="foo=bar"
Copy code
cat Pulumi.dev.yaml
config:
  aws:region: us-west-2
  project:foo: bar
b
ah so the equal sign is the correct syntax, thank you!
f
Yeah, equal sign with multiple config block. That's what I wanted, Thank you very much~~👍