Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple subnet IDs #38

Open
fermanjj opened this issue Sep 12, 2024 · 2 comments
Open

Support for multiple subnet IDs #38

fermanjj opened this issue Sep 12, 2024 · 2 comments

Comments

@fermanjj
Copy link

fermanjj commented Sep 12, 2024

Currently it appears the module supports only a single subnet ID. This means if you're using spot instances in an ASG, you can get denied provisioning an instance due to limited capacity in that specific Availability zone you've allocated the subnet to.

The exact error for more context:

We currently do not have sufficient t4g.nano capacity in the Availability Zone you requested (us-east-1a). Our system will be working on provisioning additional capacity. You can currently get t4g.nano capacity by not specifying an Availability Zone in your request or choosing us-east-1b, us-east-1c, us-east-1d, us-east-1f. Launching EC2 instance failed.

I don't see a good way to address this at the moment since the whole thing relies on a single network interface/subnet.

@RaJiska
Copy link
Owner

RaJiska commented Sep 21, 2024

Just as for AWS' NAT Gateway service, this module only spans across one availability zone. You might want to use multiple instance types within your ASG to mitigate the issue of instance shortage when using spot instances

@callumthomson
Copy link

@RaJiska

Just as for AWS' NAT Gateway service, this module only spans across one availability zone.

I would agree, but this is a problem unique to spot instances, which does not apply to NAT gateways and I think this module can solve it easily.

While launching an EC2 instance requires a subnet, In HA mode specifically, the ASG can and should be created to include multiple subnets. I had this error today on my fck-nat instance that was already running and was interupted:

Launching a new EC2 instance. Status Reason: We currently do not have sufficient t4g.nano capacity in the Availability Zone you requested (eu-west-2a). Our system will be working on provisioning additional capacity. You can currently get t4g.nano capacity by not specifying an Availability Zone in your request or choosing eu-west-2b, eu-west-2c. Launching EC2 instance failed.

Because of the way this module creates the ASG, it was not able to replace the instance in another subnet.

You might want to use multiple instance types within your ASG to mitigate the issue of instance shortage when using spot instances

It doesn't seem like there is an option to specify more than 1 instance type for the ASG in this module. The only other option that I can think of would be to create multiple instances of this module with a different instance type/subnet id, therefore creating multiple NAT instances. This means higher cost.

I think multiple subnets should be an option when using an ASG (HA mode). If you want to limit to a single subnet, then you should also have that option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants