sparse-intern-71089
07/15/2020, 2:01 PMrefined-car-55506
07/15/2020, 2:07 PMrefined-car-55506
07/15/2020, 2:07 PMrefined-car-55506
07/15/2020, 2:09 PMdazzling-sundown-39670
07/15/2020, 2:27 PMPulumi.yaml
one level up. Then inside Pulumi.yaml
add the following:
main: my-folder
config: my-folder
dazzling-sundown-39670
07/15/2020, 2:27 PMmy-folder
as a workspace as wellrefined-car-55506
07/15/2020, 2:36 PMimport * as aws from "@pulumi/aws";
inside my code. This is only true if you use Pulumi + TypeScript native support.
I am not using TypeScript, so I had to have a build step using babel.
Maybe having native babel support would be nice too!dazzling-sundown-39670
07/15/2020, 2:39 PMrefined-car-55506
07/15/2020, 2:41 PMrefined-car-55506
07/15/2020, 2:42 PMrefined-car-55506
07/15/2020, 2:42 PMrefined-car-55506
07/15/2020, 2:42 PMimport * as aws from "@pulumi/aws";
import slackSync from "./events/slack-sync";
const topic = new aws.sns.Topic("slack-sync-topic");
topic.onEvent("slack-sync", slackSync);
refined-car-55506
07/15/2020, 2:43 PMrefined-car-55506
07/15/2020, 2:43 PMrefined-car-55506
07/15/2020, 2:43 PMdazzling-sundown-39670
07/15/2020, 2:44 PMdazzling-sundown-39670
07/15/2020, 2:46 PMmy-project
├── Pulumi.yaml
├── package.json
├── yarn.lock
└── my-pulumi-folder
├── Pulumi.main.yaml
├── index.ts
├── package.json
└── tsconfig.json
refined-car-55506
07/15/2020, 2:56 PMdazzling-sundown-39670
07/15/2020, 3:02 PMgentle-diamond-70147
07/15/2020, 3:38 PMrequire
instead of import
.
So
import * as aws from "@pulumi/aws";
becomes
const aws = require("@pulumi/aws");
gentle-diamond-70147
07/15/2020, 3:38 PMrefined-car-55506
07/15/2020, 8:45 PMrefined-car-55506
07/15/2020, 8:46 PMrefined-car-55506
07/15/2020, 8:46 PM