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

straight-caravan-63576

08/30/2022, 4:04 PM
Hi! How to get resource auto-name from URN? Is that possible.
f

full-artist-27215

08/30/2022, 4:12 PM
Can you elaborate a bit on what you're trying to do? I'm not quite understanding what you're looking for.
👍 1
☝️ 1
s

straight-caravan-63576

08/30/2022, 5:02 PM
sure, I exported the URN of
aws:lb:ApplicationLoadBalancer
from one project-1. From project-2, used
StackReference
to re-use the existing resource (created via project-1) to add metrics using
aws.cloudwatch.MetricAlarm
f

full-artist-27215

08/30/2022, 5:59 PM
Are you referring to a Pulumi URN, or an AWS ARN?
Pulumi URNs won't be useful to you if you're trying to create additional AWS resources that depend on AWS resources from another stack (or even within a stack, for that matter).
👍 1
But in general, using stack references to create additional resources like this is a standard pattern in Pulumi.
s

straight-caravan-63576

08/31/2022, 9:45 AM
thanks @full-artist-27215 for the details. Yes, I'm using Pulumi URN, will change it then.
👍 1
f

full-artist-27215

08/31/2022, 2:03 PM
@straight-caravan-63576 Good luck! Feel free to share some code if you'd like some feedback on your approach.
👍 1