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
Description
A 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 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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.cloudfront.response_headers_policies
WHERE
Identifier = '{{ id }}' AND
region = 'us-east-1'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

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

cloudfront:CreateResponseHeadersPolicy