brave-window-69382
02/09/2020, 5:05 PMnew aws.alb.loadbalancer
I'm trying to use an output in a userdata script:
const test = "test"
const dnsName = lb.dnsName
const userData =
``#!/bin/bash`
echo Test string: ${test}
`echo ${dnsName}``
console.log(userData)
The diagnostic log produces:
#!/bin/bash
echo Test string: test
echo Calling [toString] on an [Output<T>] is not supported.
To get the value of an Output<T> as an Output<string> consider either:
`1: o.apply(v => prefix${v}suffix
)`
`2: pulumi.interpolate `prefix${v}suffix``
See <https://pulumi.io/help/outputs> for more details.
This function may throw in a future version of @pulumi/pulumi.
I've been through the output documentation in the URL in addition to combing this Slack workspace but I can't seem to find a solution here. How can I use the dnsName output from the lb resource as a pure string?white-balloon-205
02/09/2020, 5:41 PMuserData = pulumi.interpolate
...``
2. userData.apply(d => console.log(d))
The key is that because one of your inputs is an “output”, your user data will also need to be an “output”.brave-window-69382
02/09/2020, 6:25 PM