Skip to content

Cloudfront theshold for outbound traffic

0

HI, Is there a way to limit outbound traffic from a CloudFront distribution with s3 as the origin? A way to set a threshold for outbound traffic from Cloudfront to users. In fact, all requests arriving at the edges could still be valid (no ddos ​​attack) but could increase the estimated costs of my CloudFront distribution. I don't want to use billing alerts or Cloudfront traffic alerts from Cloudwatch.. Is there a Cloudfront option to achieve this? Can it be useful to use lambda@edge to count outgoing traffic and block unwanted excess?

Thanks

1 Answer
1
Accepted Answer

Hello,

CloudFront itself can't limit outbound traffic, but here are two options there as follows:

1. WAF with Rate Limiting: Throttle requests based on users/locations using AWS WAF integrated with CloudFront.

2.Lambda@Edge with SQS: Track request counts and block excess using a Lambda@Edge function and SQS queue.

Consider costs and choose the approach that best suits your needs. Billing alerts and CloudWatch metrics are still recommended for monitoring usage.

EXPERT
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.