How do I compare `Output<string>` with `stri...
# general
How do I compare
? Here is the example
Copy code
const clusterName = xyz
                .apply(cluster => cluster.ClusterName) as Output<string>;
The code has to compare the
. I have tried with something like this and it failed.
Copy code
switch (clusterName) {
            case Output.create('alpha'):{
To first approximation - you have to do the switch inside the
. That is - the actual string value of the output is only known when the callback passed to apply is called - and so anything you want to do with that value must be done inside that callback. During previews, some Outputs will never be known (the resource hasn't been constructed yet), and during updates, these values may not be known until after the resource is actually created in the resource provider. In your sepcific cases - two things: 1. If you share a larger snippet of what you want to do, it may be more clear how your switch is getting used, and how it can be done inside an apply) 2. I think
is a
? If so, we recently added
which will get a normal
instead of `Output<string`>. This should generally make this specific case easier. This is possible because StackReference results really are always known (assuming the stack exists at all).