@Stability(value=Stable)
public static interface CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty
extends software.amazon.jsii.JsiiSerializable
A response headers policy configuration contains metadata about the response headers policy, and configurations for sets of HTTP response headers and their values. CloudFront adds the headers in the policy to HTTP responses that it sends for requests that match a cache behavior associated with the policy.
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.cloudfront.*;
ResponseHeadersPolicyConfigProperty responseHeadersPolicyConfigProperty = ResponseHeadersPolicyConfigProperty.builder()
.name("name")
// the properties below are optional
.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())
.originOverride(false)
// the properties below are optional
.accessControlExposeHeaders(AccessControlExposeHeadersProperty.builder()
.items(List.of("items"))
.build())
.accessControlMaxAgeSec(123)
.build())
.customHeadersConfig(CustomHeadersConfigProperty.builder()
.items(List.of(CustomHeaderProperty.builder()
.header("header")
.override(false)
.value("value")
.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)
.override(false)
// the properties below are optional
.includeSubdomains(false)
.preload(false)
.build())
.xssProtection(XSSProtectionProperty.builder()
.override(false)
.protection(false)
// the properties below are optional
.modeBlock(false)
.reportUri("reportUri")
.build())
.build())
.serverTimingHeadersConfig(ServerTimingHeadersConfigProperty.builder()
.enabled(false)
// the properties below are optional
.samplingRate(123)
.build())
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty.Builder
|
static class |
CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty.Jsii$Proxy
An implementation for
CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty |
| Modifier and Type | Method and Description |
|---|---|
static CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty.Builder |
builder() |
default String |
getComment()
A comment to describe the response headers policy.
|
default Object |
getCorsConfig()
A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).
|
default Object |
getCustomHeadersConfig()
A configuration for a set of custom HTTP response headers.
|
String |
getName()
A name to identify the response headers policy.
|
default Object |
getSecurityHeadersConfig()
A configuration for a set of security-related HTTP response headers.
|
default Object |
getServerTimingHeadersConfig()
`CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty.ServerTimingHeadersConfig`.
|
@Stability(value=Stable) @NotNull String getName()
The name must be unique for response headers policies in this AWS account .
@Stability(value=Stable) @Nullable default String getComment()
The comment cannot be longer than 128 characters.
@Stability(value=Stable) @Nullable default Object getCorsConfig()
@Stability(value=Stable) @Nullable default Object getCustomHeadersConfig()
@Stability(value=Stable) @Nullable default Object getSecurityHeadersConfig()
@Stability(value=Stable) @Nullable default Object getServerTimingHeadersConfig()
@Stability(value=Stable) static CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty.Builder builder()
Copyright © 2022. All rights reserved.