is it possible to perform any processing of `Input...
# typescript
b
is it possible to perform any processing of
Input<T>
values? I'm passing an
Input<aws.ecs.Secret[]>
to a module i'm writing and I want to do some processing on the various values of
valueFrom
within the
aws.ecs.Secret[]
so I can collate them into a list of secret ARNs to add to an IAM policy. i can see heaps of docs on using
Output<T>
via
apply()
etc but there doesn't seem to be any documentation (that I can find) about working with
Input<T>
l
Use
pulumi.output(yourInput).apply(value => {});
b
ah ok - thanks. is this the intended way to use
Input<T>
, if so, why does the
Input<T>
type exist couldn't everything just be
Output<T>
?
l
Input can be OutputInstance<T>, Promise<T> or T. It's broader
b
cool, makes sense - thanks for the explanation 👍
👍 1
l
It allows the Pulumi SDK to define parameters (especially inside the various args objects) as (for example)
Input<string>
. That way the string could come from another resource (Output<string>) or a constant (string).
💯 1