https://pulumi.com logo
#general
Title
# general
b

bulky-policeman-29913

12/03/2018, 7:58 PM
I have my yaml files but in debug it would appear they cannot be read?
m

microscopic-florist-22719

12/03/2018, 7:59 PM
cc @bitter-oil-46081
what is the output of
pulumi config get aws:region
?
b

bulky-policeman-29913

12/03/2018, 7:59 PM
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

microscopic-florist-22719

12/03/2018, 8:02 PM
yeah, that all looks pretty straightforward. what happens if you remove the calls to
new aws.Provider
?
b

bulky-policeman-29913

12/03/2018, 8:03 PM
its fine
m

microscopic-florist-22719

12/03/2018, 8:03 PM
and if you log
r
inside the callback, what is the output?
b

bulky-policeman-29913

12/03/2018, 8:04 PM
us-east-1
fwiw I tried copying yml to bin directory the TS build creates didnt make a diff
m

microscopic-florist-22719

12/03/2018, 8:06 PM
sorry if I missed this earlier, but is this code running inside the Pulumi CLI?
b

bulky-policeman-29913

12/03/2018, 8:06 PM
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

microscopic-florist-22719

12/03/2018, 8:06 PM
ah, got it
b

bulky-policeman-29913

12/03/2018, 8:06 PM
I am suspicious that is the problem but i cant find advice on how to setup a debug def for pulumi
m

microscopic-florist-22719

12/03/2018, 8:06 PM
you'll need to run through the Pulumi CLI in order for most things to work
@white-balloon-205, any ideas?
b

bulky-policeman-29913

12/03/2018, 8:07 PM
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

white-balloon-205

12/03/2018, 8:44 PM
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

bulky-policeman-29913

12/03/2018, 8:45 PM
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

white-balloon-205

12/03/2018, 11:23 PM
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.
2 Views