better-rainbow-14549
03/25/2019, 6:37 PMdnsZone: azure.dns.Zone | (azure.dns.GetZoneResult & azure.dns.GetZoneArgs) | { resourceGroupName: pulumi.Input<string>, name: pulumi.Input<string>, id: pulumi.Input<string> }
white-balloon-205
better-rainbow-14549
03/25/2019, 6:40 PMs = new azure.dnszone(); installX(s);
or s = azure.getZone(); installX(s);
white-balloon-205
azure.getZone
and new azure.dnszone()
will return related shapes - and as a general rule it's going to be hard to write code that fully works in that mode.
An alternative is to use azure.dnszone.get()
. This is available on any resource, and reads in an existing resource. The shape it returns is exactly an azure.dnszone
, so you won't have to convert or use union types. Will this work for your case?better-rainbow-14549
03/25/2019, 6:45 PMwhite-balloon-205
.get()
is a Pulumi concept that all resources have by default.
The .getZone
functions are projections of the Terraform "data sources" for Pulumi providers which are built on top of upstream Terraform providers. These are often slightly different, and can be useful in some cases to get indirectly associated properties of resources.better-rainbow-14549
03/25/2019, 6:47 PMwhite-balloon-205
getZone
can be useful. If that prevents it from working for your case then you may need to use the .getZone
.
If you do - I'd suggest creating your own interface that has the properties you need - each as a pulumi.Output<string>
, and then project the results of the two operations into that interface.