Thread
#getting-started
    c

    curved-eye-56312

    1 week ago
    Hi all! I have a small question regarding Config()class. In my
    Pulumi.<stack_name>.yaml
    file I want to declare the following object:
    <stack_name>:blobContainers:
        1:
            name: container_name1
            accessLevel: Container
        2:
            name: container_name2
            accessLevel: Blob
        3:
            name: container_name3
            accessLevel: Container
    I understand that to retrieve this object from my configuration file I need to use the following (using Typescript):
    const containers = config.requireObject("blobContainers");
    However, when I try to iterate over my object and access
    name
    for example, I am not able to due to the object's type. What is the correct way to iterate over this object?
    l

    little-cartoon-10569

    1 week ago
    Do you want blobContainers to be an object with 3 properties? Or an array with 3 items? I think the problem here is just your YAML.
    This may be what you want:
    <stack_name>:blobContainers:
    - name: container_name1
      accessLevel: Container
    - name: container_name2
      accessLevel: Blob
    - name: container_name3
      accessLevel: Container