sparse-intern-71089
07/02/2020, 5:51 PMbored-river-53178
07/02/2020, 5:52 PMPreviewing update (dev):
Type Name Plan Info
pulumi:pulumi:Stack infra-dev 1 error; 26 messages
Diagnostics:
pulumi:pulumi:Stack (infra-dev):
Error: Error serializing '() => provider': index.js(19,37)
'() => provider': index.js(19,37): captured
variable 'provider' which indirectly referenced
function 'create': index.ts(66,10): which captured
variable 'crypto' which indirectly referenced
function 'randomBytes': random.js(51,20): which referenced
function 'assertSize': random.js(35,19): which referenced
function 'validateNumber': which captured
'ERR_INVALID_ARG_TYPE', a function defined at
function 'NodeError': which referenced
function 'getMessage': which captured
variable 'messages' which indirectly referenced
function 'get': which could not be serialized because
it was a native code function.
Function code:
function get() { [native code] }
at throwSerializationError (/home/az/learn/pulumi/infra/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:458:11)
at /home/az/learn/pulumi/infra/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:211:21
at Generator.next (<anonymous>)
at /home/az/learn/pulumi/infra/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:21:71
at new Promise (<anonymous>)
at __awaiter (/home/az/learn/pulumi/infra/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:17:12)
at serializeWorkerAsync (/home/az/learn/pulumi/infra/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:199:20)
at /home/az/learn/pulumi/infra/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:177:30
at Generator.next (<anonymous>)
at fulfilled (/home/az/learn/pulumi/infra/node_modules/@pulumi/pulumi/runtime/closure/createClosure.js:18:58)
error: Error serializing '() => provider': index.js(19,37)
'() => provider': index.js(19,37): captured
variable 'provider' which indirectly referenced
function 'create': index.ts(66,10): which captured
variable 'crypto' which indirectly referenced
function 'randomBytes': random.js(51,20): which referenced
function 'assertSize': random.js(35,19): which referenced
function 'validateNumber': which captured
'ERR_INVALID_ARG_TYPE', a function defined at
function 'NodeError': which referenced
function 'getMessage': which captured
variable 'messages' which indirectly referenced
function 'get': which could not be serialized because
it was a native code function.
Function code:
function get() { [native code] }
billowy-army-68599
bored-river-53178
07/02/2020, 5:59 PMbored-river-53178
07/02/2020, 5:59 PMimport * as pulumi from '@pulumi/pulumi'
import * as crypto from 'crypto'
const randomprovider: pulumi.dynamic.ResourceProvider = {
async create(inputs) {
return { id: crypto.randomBytes(16).toString('hex'), outs: {} }
},
}
export class Random extends pulumi.dynamic.Resource {
constructor(name: string, opts?: pulumi.CustomResourceOptions) {
super(randomprovider, name, {}, opts)
}
}
const r = new Random('name')
bored-river-53178
07/02/2020, 6:00 PM