https://pulumi.com logo
#general
Title
# general
s

some-motherboard-44061

08/30/2023, 3:56 AM
Hi there, I’m using pulumi to deploy some aws resources. And I need to get the arn of one resource and then inform it as an input in the other one. How can I do it?
e

echoing-dinner-19531

08/30/2023, 8:38 AM
Every resource will have an ID output, but I think you have to manually construct the ARN from that ID. Honestly this feels like a good suggestion to make to https://github.com/pulumi/pulumi-aws-native/issues to output these for ease of use.
s

some-motherboard-44061

08/30/2023, 10:56 AM
I really appreciate your answer. So, in this case, how should I proceed? Do you have an example?
I got to do it here. As a example I did: self.arn = bucket.arn.apply(lambda arn: arn) However, when I try to use it, it says I can’t convert output to string. Do you know how to handle it?
e

echoing-dinner-19531

08/31/2023, 8:35 AM
apply will always return an Output type, but something like
bucket.id.apply(lambda id: "arn:aws:s3:us-east-2:12345:bucket:" + id)
The region and account id obv need changing to match what your using.
s

some-motherboard-44061

08/31/2023, 8:40 AM
Yep
It worked out here
I’m now in another object
Thanks for your help