Using AWS ECS Fargate with Cloudfront and WAF
Introduction I have already presented the concepts of AWS ECS in my previous post, which you can review for more information. In this article, I will guide you on how to deploy a docker image with AWS ECS on Cloudfront using WAF, monitored by Cloudwatch. Additionally, we will setup alerts to automatically send emails and notifications to Telegram when a WAF rule is matched. Prerequisites You can continue using the NestJS source code that I guided you through in previous articles or use your own project. After pushing the docker image to ECR, please proceed to the following sections. Detail The workflow will be as follows: Requests are sent to Cloudfront. Here, the rules in WAF take effect to block requests with security issues, preventing them from reaching our Load Balancer. Cloudwatch will aggregate results based on metrics; if the required threshold is reached, it will send an email and a notification to Telegram for alerting. If the request has no issues, Cloudfront will attach a s...