Is there a way to convert an `Output<T>` to ...
# typescript
b
Is there a way to convert an
Output<T>
to a string?
t
No, not really.
Output
may only resolve after the deployment is done. You usually want to use
apply
to manipulate the value.
b
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
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"
}),