aws-samples / aws-refarch-wordpress

This reference architecture provides best practices and a set of YAML CloudFormation templates for deploying WordPress on AWS.
MIT No Attribution
1.08k stars 601 forks source link

use a single nat gateway for all subnets #20

Open federicopuntoni opened 6 years ago

federicopuntoni commented 6 years ago

Hi,

given the high costs of the nat gateway, is it possible to use one through all 3 NATRouteTables?

RGuilfoyle commented 6 years ago

It would be possible to run NAT Gateways in a single AZ, but this would not align with our best practices. If you only use the NAT gateway for OS, WP updates and installing plugins then a single-AZ solution might be fine and you could consider manually or automatically deploying the NAT gateway in another AZ in the event of a failure. If the WordPress site, plugins or code relies on having outbound internet access then you might need something highly available.

For smaller sites or deployments it may be cost effective to use a NAT instance with some scripting to manage either a HA pair of instances in 2 AZs or an auto scaling group with min=1, max=1 and a takeover script that updates route tables as an instances starts.

This might give you a good starting point; https://aws.amazon.com/articles/high-availability-for-amazon-vpc-nat-instances-using-aws-cloudformation-templates/