Hi, consider the following `Pulumi.<stack>.y...
# general
e
Hi, consider the following
Pulumi.<stack>.yaml
file:
Copy code
config:
  config:one:
    key: val
  config:two:
    key: val
In order to read this config I have to:
Copy code
config = pulumi.Config(name="config")
config_one = config.require_object("one")
config_two = config.require_object("two")
Is there away to
for
loop`config`over each object? Thanks
l
@echoing-postman-88590 do you mean without knowing the keys
one
and
two
upfront?
e
Yes
A sort of dynamic
config
l
I do it a bit differently. My config looks like:
Copy code
config:
  <projectname>:somekey:
  - role: admin
    username: user1
  - role: admin
    username: user2
Then
somekey
is a collection over which I can iterate. I'm using Typescript, so I do
config.requireObject<MyInterface[]>('somekey')
to retrieve the list of entries with a single call.
👍 1
e
Yes, you are right just move one level deeper