This message was deleted.
# typescript
s
This message was deleted.
r
I believe
getOutput
returns an object of type
Output
You could either try using
getOutputValue
instead or do
pubsub.apply(value => { // your code that uses the value[0] here })
p
Copy code
const 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
Copy code
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?
const publicSubnetIds = pubsub.apply(list => list.join(','));
is what it took in the end.
Ah no, that gives me
Calling [toString] on an [Output<T>] is not supported.
Ok for the sake of anyone who ends up looking for the answer here:
Copy code
const 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