https://pulumi.com logo
#package-authoring
Title
# package-authoring
n

narrow-match-14013

02/14/2023, 6:25 PM
Hey wondering if this has anything to do with how the bridge works. I've got an issue where if i have multiple levels of
pulumi.interpolate
pulumi throws an error:
error: Preview failed: objectEncoder failed on property "url": Expected a string, got: {&{{<http://vm-4liajfa3.staging.azure.tetrate.com/}}}>
If i wrap the whole thing in an apply it works though. For example:
Copy code
pulumi.output(args.endpoint).apply(
                    (endpoint) =>
                        new checkmate.HttpHealth(
                            `${this.pulumiName}-check-endpoint`,
                            {
                                timeout: 1000 * 60 * 10, // 10 min, to allow for DNS to propagate (2 x TTL)
                                interval: 1000 * 2, // 2s
                                consecutiveSuccesses: 100,
                                url: endpoint,
                            },
                            { dependsOn: this.resources },
                        ).id,
                )
Any ideas?
It seems to happen anywhere theres more than one item being interpolated.
I'm on tf framework version v1.1.1, and pf bridge version
<http://github.com/pulumi/pulumi-terraform-bridge/pkg/tfpfbridge|github.com/pulumi/pulumi-terraform-bridge/pkg/tfpfbridge> v0.0.0-20230120143314-6ffb2faf051e
e

enough-garden-22763

02/14/2023, 8:03 PM
Yes this doesn't seem right, looks like a bug in the bridge. Mind helping me figure out how to repro? What's the type of "args.endpoint" in TypeScript?
n

narrow-match-14013

02/14/2023, 8:08 PM
so
args.endpoint
is a
pulumi.Input<string>
but its constructed from an interpolate that takes >1 item:
Copy code
endpoint: pulumi.interpolate`vm-${vmPrefix}.${standaloneCluster.dnsDomain}
those two are
pulumi.Output<string>
and
pulumi.Input<string>
respectively
if i do an apply(console.log) i get a normal looking string back.
e

enough-garden-22763

02/14/2023, 8:09 PM
Got it, I'll try to repro, possibly something with first-class output support on the wire.
n

narrow-match-14013

02/14/2023, 8:13 PM
should i pull in a later version of the bridge and rebuild? just so we have parity
e

enough-garden-22763

02/14/2023, 8:13 PM
Sure that may be worth it if it's easy
pf/v0.2.1 is the latest-greatest tag
n

narrow-match-14013

02/14/2023, 8:13 PM
yeah for sure. ok i'll do that and see if anything changes
Hey Anton, confirmed issue still exists in pf/v0.2.1
e

enough-garden-22763

02/15/2023, 4:58 AM
Ack. Will have a look.
7 Views