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

breezy-butcher-78604

08/14/2020, 5:01 AM
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

little-cartoon-10569

08/14/2020, 5:12 AM
Use
pulumi.output(yourInput).apply(value => {});
b

breezy-butcher-78604

08/14/2020, 5:20 AM
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

little-cartoon-10569

08/14/2020, 5:31 AM
Input can be OutputInstance<T>, Promise<T> or T. It's broader
b

breezy-butcher-78604

08/14/2020, 5:34 AM
cool, makes sense - thanks for the explanation 👍
👍 1
l

little-cartoon-10569

08/14/2020, 5:36 AM
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