curved-eye-56312
09/14/2022, 10:58 AMPulumi.<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?abundant-telephone-90024
09/14/2022, 11:32 AMconst containers = config.requireObject<MyBlobContainersInterface>("blobContainers");
curved-eye-56312
09/14/2022, 12:04 PMconfig
.
I ended up making the object simpler by doing so:
<stack_name>:blobContainers:
- name: container1
accessLevel: Container
- name: container2
accessLevel: Blob
And then used the following
containers: { [key: string] } [] = config.requireObject("blobContainers");