horsfieldsa / wordpress-fargate

Example project that deploys Wordpress to ECS Fargate, Aurora MySQL and S3.
18 stars 11 forks source link

Include Warning about Potential Cost of NAT Gateway #4

Open mattbucci opened 6 years ago

mattbucci commented 6 years ago

I'd recommend including a warning regarding the high costs of using the Built in NAT Gateway. I managed to rack up about $7 in server costs within 24 hours which isn't a big deal for me, but might be for others, Especially for hobby use and especially if they don't notice it quickly.

This issue is solved by disabling the NAT gateway, creating an EC2 NAT instance(I used amzn-ami-vpc-nat-hvm-2016.03.0.x86_64-ebs) in the same subnet as your ECS/EC2 instances, the updating your routing tables in your VPC to point to this new instance.

Today is my first day using AWS so I'm still not sure if it's possible to put this into the mu.yml as I did it manually, but this seems to be the officially supported solution. https://forums.aws.amazon.com/thread.jspa?threadID=234959

Documentation for this process can be found here: https://hackernoon.com/dealing-with-an-aws-billing-surprise-beware-the-defaults-d8a95f6635a2 https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html

screen shot 2018-08-26 at 2 55 09 pm

mattbucci commented 6 years ago

It seems like the best way to get around this is to provide documentation on using the VPC wizard to provision your own VPC and then configuring Mu to deploy into this existing VPC using the vpcTarget config option