https://aws.amazon.com/fargate/pricing
- per vCPU per hour: $0.04856
- per GB per hour: $0.00532
Cost:
($0.04856 * 0.25 + $0.00532 * 0.5) * 730 = $10.80
https://aws.amazon.com/elasticloadbalancing/pricing
- $0.0252 per Application Load Balancer-hour
- $0.008 per LCU-hour
Cost:
($0.0252 + $0.008 * 0.015) * 730 = $18.48
https://aws.amazon.com/ecr/pricing
- Storage: $0.10 per GB
- Data Transfer OUT: $0.114 per GB
Cost:
$0.10 + $0.114 = $0.21
https://aws.amazon.com/privatelink/pricing
- Pricing per VPC endpoint per AZ ($/hour): $0.013
- Pricing per GB of Data Processed: $0.01
Cost:
($0.013 * 2 * 3) * 730 + $0.01 = $56.95
$10.80 + $18.48 + $0.21 + $56.95 = $86.44 per month
The 2 VPC endpoints cost much. In this case the usage is very low. It can be a waste to keep them all the time.
An option is pulling the Docker image from public network. Then the VPC endpoints are not needed anymore. However it may have security risk.
Please notice this cost won't increse too much when the project becomes larger. So I just keep them for now.
Should be very close to ECS. Requires more manual maintenance.
- Lambda: First 1M requests/month are free
- API Gateway: $3.50 per 1M requests
The total cost should be less than $4 per month. Should be the best solution for this case. However I didn't do this because:
- Web servers are easier to implement certain features compared to Lambda functions.
create a simple web server
- To showcase infrastructure knowledge.
Lambda, Elastic Beanstalk and Kubernetes are quick to set up, but may not show off as much skill as other techniques