developmentseed / remote-workstation

A Dockerised work environment hosted on AWS Fargate which can be SSH'd into ☁️🌎📦
MIT License
24 stars 2 forks source link

Add a Gateway VPC endpoint for S3 #5

Open wildintellect opened 3 years ago

wildintellect commented 3 years ago

NatGateway has a pretty hefty fee for data transfer. To avoid those costs, S3 can use a custom route through a Gateway VPC Endpoint.

Best practice when sending traffic to Amazon S3 or DynamoDB in the same Region To avoid data processing charges for NAT gateways when accessing Amazon S3 and DynamoDB that are in the same Region, set up a gateway endpoint and route the traffic through the gateway endpoint instead of the NAT gateway. There are no charges for using a gateway endpoint. For more information, see Gateway VPC endpoints. 1

Main docs for gateway endpoints Note in this case S3 does need to be same region as the ECS/Fargate instance to use. Otherwise we still have the NatGateway costs and the Cross Region costs.

CDK has a construct GatewayVPCEndpoint

wildintellect commented 3 years ago

Might be mitigated for now by switching to a public IP without NatGateway and VPC. This is a TODO for cases where the instance needs to run on a non-public VPC.