Class CfnResponseHeadersPolicyPropsMixin
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.Mixin
software.amazon.awscdk.cfnpropertymixins.services.cloudfront.CfnResponseHeadersPolicyPropsMixin
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IMixin
@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)",
date="2026-03-11T13:19:57.110Z")
@Stability(Stable)
public class CfnResponseHeadersPolicyPropsMixin
extends Mixin
implements software.constructs.IMixin
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 .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.cfnpropertymixins.services.cloudfront.*;
import software.amazon.awscdk.*;
IMergeStrategy mergeStrategy;
CfnResponseHeadersPolicyPropsMixin cfnResponseHeadersPolicyPropsMixin = CfnResponseHeadersPolicyPropsMixin.Builder.create(CfnResponseHeadersPolicyMixinProps.builder()
.responseHeadersPolicyConfig(ResponseHeadersPolicyConfigProperty.builder()
.comment("comment")
.corsConfig(CorsConfigProperty.builder()
.accessControlAllowCredentials(false)
.accessControlAllowHeaders(AccessControlAllowHeadersProperty.builder()
.items(List.of("items"))
.build())
.accessControlAllowMethods(AccessControlAllowMethodsProperty.builder()
.items(List.of("items"))
.build())
.accessControlAllowOrigins(AccessControlAllowOriginsProperty.builder()
.items(List.of("items"))
.build())
.accessControlExposeHeaders(AccessControlExposeHeadersProperty.builder()
.items(List.of("items"))
.build())
.accessControlMaxAgeSec(123)
.originOverride(false)
.build())
.customHeadersConfig(CustomHeadersConfigProperty.builder()
.items(List.of(CustomHeaderProperty.builder()
.header("header")
.override(false)
.value("value")
.build()))
.build())
.name("name")
.removeHeadersConfig(RemoveHeadersConfigProperty.builder()
.items(List.of(RemoveHeaderProperty.builder()
.header("header")
.build()))
.build())
.securityHeadersConfig(SecurityHeadersConfigProperty.builder()
.contentSecurityPolicy(ContentSecurityPolicyProperty.builder()
.contentSecurityPolicy("contentSecurityPolicy")
.override(false)
.build())
.contentTypeOptions(ContentTypeOptionsProperty.builder()
.override(false)
.build())
.frameOptions(FrameOptionsProperty.builder()
.frameOption("frameOption")
.override(false)
.build())
.referrerPolicy(ReferrerPolicyProperty.builder()
.override(false)
.referrerPolicy("referrerPolicy")
.build())
.strictTransportSecurity(StrictTransportSecurityProperty.builder()
.accessControlMaxAgeSec(123)
.includeSubdomains(false)
.override(false)
.preload(false)
.build())
.xssProtection(XSSProtectionProperty.builder()
.modeBlock(false)
.override(false)
.protection(false)
.reportUri("reportUri")
.build())
.build())
.serverTimingHeadersConfig(ServerTimingHeadersConfigProperty.builder()
.enabled(false)
.samplingRate(123)
.build())
.build())
.build())
.strategy(mergeStrategy)
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA list of HTTP header names that CloudFront includes as values for theAccess-Control-Allow-HeadersHTTP response header.static interfaceA list of HTTP methods that CloudFront includes as values for theAccess-Control-Allow-MethodsHTTP response header.static interfaceA list of origins (domain names) that CloudFront can use as the value for theAccess-Control-Allow-OriginHTTP response header.static interfaceA list of HTTP headers that CloudFront includes as values for theAccess-Control-Expose-HeadersHTTP response header.static final classA fluent builder forCfnResponseHeadersPolicyPropsMixin.static interfaceThe policy directives and their values that CloudFront includes as values for theContent-Security-PolicyHTTP response header.static interfaceDetermines whether CloudFront includes theX-Content-Type-OptionsHTTP response header with its value set tonosniff.static interfaceA configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).static interfaceAn HTTP response header name and its value.static interfaceA list of HTTP response header names and their values.static interfaceDetermines whether CloudFront includes theX-Frame-OptionsHTTP response header and the header's value.static interfaceDetermines whether CloudFront includes theReferrer-PolicyHTTP response header and the header's value.static interfaceThe name of an HTTP header that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.static interfaceA list of HTTP header names that CloudFront removes from HTTP responses to requests that match the cache behavior that this response headers policy is attached to.static interfaceA response headers policy configuration.static interfaceA configuration for a set of security-related HTTP response headers.static interfaceA configuration for enabling theServer-Timingheader in HTTP responses sent from CloudFront.static interfaceDetermines whether CloudFront includes theStrict-Transport-SecurityHTTP response header and the header's value.static interfaceDetermines whether CloudFront includes theX-XSS-ProtectionHTTP response header and the header's value.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IMixin
software.constructs.IMixin.Jsii$Default, software.constructs.IMixin.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreate a mixin to apply properties toAWS::CloudFront::ResponseHeadersPolicy.CfnResponseHeadersPolicyPropsMixin(CfnResponseHeadersPolicyMixinProps props, CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::CloudFront::ResponseHeadersPolicy.protectedCfnResponseHeadersPolicyPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnResponseHeadersPolicyPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTo(software.constructs.IConstruct construct) Apply the mixin properties to the construct.protected CfnResponseHeadersPolicyMixinPropsgetProps()protected IMergeStrategysupports(software.constructs.IConstruct construct) Check if this mixin supports the given construct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_PROPERTY_KEYS
-
-
Constructor Details
-
CfnResponseHeadersPolicyPropsMixin
protected CfnResponseHeadersPolicyPropsMixin(software.amazon.jsii.JsiiObjectRef objRef) -
CfnResponseHeadersPolicyPropsMixin
protected CfnResponseHeadersPolicyPropsMixin(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnResponseHeadersPolicyPropsMixin
@Stability(Stable) public CfnResponseHeadersPolicyPropsMixin(@NotNull CfnResponseHeadersPolicyMixinProps props, @Nullable CfnPropertyMixinOptions options) Create a mixin to apply properties toAWS::CloudFront::ResponseHeadersPolicy.- Parameters:
props- L1 properties to apply. This parameter is required.options- Mixin options.
-
CfnResponseHeadersPolicyPropsMixin
@Stability(Stable) public CfnResponseHeadersPolicyPropsMixin(@NotNull CfnResponseHeadersPolicyMixinProps props) Create a mixin to apply properties toAWS::CloudFront::ResponseHeadersPolicy.- Parameters:
props- L1 properties to apply. This parameter is required.
-
-
Method Details
-
applyTo
@Stability(Stable) public void applyTo(@NotNull software.constructs.IConstruct construct) Apply the mixin properties to the construct. -
supports
@Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct) Check if this mixin supports the given construct. -
getProps
-
getStrategy
-