community.aws
community.aws copied to clipboard
Add support for setting cache and origin request policy ids in cache behavior
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'))
Files identified in the description:
If these files are inaccurate, please update the component name
section of the description or use the !component
bot command.
cc @jillr @s-hertel @tremble @willthames @wilvk @wimnat click here for bot help
Thank you for raising this idea @sethernet. Would you like to raise a PR for this issue?
Theoretically the parameter cache_policy_id: 658327ea-f89d-4fab-a63d-7e88639e58f6
works already.
But the default values for min/max/default_ttl that are added, are incompatible together.