Closed
Description
SUMMARY
Add support for setting cache and origin request policy ids in the cache behaviors block when creating a distribution in cloudfront_distribution.
ISSUE TYPE
- Feature Idea
COMPONENT NAME
cloudfront_distribution
ADDITIONAL INFORMATION
Currently we are unable to set cache policy or origin request policy ids in the cache behaviors section so that they are added to a distribution.
Example playbook code:
cache_behaviors:
- path_pattern: "*/"
target_origin_id: ""
field_level_encryption_id: ""
cache_policy_id: "{{ cache_policy_id }}"
origin_request_policy_id: "{{ origin_request_policy_id }}"
Example python code:
cache_behavior['cache_policy_id'] = cache_behavior.get('cache_policy_id', config.get('cache_policy_id'))
cache_behavior['origin_request_policy_id'] = cache_behavior.get('origin_request_policy_id', config.get('origin_request_policy_id'))