(I am hoping the answer to friel above might answe...
# general
h
(I am hoping the answer to friel above might answer this @white-balloon-205) To limit access, I’d like to have multiple stacks. One stack might provision resources like s3 buckets, and the other might mainly be “serverless” functions. In creating resources, I could usually expect that my resource would always be called
my-bucket
, but Pulumi assigns unique IDs to each resource, so it becomes
my-bucket<some_id>
. Am I right in assuming that if I want to access a second-stack resource, I either have to create some registry of resource names or manually pass them to the second stack?
g
you can export/output the bucket name from one stack and then "import" it using a StackReference in your downstream stack. https://pulumi.io/reference/organizing-stacks-projects.html#inter-stack-dependencies
this eliminates the need to manually pass values around. stacks and stackreferences are effectively your "registry".
h
woo! thanks! hadn’t found that reference, super helpful
👍 1
c
@helpful-ice-5738 you can also manually specify the name, which causes us to not append the random suffix. There are many downsides to this, though: you can’t create the same app twice (since you can’t multiply-instantiate the two resources of the same type with the same name), and if you need to replace it, we can’t spin up a new version of the resource (for the same reason).
👍 1
not sure if that makes sense
h
makes perfect sense @creamy-potato-29402