Skip to main content

CloudFrontResponseHeadersPolicySchema

A response headers policy this distribution declares, referenced by a behavior under { kind: 'custom', name }. It changes the headers of every response on the way to the viewer, whether it came from the cache or the origin.

CloudFront removes removeHeaders first, then adds everything else, so a header both removed and added is sent with this policy's value. AWS: response headers policies.

@group

Resources/CloudFrontDistribution

Index

Properties

optionalcors

cors?: CloudFrontCorsSchema | null = null

The CORS headers to add. See CloudFrontCorsSchema.

optionalcustomHeaders

customHeaders?: CloudFrontCustomHeaderSchema[] = []

Headers to add that have no field of their own, e.g. Permissions-Policy. See CloudFrontCustomHeaderSchema.

name

name: string

How a behavior names this policy. It is also the policy's name in AWS, which must be unique across the account.

optionalremoveHeaders

removeHeaders?: string[] = []

Names of headers to strip from the origin's response, e.g. ['Server', 'X-Powered-By']. Not case-sensitive. With Server or Date removed, CloudFront sends its own instead.

AWS refuses connection-level headers and CloudFront's own, such as Connection, Content-Length, Transfer-Encoding, Via, and any header starting X-Amz-Cf- or X-Edge-. The full list.

optionalsecurityHeaders

securityHeaders?: CloudFrontSecurityHeadersSchema | null = null

The security headers to add. See CloudFrontSecurityHeadersSchema.