Hi, Can I store objects in pulumi config? For example, I want to do something like:
config:
repos:
name:
visibility
as I am provisioning github repos.
l
little-cartoon-10569
06/08/2024, 7:59 PM
Yes. In this case, you would load repos as an object, and it would contain the various properties. The sections "Strongly Typed Configuration" and "Structured Configuration" have examples: https://www.pulumi.com/docs/concepts/config/
w
witty-vegetable-61961
06/08/2024, 9:28 PM
yeah i saw this but I want to do the c# equivalent of a strongly typed list. where my list items will contain repo name, visibility, etc.
l
little-cartoon-10569
06/08/2024, 9:31 PM
I don't know how it works in C#: in typescript, the object that comes back from
requireObject
can be cast to an interface and it works. Maybe someone in #CQ2QFLNFL has a more specific answer?
w
witty-vegetable-61961
06/08/2024, 9:51 PM
I guess this is the way:
repossname: sss
repossvisibility: ssss
reposssname: sss
reposssvisibility: ssss
I'd be keen to know if I can refactor this.
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.