This message was deleted.
# general
s
This message was deleted.
p
never mind, stupid question, the CLI is not in typescript at all 😉
l
Yes there is! It's called the Automation API. We have it out for Go in preview right now: • https://pkg.go.dev/github.com/pulumi/pulumi/sdk/v2/go/x/auto • https://github.com/evanboyle/automation-api-examples Typescript support will be coming in the next few weeks. There's a WIP branch here: https://github.com/pulumi/pulumi/pull/5347
The meta-issue tracking all of this work: https://github.com/pulumi/pulumi/issues/3901 Feel free to come join us in the #C019YSXN04B channel
While this does still require a pulumi binary on your path, we designed it for the specific scenario you mention. You can just run
node index.js
and everything works as expected including debugging. Here's an example program that I wrote in typescript:
Copy code
import { LocalWorkspace, UpOptions } from "@pulumi/pulumi/x/automation";
import * as aws from "@pulumi/aws";

LocalWorkspace.UpsertStackInlineSource("pulumi/myBucket", "inlineNodeProject", async () => {
    const bucket = new aws.s3.Bucket("my-bucket");
    return { exp_static: "foo", abc: "def", bucketName: bucket.id };
}).then((stack) => {
    return stack.setConfig("aws:region", { value: "us-west-2" }).then(() => {
        const upOpts: UpOptions = { onOutput: (out) => { <http://console.info|console.info>(out.toString()) } };
        return stack.up(upOpts).then((res) => { console.log(res.outputs) })
    })
}).catch(err => console.log(err));