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

full-dress-10026

09/22/2018, 1:00 AM
How would I pass a custom vpc to the
cloud.Service
ctor?
b

big-piano-35669

09/22/2018, 1:35 AM
You can do this with config at the moment. @white-balloon-205 might know other, better ways to do this, however if you configure the
externalVpcId
and related variables, the
cloud.Service
will join an existing VPC.
TL;DR,
pulumi config set cloud-aws:externalVpcId <my-vpc-id>
f

full-dress-10026

09/22/2018, 1:49 AM
I'd like to create the VPC in code though.
b

big-piano-35669

09/22/2018, 2:09 AM
Ah, got it. Let me take a look. IIRC there is a way to do this.
@lemon-spoon-91807 Do you know the answer here? How do I create my own
awsinfra.Network
, and plug it into the AWS cloud package so that it uses it rather than creating a new one?
👍 1
l

lemon-spoon-91807

09/22/2018, 2:26 AM
i can't see any way to do it currently 🙂
sorry!
w

white-balloon-205

09/22/2018, 2:29 AM
Yes - currently you probably will need to stand up the network in a separate stack and use config vars mentioned above. We definitely want to support simpler composition of the cloud library with networks/clusters/etc - along the lines of how we now support “first class providers”.
b

big-piano-35669

09/22/2018, 2:38 AM
Ah drats, that confirms my reading of the code too. Can we file an issue? I would love to see these things compose, as I'm sure @full-dress-10026 would too 🙂
❤️ 1
s

stocky-spoon-28903

09/22/2018, 2:53 AM
It would be nice if that composition was done via an interface defined by
cloud
rather than direct use of the
awsinfra
one, in order that other network designs can meet it
w

white-balloon-205

09/22/2018, 3:00 AM
b

big-piano-35669

09/22/2018, 3:01 AM
@stocky-spoon-28903 👍
w

white-balloon-205

09/22/2018, 3:02 AM
@stocky-spoon-28903 good point - that would fall out pretty naturally from a straightforward approach to what’s described in the issue above - but perhaps worth calling out explicitly in that issue as well.