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

able-camera-57198

08/31/2022, 3:43 PM
If I am using GCP and have a resource that has a specific known tag, is there any way for me to look it up by that tag with Pulumi?
b

billowy-army-68599

08/31/2022, 3:44 PM
you can use a getter function, it’ll depend on if the getter function supports retrieving by tag. which is the resource?
a

able-camera-57198

08/31/2022, 3:45 PM
I have a GCP Task
Queue
I would like to look up, but I don't have its name.
I'd like to figure out a way to make it discoverable.
(without coupling two different stacks together)
b

billowy-army-68599

08/31/2022, 3:51 PM
there isn’t a data source with that unfortunately, certainly not with the tag as an argument 😞
you may need to use a stack reference
a

able-camera-57198

08/31/2022, 3:57 PM
Ergh, messy
Are there any examples of stack references for C# based deployments?
s

stocky-restaurant-98004

08/31/2022, 7:08 PM
This page doesn't have C# examples, but the TS to C# translation should be pretty straightforward: https://www.pulumi.com/learn/building-with-pulumi/stack-references/
The main thing to know is that it's
Pulumi.StackReference
and that the identifier for your
Queue
has to be an output of the stack you're referencing.