https://pulumi.com logo
Title
p

powerful-jelly-35580

07/30/2021, 10:22 AM
Hello All, I am trying to use automation API and I was wondering: is there a way to pass arguments to the program? We have this function and I was wondering what to do if my
program
expects some arguments from the user?
auto.create_or_select_stack(
            stack_name=self.config.environment,
            project_name=self.deployment_name,
            program=self.program,
            opts=self.workspace_opts)
p

powerful-jelly-35580

07/30/2021, 10:42 AM
Thanks Piers! So there is no way to actually provide them to a method directly? We would like to adapt it for a workflow in which we just pass a path to python file with the function + provide arguments to Pulumi automation api, rather then preconfigure the program before with a wrapper and return it fully configured
b

brave-planet-10645

07/30/2021, 11:08 AM
When you say function, do you mean the function containing the pulumi program? Or function as in lambda/azure function?
p

powerful-jelly-35580

07/30/2021, 12:02 PM
Function containing pulumi program. Ideally I would like to pass these arguments somewhere in for example
opts
arg
r

red-match-15116

07/30/2021, 4:15 PM
The example piers linked to is the correct form. Can you tell me why that form doesn’t meet your needs? You are still able to pass arguments to the Pulumi program.