How would I pass a custom vpc to the `cloud.Servic...
# general
f
How would I pass a custom vpc to the
cloud.Service
ctor?
b
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
I'd like to create the VPC in code though.
b
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
i can't see any way to do it currently 🙂
sorry!
w
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
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
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
b
@stocky-spoon-28903 👍
w
@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.