Search code examples
amazon-cloudfrontaws-cdk

When to use AWS CloudfrontWebDistribution and when to use AWS Cloudfront Distribution


I see in aws-cdk there are two constructs:

Each have different props that do not look compatible with each other.

I'm wondering which one to use?


Solution

  • The AWS CloudFrontWebDistribution is the original method for working with CloudFront distributions. But now, they had implemented a new method that is provided by Distribution. You can use both CloudFrontWebDistribution as well as Distribution for working with CloudFront distributions, but Distribution has a simpler interface and they receive new features faster. So, it is recommended to use Distribution instead of CloudFrontWebDistribution.