Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cloudfront_distribution - Add support for setting cache and origin request policy ids in cache behavior #290

Closed
sethernet opened this issue Nov 5, 2020 · 4 comments · Fixed by #1589
Labels
affects_2.10 feature This issue/PR relates to a feature request module module plugins plugin (any type) waiting_on_contributor Needs help. Feel free to engage to get things unblocked

Comments

@sethernet
Copy link

sethernet commented Nov 5, 2020

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'))
@sethernet sethernet changed the title Add support for creating cache and origin request policies in cloudfront_distribution Add support for setting cache and origin request policy ids in cache behavior Nov 10, 2020
@ansibullbot
Copy link

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.

click here for bot help

@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 feature This issue/PR relates to a feature request module module needs_triage plugins plugin (any type) labels Nov 16, 2020
@alinabuzachis
Copy link
Contributor

Thank you for raising this idea @sethernet. Would you like to raise a PR for this issue?

@markuman
Copy link
Member

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.

alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this issue May 25, 2022
@tremble tremble changed the title Add support for setting cache and origin request policy ids in cache behavior cloudfront_distribution - Add support for setting cache and origin request policy ids in cache behavior Feb 6, 2023
softwarefactory-project-zuul bot pushed a commit that referenced this issue Jan 9, 2024
…equest_policy_id for behaviors (#1589)

cloudfront_distribution: Add support for cache_policy_id and origin_request_policy_id for behaviors

SUMMARY
As described by issue #290, the current cloudfront_distribution module does not support cache_policy_id and origin_request_policy_id in a behavior.  In particular, attempting to use cache_policy_id will add default values that are incompatible with it (mainly default_ttl, max_ttl, min_ttl, and compress).  So this change allows you to use the policies instead of using a forwarded_values for a given behavior.
Fixed #290
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
cloudfront_distribution

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Zac Lovoy
Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
patchback bot pushed a commit that referenced this issue Jan 9, 2024
…equest_policy_id for behaviors (#1589)

cloudfront_distribution: Add support for cache_policy_id and origin_request_policy_id for behaviors

SUMMARY
As described by issue #290, the current cloudfront_distribution module does not support cache_policy_id and origin_request_policy_id in a behavior.  In particular, attempting to use cache_policy_id will add default values that are incompatible with it (mainly default_ttl, max_ttl, min_ttl, and compress).  So this change allows you to use the policies instead of using a forwarded_values for a given behavior.
Fixed #290
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
cloudfront_distribution

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Zac Lovoy
Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
(cherry picked from commit 7da2ed5)
softwarefactory-project-zuul bot pushed a commit that referenced this issue Jan 9, 2024
…equest_policy_id for behaviors (#1589) (#2038)

[PR #1589/7da2ed5c backport][stable-7] cloudfront_distribution: Add support for cache_policy_id and origin_request_policy_id for behaviors

This is a backport of PR #1589 as merged into main (7da2ed5).
SUMMARY
As described by issue #290, the current cloudfront_distribution module does not support cache_policy_id and origin_request_policy_id in a behavior.  In particular, attempting to use cache_policy_id will add default values that are incompatible with it (mainly default_ttl, max_ttl, min_ttl, and compress).  So this change allows you to use the policies instead of using a forwarded_values for a given behavior.
Fixed #290
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
cloudfront_distribution

Reviewed-by: Mark Chappell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 feature This issue/PR relates to a feature request module module plugins plugin (any type) waiting_on_contributor Needs help. Feel free to engage to get things unblocked
Projects
None yet
5 participants