Cloudformation-coverage-roadmap: AWS::CloudFront::Distribution *CacheBehavior* as an independant resource

Created on 26 Nov 2020  路  5Comments  路  Source: aws-cloudformation/cloudformation-coverage-roadmap

Title

AWS::CloudFront::Distribution CacheBehavior : independant resource

Scope of request

Possibility of reducing the size of AWS::CloudFront::Distribution DistributionConfig property by leaving the object AWS::CloudFront::Distribution CacheBehavior as an independant resource

Why ?

  • Remove templates for CloudFront service with more than +1K lines
  • facilitate the maintenance of the property AWS::CloudFront::Distribution DistributionConfig
  • use the module concept: announcing-modules-for-aws-cloudformation
    ...

AWS::CloudFront::Distribution DistributionConfig

All 5 comments

help !?

see AWS::CloudFront::CachePolicy and/or AWS::CloudFront::OriginRequestPolicy

I'm speaking about CacheBehavior as an independant resources not about cachePolicy & OriginRequestPolicy !

A CloudFormartion resource usually wraps existing API calls to create, read, update, delete, and list a resource. This doesn't work for all APIs (not all resources have a list or even a create) but for the most part that is the idea. The problem I'm seeing with this request is that there are no APIs for creating, update, or deleting a cache behavior. Its embedded into the distribution config for the API calls. https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_DistributionConfig.html

If I understand this request correctly you are looking to reduce the distribution config section to the CloudFront API. CloudFormation could model around those APIs if they existed.

If I understand this request correctly you are looking to reduce the distribution config section to the CloudFront API. CloudFormation could model around those APIs if they existed

Like @therealsebo mentioned, using the (new) AWS::CloudFront::CachePolicy and/or AWS::CloudFront::OriginRequestPolicy can also reduce the size of the DistributionConfig, and makes it easier to share policies between distributions. They can slightly change the behaviour of CloudFront, so it's not always a drop-in replacement.

For distributions where the configuration can't be changed to use those, CloudFormation could consider supporting yaml anchors or constants to help reduce template size (in a lot of case there is plenty of repetiton between CacheBehaviours)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luiseduardocolon picture luiseduardocolon  路  4Comments

san-san picture san-san  路  3Comments

mildebrandt picture mildebrandt  路  3Comments

hoegertn picture hoegertn  路  4Comments

ghost picture ghost  路  4Comments