Skip to main content

response_headers_policies

Creates, updates, deletes or gets a response_headers_policy resource or lists response_headers_policies in a region

Overview

Nameresponse_headers_policies
TypeResource
DescriptionA response headers policy.
A response headers policy contains information about a set of HTTP response headers.
After you create a response headers policy, you can use its ID to attach it to one or more cache behaviors in a CloudFront distribution. When it's attached to a cache behavior, the response headers policy affects the HTTP headers that CloudFront includes in HTTP responses to requests that match the cache behavior. CloudFront adds or removes response headers according to the configuration of the response headers policy.
For more information, see [Adding or removing HTTP headers in CloudFront responses](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/modifying-response-headers.html) in the *Amazon CloudFront Developer Guide*.
Idawscc.cloudfront.response_headers_policies

Fields

NameDatatypeDescription
idstring
last_modified_timestring
response_headers_policy_configobjectA response headers policy configuration.
regionstringAWS region.

For more information, see AWS::CloudFront::ResponseHeadersPolicy.

Methods

NameResourceAccessible byRequired Params
create_resourceresponse_headers_policiesINSERTResponseHeadersPolicyConfig, region
delete_resourceresponse_headers_policiesDELETEIdentifier, region
update_resourceresponse_headers_policiesUPDATEIdentifier, PatchDocument, region
list_resourcesresponse_headers_policies_list_onlySELECTregion
get_resourceresponse_headers_policiesSELECTIdentifier, region

SELECT examples

Gets all properties from an individual response_headers_policy.

SELECT
region,
id,
last_modified_time,
response_headers_policy_config
FROM awscc.cloudfront.response_headers_policies
WHERE
region = 'us-east-1' AND
Identifier = '{{ id }}';

INSERT example

Use the following StackQL query and manifest file to create a new response_headers_policy resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.cloudfront.response_headers_policies (
ResponseHeadersPolicyConfig,
region
)
SELECT
'{{ response_headers_policy_config }}',
'{{ region }}';

UPDATE example

Use the following StackQL query and manifest file to update a response_headers_policy resource, using stack-deploy.

/*+ update */
UPDATE awscc.cloudfront.response_headers_policies
SET PatchDocument = string('{{ {
"ResponseHeadersPolicyConfig": response_headers_policy_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';

DELETE example

/*+ delete */
DELETE FROM awscc.cloudfront.response_headers_policies
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1';

Permissions

To operate on the response_headers_policies resource, the following permissions are required:

cloudfront:CreateResponseHeadersPolicy