sst / ion

SST v3
https://sst.dev
MIT License
1.57k stars 199 forks source link

Support create VPC without NAT #815

Open AlexsandroBezerra opened 1 month ago

AlexsandroBezerra commented 1 month ago

I like using SST for my projects. However, for my personal projects, I don't need NAT in my VPC and I don't have the budget for it. I would like to create a VPC without adding any NAT gateways.

thdxr commented 1 month ago

yeah this is a big one, we need to rethink this. i think we might need to have nat: false option and deploy all your stuff into a public subnet with ipv4 assigned

thdxr commented 1 month ago

after exploring how we can do this here is what we ran into

if we let you create a VPC with no NAT - there basically is no way to put a lambda function in there unless the lambda function does not need internet access

so unfortunately the nat is necessary - that said you can set az: 1 so you only have a single NAT. if we incorporated https://fck-nat.dev/stable/ which is 10x+ cheaper would that be enough to fit in your budget?

thelegendtubaguy commented 1 month ago

In a similar situation, but with fargate. My fargate costs would be pretty low, but managed nat was going to be at least 2x my container cost.

fck-nat seems like an excellent alternative.

Is there a way for us to spin up our own VPC using Pulumi and having resources provision into that? Having the flexibility to do something like that would be nice, even if we have to "break out" of SST to accomplish it.

thdxr commented 3 weeks ago

we updated sst.aws.Vpc with the initial work for this. It no longer creates a NAT by default

we haven't done this yet but we're going to allow options for nat: true (fck-nat) and nat: "managed" normal aws nat