Hi guys, I want to create multiple GCE VMs using P...
# python
Hi guys, I want to create multiple GCE VMs using Pulumi. I can run the for loop to create multiple VMs but how do i export all the created VM's information. so basically "how do i export multiple VM's information after they are created ?" At the moment, pulumi is showing the information for last VM.
You can create an array, and then inside the loop add an item to the array for each VM. Then you can export that array. I recently did a workshop that covered this exact thing (well, in AWS :-)) - see: • labs: https://github.com/pulumi/infrastructure-as-code-workshop/tree/master/labs/aws/python/lab-02 • video:


(this particular part at ~1:02)
cool. Thanks for that
One more thing, i was testing gcp-py-network-componet code available on github repo and i am getting the following error
error: Configuration 'gcp-py-network-component:subnet_cidr_blocks' value '' is not a valid 'JSON object'
i do have config value set
KEY                 VALUE
Do you know, what am i missing ?
@faint-table-42725 thanks mate but i am still not able figure out. Can you please give some example value ?
So something like
pulumi config set subnet_cidr_blocks[0]
and it should be a range, so i’m guessing you’ll want that to be more like
pulumi config set gcp-py-network-component:subnet_cidr_blocks[0]
pulumi up is giving up this error now
`error: Missing required configuration variable 'gcp-py-network-component:subnet_cidr_blocks'`please set a value using the command
pulumi config set gcp-py-network-component:subnet_cidr_blocks <value>
you’ll need --path like in the doc
👍 1
you can also just edit the .yaml yourself if that’s easier
at the end of the day, it just needs to be yaml sequence
ah… --path did the trick
thank you so much for the help
this command worked fine
pulumi config set --path gcp-py-network-component:subnet_cidr_blocks[0]