Is there a way to use the automation API in conjun...
# automation-api
b
Is there a way to use the automation API in conjunction with an inline program and pass inputs into the program? I know it can be done with config, but I'm finding that really quite slow to initialise. This is pretty much what I'm working with for the inline program:
Copy code
public class MyStack : Stack
{
    [Input(nameof(MyInput)]
    public string MyInput {get; set;}

    public MyStack()
    {
        // use MyInput when declaring a resource
    }
}
All C# if it wasn't clear. Is this possible, or am I stuck to using config by calling
SetConfigAsync
?
Just to expand on this, I'm initialising the stack and attempting to use https://github.com/pulumi/pulumi-dotnet/blob/3106dc276c61b8c6a58c4813a4634bfb364d6577/sdk/Pulumi.Automation/LocalWorkspaceOptions.cs#L66C41-L66C41 as it sort of looks like what I need, But no luck 😞
l
An inline program is just a function. You can curry other values into the function, or reference values from different scopes. Here's a typescript examples: https://github.com/pulumi/automation-api-examples/blob/main/nodejs/pulumiOverHttp-ts/index.ts#L16 I don't think we have an equivalent example in C# but I believe it should be possible