sparse-intern-71089
07/20/2022, 9:13 PMrich-cat-16319
07/21/2022, 2:06 AMgetOutput
returns an object of type Output
rich-cat-16319
07/21/2022, 2:07 AMgetOutputValue
instead or do pubsub.apply(value => { // your code that uses the value[0] here })
polite-napkin-90098
07/21/2022, 3:29 PMconst pubsub = stackMon.getOutput("publicSubnetIds");
const grafana = pulumi.all(pubsub).apply(([subnet1, subnet2])=> {
return new k8s.helm.v3.Release("grafana", {
...
values: {
...
ingress: {
...
annotations: {
...
'<http://alb.ingress.kubernetes.io/subnets|alb.ingress.kubernetes.io/subnets>': `${subnet1}, ${subnet2}`,
},
},
I've removed some static config lines to make it clearer.
Now pubsub is an Output<any> which contains and array of 2 strings, or will contain that at runtime when it's looked up.
and when I try and run this I get
index.ts(132,28): error TS2769: No overload matches this call.
The last overload gave the following error.
Argument of type 'Output<any>' is not assignable to parameter of type 'unknown[]'.
Type 'OutputInstance<any>' is missing the following properties from type 'unknown[]': length, pop, push, concat, and 29 more.
index.ts(132,44): error TS7031: Binding element 'subnet1' implicitly has an 'any' type.
index.ts(132,53): error TS7031: Binding element 'subnet2' implicitly has an 'any' type.
any ideas?polite-napkin-90098
07/21/2022, 4:51 PMconst publicSubnetIds = pubsub.apply(list => list.join(','));
polite-napkin-90098
07/21/2022, 4:51 PMpolite-napkin-90098
07/21/2022, 6:43 PMCalling [toString] on an [Output<T>] is not supported.
polite-napkin-90098
07/22/2022, 3:07 PMconst pubsub = stackMon.getOutput("publicSubnetIds");
...
const pubsubId = pubsub.apply((l: Array<string>) => {
return l.map(a => `${a}`).join(",");
});
const grafana = new k8s.helm.v3.Release("grafana", {
...
values: {
ingress: {
annotations: {
'<http://alb.ingress.kubernetes.io/subnets|alb.ingress.kubernetes.io/subnets>': pulumi.interpolate `${pubsubId}`,
Is what actually manages to get the annotation to work :D