I have my yaml files but in debug it would appear ...
# general
b
I have my yaml files but in debug it would appear they cannot be read?
m
cc @bitter-oil-46081
what is the output of
pulumi config get aws:region
?
b
us-east-1
can you not debug the code in vscode? for what it is worth I am using typescript
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
import * as awsInfra from "@pulumi/aws-infra";

async function main() {
    const regions: aws.Region[] = ['us-east-1'];
    const networkConfig = regions.map(async (r: aws.Region) => {
        const providerName = `${r}-provider`;
        const p = new aws.Provider(providerName, { region: r });
        console.log(p);
        //const azs = await aws.getAvailabilityZones(undefined, { provider: p });
    });
}

main();
nothing crazy just trying to follow this tutorial
m
yeah, that all looks pretty straightforward. what happens if you remove the calls to
new aws.Provider
?
b
its fine
m
and if you log
r
inside the callback, what is the output?
b
us-east-1
fwiw I tried copying yml to bin directory the TS build creates didnt make a diff
m
sorry if I missed this earlier, but is this code running inside the Pulumi CLI?
b
I dont think so based on my debug config being setup as follows:
Copy code
{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: <https://go.microsoft.com/fwlink/?linkid=830387>
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "program": "${file}",
            "preLaunchTask": "tsc: build - tsconfig.json",
            "outFiles": [
                "${workspaceFolder}/bin/**/*.js"
            ]
        }
    ]
}
m
ah, got it
b
I am suspicious that is the problem but i cant find advice on how to setup a debug def for pulumi
m
you'll need to run through the Pulumi CLI in order for most things to work
@white-balloon-205, any ideas?
b
you cant debug in vscode with pulumi? that is one of the appeal items of using code (full tooling)
I definitely think thats the trick how to attach to the pulumi cli from vscode debugger
w
https://github.com/pulumi/pulumi/issues/1372 is tracking being able to launch the Pulumi program such that it can be attached to. This will require passing a
--inspect
flag through to the
node
process.
b
so its not implemented then
/home/xxxx/.nvm/versions/node/v10.14.1/bin/node --inspect-brk=9985 bin/index.js --inspect
same issue UnhandledPromiseRejectionWarning: Error: Pulumi program not connected to the engine -- are you running with the
pulumi
CLI?
w
That's right - this capability is not available yet. It will be possible once https://github.com/pulumi/pulumi/issues/1372 is fixed. A Pulumi program is not by itself a valid
Node.js
program - it expects to be run inside a Node process setup by the Pulumi engine. That is why you get the error about being unabe to connect to the engine, asking whether you are running the
pulumi
CLI.