AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

ResponseHeadersPolicy

A Response Headers Policy configuration.

Import

import { ResponseHeadersPolicy } from 'aws-cdk-lib/aws-cloudfront';

Or use the module namespace:

import * as cloudfront from 'aws-cdk-lib/aws-cloudfront';
// cloudfront.ResponseHeadersPolicy

Properties

Configuration passed to the constructor as ResponseHeadersPolicyProps.

commentOptional
string

A comment to describe the response headers policy.

Default: - no comment

corsBehaviorOptional
ResponseHeadersCorsBehavior

A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).

Default: - no cors behavior

customHeadersBehaviorOptional
ResponseCustomHeadersBehavior

A configuration for a set of custom HTTP response headers.

Default: - no custom headers behavior

removeHeadersOptional
string[]

A list of HTTP response headers that CloudFront removes from HTTP responses that it sends to viewers.

Default: - no headers are removed

responseHeadersPolicyNameOptional
string

A unique name to identify the response headers policy.

Default: - generated from the `id`

securityHeadersBehaviorOptional
ResponseSecurityHeadersBehavior

A configuration for a set of security-related HTTP response headers.

Default: - no security headers behavior

serverTimingSamplingRateOptional
number

The percentage of responses that you want CloudFront to add the Server-Timing header to.

Default: - no Server-Timing header is added to HTTP responses

Get the Amazon CloudFront Cheat Sheet

Everything you need to know about Amazon CloudFront on one page. HD quality, print-friendly.

Download Free Infographic