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

rough-quill-24608

12/09/2021, 1:14 PM
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

prehistoric-activity-61023

12/09/2021, 1:22 PM
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

rough-quill-24608

12/09/2021, 1:29 PM
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

prehistoric-activity-61023

12/09/2021, 1:33 PM
you’re gonna adjust quickly - trust me 😉
r

rough-quill-24608

12/09/2021, 1:38 PM
i am already loving it, configuration, secret handling and applying conditional logic is much easier
w

witty-candle-66007

12/09/2021, 2:25 PM
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