https://pulumi.com logo
#typescript
Title
# typescript
b

billions-scientist-31826

03/09/2020, 8:00 PM
Is there a way to convert an
Output<T>
to a string?
t

tall-librarian-49374

03/09/2020, 8:03 PM
No, not really.
Output
may only resolve after the deployment is done. You usually want to use
apply
to manipulate the value.
b

billions-scientist-31826

03/09/2020, 8:06 PM
I am trying to get an eks cluster name and then set a tag for a nodegroup's ASG tags.
Copy code
const caClusterName = "<http://k8s.io/cluster-autoscaler/|k8s.io/cluster-autoscaler/>" + clusterObj.eksCluster.name.apply(n => n);
...
autoScalingGroupTags: {
        "<http://k8s.io/cluster-autoscaler/enabled|k8s.io/cluster-autoscaler/enabled>": "true",
        [ caClusterName ] : "true"
},``
ok, so I just need find another way to set it, then.
b

boundless-airport-99052

03/10/2020, 8:34 AM
You can try something like that:
Copy code
autoScalingGroupTags: clusterObj.eksCluster.name.apply(clusterName => ({
        "<http://k8s.io/cluster-autoscaler/enabled|k8s.io/cluster-autoscaler/enabled>": "true",
        [ "<http://k8s.io/cluster-autoscaler/|k8s.io/cluster-autoscaler/>" + clusterName ] : "true"
}),