This message was deleted.
# general
s
This message was deleted.
l
If you're just getting data from the VPC object, then you can use
getVpc()
. You won't get a Vpc object.
If you want to manage the Vpc in Pulumi (equivalent to a
resource
in Terraform, then you must import the VPC.
And half-way between those options is
Vpc.get()
, which is similar to
getVpc
but uses the normal Pulumi classes. It's read-only though, so similar to a
data
.
I would suggest not trying to simulate anything Terraform-y. You will need a new mental model, as Terraform and Pulumi require fairly different ways of thinking.
f
Thanks for the info. I need to simply use existing VPCs that Pulumi will not manage
I’m not really trying to simulate anything in Terraform, I said “simulate” just to convey the goal: get a reference to a resource and use it, without Pulumi controlling or creating that resource.
It’s very clear to me that Pulumi’s lifecycle is a different way of thinking about things than normal code… but it is in fact close to how Terraform does things (though that may not be apparent to some from looking at .hcl code which almost looks procedural).
l
Ok. Well then you can use
Vpc.get()
or
getVpc()
, either is good and they have very different APIs and returned objects.