https://pulumi.com logo
#automation-api
Title
# automation-api
b

billowy-horse-79629

08/22/2023, 7:09 AM
Hey all, I have a project built with Pulumi Automation API. I want to do a very simple thing - passing variables to the pulumi function itself. In the example here - https://github.com/pulumi/automation-api-examples/blob/main/nodejs/pulumiOverHttp-ts/index.ts#L16 You can see that
createPulumiProgram
gets
content: string
as a parameter, and then, in line 72 you call this pulumi program with the
content
variable. Unfortunately when I try to to this, the following error is shown (in the screenshot). Any idea what’s the right way to do so ?
c

clean-zoo-67541

08/22/2023, 9:24 AM
I don't know if that's the only solution, but for CNAPPgoat what we do is propogate arguments through the context parameter as config values, works like a charm
so inside the Pulumi program you'd have something like
Copy code
ctx.GetConfig("aws:region")
and in the wrapper calling it
Copy code
if err := s.SetConfig(ctx, "aws:region", auto.ConfigValue{Value: options.AWSRegion}); err != nil {
b

billowy-horse-79629

08/22/2023, 10:15 AM
I’ll try this, thanks @clean-zoo-67541
2 Views