I am trying to build an iam statement with pulumi....
# general
w
I am trying to build an iam statement with pulumi.interpolate. It does not work with preview, I am wondering is this the best way to go about doing this? ``````
b
When you say doesn’t work with preview, what do you mean?
w
When I use the code I sent earlier with interpolate I get this
Copy code
"Resource":["arn:aws:s3:::Calling [toString] on an [Output<T>] is not supported.\n\nTo get the value of an Output<T> as an Output<string> consider either:\n1: o.apply(v => `prefix${v}suffix`)\n2: pulumi.interpolate `prefix${v}suffix`\n\nSee <https://pulumi.io/help/outputs> for more details.\nThis function may throw in a future version of @pulumi/pulumi.","arn:aws:s3:::Calling [toString] on an [Output<T>] is not supported.\n\nTo get the value of an Output<T> as an Output<string> consider either:\n1: o.apply(v => `prefix${v}suffix`)\n2: pulumi.interpolate `prefix${v}suffix`\n\nSee <https://pulumi.io/help/outputs>
b
Ah yes, you’ll need to use an apply. pulumi.interpolate only works for simple strings
w
so replace with: this.bucket.bucket.apply( v => v.bucket)?
b
Yep, I can send an example in a few mins
w
great thanks!
b
@witty-barista-69390 you’re passing two outputs, so you’ll need
pulumi.all
like this https://github.com/jaxxstorm/pulumi-examples/blob/main/typescript/aws/s3-cloudfront/index.ts#L26-L46
w
got it let me give that a whirl