cloudfront_response_headers_policy
Create, update and delete response headers policies to be used in a Cloudfront distribution
Collection: community.aws
Full Name: community.aws.cloudfront_response_headers_policy
Synopsis
Create, update and delete response headers policies to be used in a Cloudfront distribution
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| access_key | str | |||
| aws_ca_bundle | path | |||
| aws_config | dict | |||
| comment | str | |||
| cors_config | dict | map[] | ||
| custom_headers_config | dict | map[] | ||
| debug_botocore_endpoint_logs | bool | false | ||
| endpoint_url | str | |||
| name | str | yes | ||
| profile | str | |||
| region | str | |||
| secret_key | str | |||
| security_headers_config | dict | map[] | ||
| session_token | str | |||
| state | str | present | ||
| validate_certs | bool | true |
Example
yaml
- name: Creationg a Cloudfront header policy using all predefined header features and a custom header for demonstration
community.aws.cloudfront_response_headers_policy:
name: my-header-policy
comment: My header policy for all the headers
cors_config:
access_control_allow_origins:
items:
- 'https://foo.com/bar'
- 'https://bar.com/foo'
access_control_allow_headers:
items:
- 'X-Session-Id'
access_control_allow_methods:
items:
- GET
- OPTIONS
- HEAD
access_control_allow_credentials: true
access_control_expose_headers:
items:
- 'X-Session-Id'
access_control_max_age_sec: 1800
origin_override: true
security_headers_config:
xss_protection:
protection: true
report_uri: 'https://my.report-uri.com/foo/bar'
override: true
frame_options:
frame_option: 'SAMEORIGIN'
override: true
referrer_policy:
referrer_policy: 'same-origin'
override: true
content_security_policy:
content_security_policy: "frame-ancestors 'none'; report-uri https://my.report-uri.com/r/d/csp/enforce;"
override: true
content_type_options:
override: true
strict_transport_security:
include_subdomains: true
preload: true
access_control_max_age_sec: 63072000
override: true
custom_headers_config:
items:
- {header: 'X-Test-Header', value: 'Foo', override: true}
state: present
- name: Delete header policy
community.aws.cloudfront_response_headers_policy:
name: my-header-policy
state: absent