Hello folks, at this stage I am feeling that using...
# aws
l
Hello folks, at this stage I am feeling that using
getPolicyDocument()
is almost not recommended. All the properties on it take literal
string
and not
Input<string>
so if I want to interpolate other resource ARNs that I have created into the policy document, I would need to
apply()
and
all
all these resources? Am I getting this right? What's the reason it is designed to take
string
instead of
Input<string>
for its properties?
b
Here is an issue tracking making those types of functions easier to use with `Input<T>`: https://github.com/pulumi/pulumi/issues/5758 In the meantime, yes, you will need to
apply
and/or
all
to project your async values into the function.
👍 1
l
For the policy document case, there is a Pulumi-native alternative in the aws.iam.PolicyDocuemnt class. Most resources that have a policy property have type
pulumi.Input<string> | aws.iam.PolicyDocument
.
b
I don’t think that is present in all SDKs, unless it’s new. I may be mistaken though. C# particularly obviously can’t do the built in type union but they might be using their Union generic. But if you have an Output<PolicyDocument> because you needed output to build the document than you’d still use the Input<string> I believe
l
Awesome, thanks