https://pulumi.com logo
#dotnet
Title
# dotnet
l

late-salesmen-25375

12/02/2020, 9:38 PM
Hello! Junior’ish developer here and just getting started with Pulumi. I have some questions and was hoping some of you all might have some insight/real world experience with Pulumi in regards to Outputs. I saw a post above @fresh-summer-65887 but my .NET fu is not so strong yet. Mix that with the newness of Pulumi and it’s a mixture for me making a hot mess out of something. I am toying around in Digital Ocean to practice and learn Ansible by spinning up some machines to run playbooks against. I am able to spin up Droplets and I was able to get the Output working from an example when building only 1 machine but I was hoping to have
pulumi up
output the IPv4 and the name of each server for the output which didn’t work when spinning up more than just the one. I thought maybe I could create an Output class sort of like a Model and use that to build my output for the resource types I was building but that sort of didn’t work or . Maybe that is just unnecessary complexity but I thought it might make the project a little cleaner or have the output models in a separate project that could be reused across other projects and I just add a reference to that project. Maybe a NuGet type thing to import that would give you access to all the output information so you didn’t have to rewrite that code again? Any examples of something like this or is this just going about it the wrong way? Or any examples of how others are doing it. I have a very small use case for what I am doing here but could see this being useful in larger build outs of infrastructure in the future. Again I am not a seasoned developer so sorry if someone of this sounds like WTH is this guy talking about. Thanks for any insight.
t

tall-librarian-49374

12/02/2020, 10:04 PM
Hi Marco and welcome! You could return an output of type
Output<ImmutableDictionary<string, string>>
with keys=names and values=IPs. Does that sound about right?
l

late-salesmen-25375

12/02/2020, 10:17 PM
I believe so. I am working on getting this going now and will let you know.