nutritious-church-27230
06/09/2021, 4:56 PMbillowy-army-68599
06/09/2021, 4:58 PMnutritious-church-27230
06/09/2021, 5:01 PMimport * as pulumi from "@pulumi/pulumi";
import * as linode from "@pulumi/linode";
const fs = require("fs");
const path = require("path");
let pubKey: string = fs.readFileSync(path.join(__dirname,'id_rsa.pub')).toString();
let pubKeys: string[] = pubKey.split("");
const masterInstance = new linode.Instance("nanode-master", {
group: "masters",
type: "g6-nanode-1",
region: "ap-south",
image: "linode/alpine3.13",
authorizedKeys: pubKeys,
rootPass: "rootPass123!",
tags: ["master node"],
watchdogEnabled: true
});
billowy-army-68599
06/09/2021, 5:12 PMlet pubKeys: string[] = pubKey.split("");
const masterInstance = new linode.Instance("nanode-master", {
group: "masters",
type: "g6-nanode-1",
region: "ap-south",
image: "linode/alpine3.13",
authorizedKeys: [ pubKey ],
rootPass: "rootPass123!",
tags: ["master node"],
watchdogEnabled: true
});
nutritious-church-27230
06/09/2021, 5:16 PMbillowy-army-68599
06/09/2021, 5:16 PMlet pubKey: string = fs.readFileSync(path.join(__dirname,'id_rsa.pub')).toString();
is returningnutritious-church-27230
06/09/2021, 5:19 PMbillowy-army-68599
06/09/2021, 5:19 PMtoString()
adding a newline on the end?nutritious-church-27230
06/09/2021, 5:23 PMbillowy-army-68599
06/09/2021, 5:26 PMnutritious-church-27230
06/09/2021, 5:27 PMbillowy-army-68599
06/09/2021, 5:32 PMnutritious-church-27230
06/09/2021, 5:45 PMlet pubKey: string = fs.readFileSync(path.join(__dirname,'/../secret/id_rsa.pub')).toString();
this line works in express, console.log(pubKey) prints the public key in console. the same line in pulumi gives this error "Error: ENOENT: no such file or directory, open '/secret/id_rsa.pub'"