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:
  • Field Details

    • CFN_PROPERTY_KEYS

      @Stability(Stable) protected static final List<String> 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 to AWS::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 to AWS::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.

      Specified by:
      applyTo in interface software.constructs.IMixin
      Specified by:
      applyTo in class Mixin
      Parameters:
      construct - This parameter is required.
    • supports

      @Stability(Stable) @NotNull public Boolean supports(@NotNull software.constructs.IConstruct construct)
      Check if this mixin supports the given construct.

      Specified by:
      supports in interface software.constructs.IMixin
      Overrides:
      supports in class Mixin
      Parameters:
      construct - This parameter is required.
    • getProps

      @Stability(Stable) @NotNull protected CfnResponseHeadersPolicyMixinProps getProps()
    • getStrategy

      @Stability(Stable) @NotNull protected IMergeStrategy getStrategy()