best-xylophone-83824
08/14/2019, 3:59 PMpulumi.output(new gcp.compute.Subnetwork("z", {ipCidrRange: "111", network: "zzz"})).name;
Error on `tsc --noEmit`:
Property 'name' does not exist on type 'OutputInstance<Subnetwork>'.
16 pulumi.output(new gcp.compute.Subnetwork("z", {ipCidrRange: "111", network: "zzz"})).name;
gcp.compute.Subnetwork
, but just Subnetwork
const neteng = new pulumi.StackReference(
"org/gcp-neteng/prod"
).requireOutput("gke01London") as pulumi.Output<gcp.compute.Subnetwork>;
...
neteng.name;
and it fails. interestingly this change makes it work:
).requireOutput("gke01London") as pulumi.Output<Pick<gcp.compute.Subnetwork,'name'>>;
white-balloon-205
Resource
instances. You typically need to output an id from one stack, and then .get
that id
in the other stack.best-xylophone-83824
08/15/2019, 9:20 AMas unknown as gcp.compute.Subnetwork;
works, but I agree that exporting just ID might be betterpulumi.Output<Resource>
leaves it with OutputInstance<Resource>
without & Lifted<T>
part, that is because of https://github.com/pulumi/pulumi/blob/8fd05fcd9fbd1480c01726b4fc7fcf158e611f99/sdk/nodejs/output.ts#L685 which skips recursing into object properties with LiftedObject
. pulumi.Output<Pick<Resource, 'id'>> works because that extends Resource<T>
becomes false and it recurses