aws-samples / amazon-cloudfront-secure-static-site

Create a secure static website with CloudFront for your registered domain.
Apache License 2.0
385 stars 140 forks source link

Limiting resources #27

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello,

I'm using this stack to deploy two static website that have barely any traffic to them. I'm using the 1 year free tier. I'm planning on posting articles to popular link aggregators and I fearful of getting slashdotted and having to pay a lot for dynamic resource allocation and breached quotas. If not for slashdotting more for a continued DoS. What services in this stack should I put a hard limit to prevent this?

thomasturrell commented 3 years ago

Personally I think this is a question for AWS support or Stack Overflow.

However I'm happy to give you my opinion.

This solution uses S3, CloudFront and lambda. From a performance perspective, you do not need to worry about scaling a static site that uses CloudFront and S3. From a cost perspective, bandwidth will cost you around $0.085 per 10TB. Bandwidth is the only variable cost that you need to be concerned about since you can calculate all your other costs (such as S3 storage).

CloudFront doesn't have hard limits that you set so there is nothing about this solution that you could modified to achieve what you want. However if you are concerned about shock bills you can create a budget for your AWS account. Budgets are hard limits that will not be exceeded.

However the short answer is you probably don't worry about it. If your income from your sites is proportional to the number of visitors then a large bandwidth bill simply means that you made a lot of money that month!

Ref: https://aws.amazon.com/cloudfront/pricing/ https://aws.amazon.com/s3/pricing/ https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/budgets-create.html

ghost commented 3 years ago

Thank you very much for taking the time to explain this.

andymadge commented 3 years ago

From a cost perspective, bandwidth will cost you around $0.085 per 10TB.

Just for the avoidance of confusion, it's around $0.085 per GB for the first 10TB, as per https://aws.amazon.com/cloudfront/pricing/#On-demand_Pricing

So 10TB would in fact cost $0.085 x 1024 x 10 = $870.40