Hi, i am trying to figure out how to handle resour...
# general
r
Hi, i am trying to figure out how to handle resources not created with pulumi, e.g. i wan't to create some Azure virtual machines in a virtual network and virtual subnet that are already there (managed by another pulumi project). I don't want to import them into my project and i dont want to manage them using my project, just accessing some informations about them (e.g. id, etc.) Is that possible? i am searching for the pulumi equivalent of terraforms
data
stuff. Maybe someone can shed some light how to solve it? Thanks a lot!
p
take a look at part called “Look up an Existing Instance Resource” in the API docs
+ check available functions in each module e.g. https://www.pulumi.com/registry/packages/gcp/api-docs/compute/#functions
r
ah yes... thanks man! i found it... lookup is done by using the specific functions in the modules, for my Azure network it is
network.get_virtual_network
. I wasnt aware of that
still thinking too much terraform and less programming
p
you’re gonna adjust quickly - trust me 😉
r
i am already loving it, configuration, secret handling and applying conditional logic is much easier
w
Also, in case it helps, if those other resources are managed by Pulumi then stack references can be used to get information about those resources from the other stack(s) https://www.pulumi.com/docs/intro/concepts/stack/#stackreferences