hallowed-ice-8403
06/23/2021, 7:54 AMdef pulumi_program():
create_pulumi_program(content)
stack = auto.select_stack(stack_name=stack_name, project_name=project_name,program=pulumi_program)
billowy-army-68599
06/23/2021, 8:11 AMhallowed-ice-8403
06/23/2021, 8:22 AMauto.create_stack(stack_name=stack_name,
project_name=project_name,
program=pulumi_program)
so in turn we create a pass function that returns the actual function that creates required resources.
def pulumi_program():
return create_pulumi_s3(content)
is there a workaround for this if i need to call multiple functions ?billowy-army-68599
06/23/2021, 8:44 AMcreate_stack
call (I think) but you can pass arguments to that function
there's lots of examples of different mechanisms of passing in the pulumi program here:
https://github.com/pulumi/automation-api-examples/tree/main/pythonhallowed-ice-8403
06/23/2021, 12:01 PMauto.create_stack(stack_name=stack_name,
project_name=project_name,
program=create_pulumi_s3(content))
def pulumi_program():
create_pulumi_s3(content)
create_s3(name)
return
auto.create_stack(stack_name=stack_name,
project_name=project_name,
program=pulumi_program)
billowy-army-68599
06/23/2021, 12:30 PMpulumi_program(content)
wouldn't just work if defined correctlyred-match-15116
06/23/2021, 2:54 PMreturn
in the function.
def pulumi_program():
create_pulumi_s3(content)
create_s3(name)
auto.create_stack(stack_name=stack_name,
project_name=project_name,
program=pulumi_program)
The first is not valid because the pulumi_program
function itself does not accept any arguments, so it needs to be a wrapper around any functions that do take arguments.hallowed-ice-8403
06/23/2021, 2:55 PM