brave-angle-33257
04/02/2020, 5:54 PMvar bucket_name = <pulumi.Output<string>>s3.getOutput(`bucket_backup`);
var instance = new aws.ec2.Instance('instance', {
...
userData: `
#! /bin/bash
# create template for deployment
cat > vpnbackup.sed <<SED
s|--BUCKET-NAME--|${bucket_name.apply(v=>v)}|
...
"Calling [toString] on an [Output<T>] is not supported.\n\nTo get the value of an Output<T> as an Output<string> consider either\n1 o.apply(v => prefix${v}suffix
)\n2: pulumi.interpolate `prefix${v}suffix`\n\nSee https://pulumi.io/help/outputs for more details."cool-egg-852
04/02/2020, 5:59 PM.apply
there, do
pulumi.interpolate`…`
brave-angle-33257
04/02/2020, 6:01 PMcool-egg-852
04/02/2020, 6:02 PMuserData: pulumi.interpolate`...`
brave-angle-33257
04/02/2020, 6:03 PMcool-egg-852
04/02/2020, 6:04 PMbrave-angle-33257
04/02/2020, 6:04 PMcool-egg-852
04/02/2020, 6:05 PM.apply
will return an Output
, but then the whole value of userData
is not a Output<>
type. By interpolating the entire thing, you tell Pulumi to parse the entire value, then return it as an Output
brave-angle-33257
04/02/2020, 6:06 PMcool-egg-852
04/02/2020, 6:07 PM