https://pulumi.com logo
Title
g

gorgeous-country-43026

05/06/2021, 5:54 AM
Hi, I'm wondering if there is a way to set configuration values (secrets especially) from code using Pulumi's APIs? I know I can always invoke a shell command but that seems silly if there is a programmatic access to this somewhere. The use case in this regard would be to ask for initial users to be created into a system. Passwords are the important part here. Sure one can just generate those and print those out but in this case it would be useful to be able to type the preferred passwords in. Why I'm thinking using configuration mechanism with this is because this would allow checking if those have already been set or not when executing the code for the first time. If they are in remote state then this would apply over all use cases no matter the developer - meaning initial users don't get created several times.
One of the things making Pulumi interesting from my point of view is the fact that it allows such customizations since it is just code
r

red-match-15116

05/06/2021, 5:57 AM
g

gorgeous-country-43026

05/06/2021, 5:57 AM
Cheers! Will look over that one
OK, I see... This is actually very interesting stuff and it would allow me to do exactly what I wanted. The thing is, if I go this route then I need to make my whole setup by using Automation API and users cannot use
pulumi up
anymore. Which is totally fine in my opinion and the correct way to go now that I think of it but I won't have time to redo all of this that way right now
l

little-cartoon-10569

05/06/2021, 7:45 AM
Not quite. Automation-api can run "ordinary" Pulumi programs from their own directories. You can even mix inline Pulumi and external Pulumi programs within the same automation-api file / module.
1
And if you are using Pulumi's new Packages (the 3rd type, Component Packages) you can mix and match all sorts of Pulumi code in all sorts of different ways.
r

red-match-15116

05/06/2021, 2:35 PM
@gorgeous-country-43026 specifically look at the local program example for how to run a traditional cli-driven program with pulumi up. But dunno how this would cooperate with your desire to set config using automation api
g

gorgeous-country-43026

05/06/2021, 3:39 PM
Cheers for the info 👍
😛artypus-8bit: 1