cold-coat-35200
11/14/2018, 1:41 PMpulumi up
and pulumi destroy
works fine, but pulumi up --refresh
diesPreviewing update (dev):
Type Name Plan Info
~ pulumi:pulumi:Stack dliver-dev refresh 7 messages
~ └─ pulumi-nodejs:dynamic:Resource testdns refresh 1 error
Diagnostics:
pulumi:pulumi:Stack (dliver-dev):
Error: Unexpected struct type.: Error: Unexpected struct type.
at Function.proto.google.protobuf.Value.fromJavaScript (/home/ncsibra/dev/prmrgt-infra/pulumi/dliver/node_modules/google-protobuf/google/protobuf/struct_pb.js:804:13)
at Function.proto.google.protobuf.Struct.fromJavaScript (/home/ncsibra/dev/prmrgt-infra/pulumi/dliver/node_modules/google-protobuf/google/protobuf/struct_pb.js:870:51)
at Object.<anonymous> (/home/ncsibra/dev/prmrgt-infra/pulumi/dliver/node_modules/@pulumi/pulumi/cmd/dynamic-provider/index.js:179:55)
at Generator.next (<anonymous>)
at fulfilled (/home/ncsibra/dev/prmrgt-infra/pulumi/dliver/node_modules/@pulumi/pulumi/cmd/dynamic-provider/index.js:17:58)
at process.internalTickCallback (internal/process/next_tick.js:77:7)
pulumi-nodejs:dynamic:Resource (testdns):
error: Preview failed: Unexpected struct type.
error: an error occurred while advancing the preview
read
function, it works, but of course not updates the resourcereturn {
id: `dns:${zoneID}:${res.result.id}`,
outs: inputs
}
to this:
return {
id: `dns:${zoneID}:${res.result.id}`,
outs: record
}
I got the same "Unexpected struct type" errorwhite-balloon-205
microscopic-florist-22719
outs
or props
is a function. However, the data you're returning in record
doesn't seem like it contains any function values. What do you see if you console.log(JSON.stringify(record))
?cold-coat-35200
11/14/2018, 8:04 PM{
"type": "CNAME",
"name": "test",
"content": "<http://test.com|test.com>",
"ttl": 1,
"proxied": true
}
nothing special, just the expected, it does not contains a functionmicroscopic-florist-22719
record
has a key priority
with the value undefined
. That might also cause this.console.log(JSON.stringify(Object.keys(record)))
?cold-coat-35200
11/14/2018, 9:17 PM["type","name","content","ttl","priority","proxied"]
it doesmicroscopic-florist-22719
const outs = Object.keys(record).filter(k => record[k] !== undefined).reduce((acc, k) => ({ ...acc, [k]: record[k] }), {});
Read
.cold-coat-35200
11/15/2018, 7:29 AMmicroscopic-florist-22719