https://pulumi.com logo
Title
w

witty-barista-69390

08/30/2022, 1:26 PM
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

billowy-army-68599

08/30/2022, 2:32 PM
When you say doesn’t work with preview, what do you mean?
w

witty-barista-69390

08/30/2022, 2:42 PM
When I use the code I sent earlier with interpolate I get this
"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

billowy-army-68599

08/30/2022, 2:51 PM
Ah yes, you’ll need to use an apply. pulumi.interpolate only works for simple strings
w

witty-barista-69390

08/30/2022, 2:52 PM
so replace with: this.bucket.bucket.apply( v => v.bucket)?
b

billowy-army-68599

08/30/2022, 2:53 PM
Yep, I can send an example in a few mins
w

witty-barista-69390

08/30/2022, 2:53 PM
great thanks!
b

billowy-army-68599

08/30/2022, 3:19 PM
@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

witty-barista-69390

08/30/2022, 3:26 PM
got it let me give that a whirl