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

boundless-artist-3489

04/02/2021, 1:54 PM
Hello everyone, I am a beginner in Pulumi and I am testing https://github.com/pulumi/examples/tree/master/gcp-py-network-component I have configured everything well, except that when I do my pulumi up it gives me this : error: Configuration 'gcp-py-network-component:subnet_cidr_blocks' value '172.2.0.0/16' is not a valid 'JSON object' error: an unhandled error occurred: Program exited with non-zero exit code: 1 Do you know the exact syntax to declare a cidr in the pulumi config file? I typed this command : pulumi config set gcp-py-network-component:subnet_cidr_blocks '172.2.0.0/16' And here is the return in my Pulumi.dev.yaml file :
Copy code
config:
gcp-py-network-component:subnet_cidr_blocks: '172.2.0.0/16'
Would you have an idea ? Thanks in advance for your answer
p

prehistoric-coat-10166

04/02/2021, 2:06 PM
I think the problem is that https://github.com/pulumi/examples/blob/master/gcp-py-network-component/config.py#L14 uses
config.require_object
which expects some sort of serializable structure. Based on its usage in https://github.com/pulumi/examples/blob/master/gcp-py-network-component/network.py#L30 it looks like it expects an array perhaps? Maybe calling
pulumi config set --path gcp-py-network-component:subnet_cidr_blocks[0] '172.2.0.0/16'
would work?
b

boundless-artist-3489

04/02/2021, 3:01 PM
Helllo @prehistoric-coat-10166, thanks for the answer I'll check it and come back to you to tell you what's up :) thanks a lot already for the answer 🙂
I try your command (pulumi config set --path gcp-py-network-component:subnet_cidr_blocks[0] '172.2.0.0/16') and magic it's work ! Thank you so much 🙂
👍 1
63 Views