Closed giladno closed 5 years ago
When creating the AppRoute
's, I'll just have it cycle between the available NAT gateways. I don't really want to get more complicated than that.
I think that would work!
This is actually more complicated than I thought as we need to ensure each route references a NAT gateway. I might not be able to turn this around very quickly with the US holiday coming up.
Shouldn't it be something similar to this?
if (useNatGateway) {
params.NatGatewayId = `NatGateway${index % useNatGateway + 1}`;
} else {
params.GatewayId = 'InternetGateway';
}
Not really. Say you want to deploy in 5 AZ’s but only have 2 NGW’s. We need to create the NGW’s outside of the AZ creation loop and then make sure each AZ alternates between the two NGW’s.
@giladno my apologizes, you were correct. I created #5 to allow specifying the number of the number of NAT Gateways (and EIPs) to provision. Would you mind testing it out by updating your package.json
to be:
"serverless-vpc-plugin": "git://github.com/smoketurner/serverless-vpc-plugin.git#jp-gh4
to see if it works for you?
When using the
useNatGateway
option, it will create a gateways per zone (so when using 6 zones - it will create 6 gateways + 6 EIP).Sometimes, we need a limited number of EIP's.
Maybe
useNatGateway
should be either a boolean or a number, so when using a number it will limit the number of gateways: