I've created a docker image, with Pulumi and node,...
# general
w
I've created a docker image, with Pulumi and node, and am trying out the remote editing features of Visual Studio Code. Excuse the stupid question, but is there a way to "step debug" the code, starting from
index.ts
and following along?
w
There is not yet first class support for it - though it’s something we’d love to enable and we’re tracking at https://github.com/pulumi/pulumi/issues/1372. It should technically be possible to attach to the NodeJS process that is running the Pulumi program already today, but discovering that process isn’t super straightforward today.
w
`.vscode/launch.json`:
Copy code
{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "outFiles": [
        "${workspaceFolder}/quickstart/bin/**/*.js"
      ],
      "preLaunchTask": "tsc: build - quickstart/tsconfig.json",
      "program": "${workspaceFolder}/quickstart/index.ts"
    }
  ]
}
`.vscode/tasks.json`:
Copy code
{
  "version": "2.0.0",
  "tasks": [
    {
      "type": "typescript",
      "tsconfig": "quickstart/tsconfig.json",
      "problemMatcher": [
        "$tsc"
      ],
      "group": "build"
    }
  ]
}
FWIW, with the above config it fails to run with the following:
Copy code
/workspaces/devops/quickstart/node_modules/@pulumi/pulumi/runtime/settings.js:70
        throw new Error("Program run without the Pulumi engine available; re-run using the `pulumi` CLI");
              ^
Error: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
    at requireTestModeEnabled (/workspaces/devops/quickstart/node_modules/@pulumi/pulumi/runtime/settings.js:70:15)
    at Object.getMonitor (/workspaces/devops/quickstart/node_modules/@pulumi/pulumi/runtime/settings.js:151:13)
    at Object.registerResource (/workspaces/devops/quickstart/node_modules/@pulumi/pulumi/runtime/resource.js:108:32)
    at new Resource (/workspaces/devops/quickstart/node_modules/@pulumi/pulumi/resource.js:174:24)
    at new CustomResource (/workspaces/devops/quickstart/node_modules/@pulumi/pulumi/resource.js:265:9)
    at new Bucket (/workspaces/devops/quickstart/node_modules/@pulumi/s3/bucket.ts:394:9)
    at Object.<anonymous> (/workspaces/devops/quickstart/index.ts:6:16)
    at Module._compile (internal/modules/cjs/loader.js:775:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
So I guess I currently must launch via
pulumi
and not
node
. I'll watch the GH issue for progress. Thanks!