brave-angle-33257
08/21/2019, 10:56 PMsubnet_zone_letters:string[] = ['a', 'b', 'c', 'd'];
I want to make sure the other stack uses the same values, so I pass them as an output:
export let vpc_subnet_zone_letters = vpc.subnet_zone_letters;
that shows up in my outputs like:
vpc_subnet_zone_letters: [
[0]: "a"
[1]: "b"
[2]: "c"
[3]: "d"
]
Finally, in another stack I want to load them and use them as part of a string input to another stack, and so far for the life of me I can’t get it to work:
var vpc_subnet_zone_letters = vpc.getOutput('vpc_subnet_zone_letters');
...
availabilityZones: [
`us-east-2${vpc_subnet_zone_letters.apply(x=>`${x[0]}`)}`,
`us-east-2${vpc_subnet_zone_letters.apply(x=>`${x[1]}`)}`,
],
~ availabilityZones : [
~ [0]: "us-east-2a" => "us-east-2Calling [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.\nThis function may throw in a future version of @pulumi/pulumi."
~ [1]: "us-east-2b" => "us-east-2Calling [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.\nThis function may throw in a future version of @pulumi/pulumi."
]
availabilityZones: vpc_subnet_zone_letters.apply( x => [
`${region}${x[0]}`,
`${region}${x[1]}`
]),
best-xylophone-83824
08/22/2019, 9:41 AMpulumi.interpolate`us-east-2${vpc_subnet_zone_letters[0]}`
brave-angle-33257
08/22/2019, 3:44 PMinterpolate
commands, but it fails:availabilityZones: [
`us-east-2${pulumi.interpolate `vpc_subnet_zone_letters[0]`}`,
`us-east-2${pulumi.interpolate `vpc_subnet_zone_letters[1]`}`
],
availabilityZones : [
[0]: "us-east-2Calling [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.\nThis function may throw in a future version of @pulumi/pulumi."
best-xylophone-83824
08/22/2019, 3:46 PMpulumi.interpolate`us-east-2${vpc_subnet_zone_letters[0]}