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*.
Idaws.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

NameAccessible byRequired Params
create_resourceINSERTResponseHeadersPolicyConfig, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all response_headers_policies in a region.

SELECT
region,
id,
last_modified_time,
response_headers_policy_config
FROM aws.cloudfront.response_headers_policies
;

Gets all properties from an individual response_headers_policy.

SELECT
region,
id,
last_modified_time,
response_headers_policy_config
FROM aws.cloudfront.response_headers_policies
WHERE data__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 aws.cloudfront.response_headers_policies (
ResponseHeadersPolicyConfig,
region
)
SELECT
'{{ ResponseHeadersPolicyConfig }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.cloudfront.response_headers_policies
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';

Permissions

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

Create

cloudfront:CreateResponseHeadersPolicy

Delete

cloudfront:DeleteResponseHeadersPolicy,
cloudfront:GetResponseHeadersPolicy

List

cloudfront:ListResponseHeadersPolicies

Read

cloudfront:GetResponseHeadersPolicy

Update

cloudfront:UpdateResponseHeadersPolicy,
cloudfront:GetResponseHeadersPolicy