many-apartment-92429
12/22/2021, 3:49 PMimport { LocalProgramArgs, LocalWorkspace } from "@pulumi/pulumi/automation";
import * as github from "@pulumi/github";
const repo2 = new github.Repository(
"mytest",
{
description: "mytest",
visibility: "internal",
},
);
console.log("Created repo2 repository");
bit if fails with:
yarn ts-node scripts/repos/simple_script.ts
yarn run v1.22.17
$ /home/seo_infra/node_modules/.bin/ts-node scripts/repos/simple_script.ts
/home/seo_infra/node_modules/@pulumi/pulumi/runtime/settings.js:123
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 (/home/seo_infra/node_modules/@pulumi/pulumi/runtime/settings.js:123:15)
at Object.getMonitor (/home/seo_infra/node_modules/@pulumi/pulumi/runtime/settings.js:216:13)
at Object.registerResource (/home/seo_infra/node_modules/@pulumi/pulumi/runtime/resource.js:213:32)
at new Resource (/home/seo_infra/node_modules/@pulumi/pulumi/resource.js:217:24)
at new CustomResource (/home/seo_infra/node_modules/@pulumi/pulumi/resource.js:309:9)
at new Repository (/home/seo_infra/node_modules/@pulumi/repository.ts:305:9)
at Object.<anonymous> (/home/seo_infra/scripts/repos/simple_script.ts:39:15)
at Module._compile (node:internal/modules/cjs/loader:1095:14)
at Module.m._compile (/home/seo_infra/node_modules/ts-node/src/index.ts:1310:23)
at Module._extensions..js (node:internal/modules/cjs/loader:1147:10)
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run> for documentation about this command.
Do you have any hints why it fails and how to make it working? Googling a good half of the internet did not help…
Adding a local stack with configuration also did not change anything:
const stack = await LocalWorkspace.createOrSelectStack(args, {
projectSettings: {
name: "infra",
runtime: "nodejs",
backend: {
url: `s3://${BUCKET_NAME}`,
},
},
secretsProvider,
stackSettings: {
[args.stackName]: {
secretsProvider,
},
},
});
The error is still the same. Thank you.stocky-restaurant-98004
12/22/2021, 5:42 PMpulumi up
, not as a regular node program.pulumi new ts
and then copy/paste your code minus the first line.billowy-army-68599
12/22/2021, 9:13 PMpulumi up
workflow, you'll need to use the automation API:
https://github.com/pulumi/automation-api-examples/tree/main/nodejs/inlineProgram-ts
This can be packaged as part of a yarn workflowmany-apartment-92429
12/23/2021, 1:42 PMstocky-restaurant-98004
12/24/2021, 3:22 PM