@Generated(value="jsii-pacmak/1.50.0 (build d1830a4)", date="2022-01-11T17:58:48.747Z") @Stability(value=Stable) public class CfnResponseHeadersPolicy extends CfnResource implements IInspectable
A response headers policy.
A response headers policy contains information about a set of HTTP response headers and their values.
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, CloudFront adds the headers in the policy to HTTP responses that it sends for requests that match the cache behavior.
For more information, see Adding HTTP headers to 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.services.cloudfront.*;
CfnResponseHeadersPolicy cfnResponseHeadersPolicy = CfnResponseHeadersPolicy.Builder.create(this, "MyCfnResponseHeadersPolicy")
.responseHeadersPolicyConfig(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())
.build())
.build();
| Modifier and Type | Class and Description |
|---|---|
static interface |
CfnResponseHeadersPolicy.AccessControlAllowHeadersProperty
A list of HTTP header names that CloudFront includes as values for the `Access-Control-Allow-Headers` HTTP response header.
|
static interface |
CfnResponseHeadersPolicy.AccessControlAllowMethodsProperty
A list of HTTP methods that CloudFront includes as values for the `Access-Control-Allow-Methods` HTTP response header.
|
static interface |
CfnResponseHeadersPolicy.AccessControlAllowOriginsProperty
A list of origins (domain names) that CloudFront can use as the value for the `Access-Control-Allow-Origin` HTTP response header.
|
static interface |
CfnResponseHeadersPolicy.AccessControlExposeHeadersProperty
A list of HTTP headers that CloudFront includes as values for the `Access-Control-Expose-Headers` HTTP response header.
|
static class |
CfnResponseHeadersPolicy.Builder
A fluent builder for
CfnResponseHeadersPolicy. |
static interface |
CfnResponseHeadersPolicy.ContentSecurityPolicyProperty
The policy directives and their values that CloudFront includes as values for the `Content-Security-Policy` HTTP response header.
|
static interface |
CfnResponseHeadersPolicy.ContentTypeOptionsProperty
Determines whether CloudFront includes the `X-Content-Type-Options` HTTP response header with its value set to `nosniff` .
|
static interface |
CfnResponseHeadersPolicy.CorsConfigProperty
A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).
|
static interface |
CfnResponseHeadersPolicy.CustomHeaderProperty
An HTTP response header name and its value.
|
static interface |
CfnResponseHeadersPolicy.CustomHeadersConfigProperty
A list of HTTP response header names and their values.
|
static interface |
CfnResponseHeadersPolicy.FrameOptionsProperty
Determines whether CloudFront includes the `X-Frame-Options` HTTP response header and the header’s value.
|
static interface |
CfnResponseHeadersPolicy.ReferrerPolicyProperty
Determines whether CloudFront includes the `Referrer-Policy` HTTP response header and the header’s value.
|
static interface |
CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty
A response headers policy configuration.
|
static interface |
CfnResponseHeadersPolicy.SecurityHeadersConfigProperty
A configuration for a set of security-related HTTP response headers.
|
static interface |
CfnResponseHeadersPolicy.StrictTransportSecurityProperty
Determines whether CloudFront includes the `Strict-Transport-Security` HTTP response header and the header’s value.
|
static interface |
CfnResponseHeadersPolicy.XSSProtectionProperty
Determines whether CloudFront includes the `X-XSS-Protection` HTTP response header and the header’s value.
|
software.amazon.jsii.JsiiObject.InitializationModeIInspectable.Jsii$Default, IInspectable.Jsii$ProxyIConstruct.Jsii$Default| Modifier and Type | Field and Description |
|---|---|
static String |
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
|
| Modifier | Constructor and Description |
|---|---|
|
CfnResponseHeadersPolicy(Construct scope,
String id,
CfnResponseHeadersPolicyProps props)
Create a new `AWS::CloudFront::ResponseHeadersPolicy`.
|
protected |
CfnResponseHeadersPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
CfnResponseHeadersPolicy(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttrId()
The unique identifier for the cache policy.
|
String |
getAttrLastModifiedTime()
The date and time when the response headers policy was last modified.
|
protected Map<String,Object> |
getCfnProperties() |
Object |
getResponseHeadersPolicyConfig()
A response headers policy configuration.
|
void |
inspect(TreeInspector inspector)
Examines the CloudFormation resource and discloses attributes.
|
protected Map<String,Object> |
renderProperties(Map<String,Object> props) |
void |
setResponseHeadersPolicyConfig(CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty value)
A response headers policy configuration.
|
void |
setResponseHeadersPolicyConfig(IResolvable value)
A response headers policy configuration.
|
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesgetRefgetCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdgetNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validatejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet@Stability(value=Stable) public static final String CFN_RESOURCE_TYPE_NAME
protected CfnResponseHeadersPolicy(software.amazon.jsii.JsiiObjectRef objRef)
protected CfnResponseHeadersPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public CfnResponseHeadersPolicy(@NotNull
Construct scope,
@NotNull
String id,
@NotNull
CfnResponseHeadersPolicyProps props)
scope - - scope in which this resource is defined. This parameter is required.id - - scoped id of the resource. This parameter is required.props - - resource properties. This parameter is required.@Stability(value=Stable)
public void inspect(@NotNull
TreeInspector inspector)
inspect in interface IInspectableinspector - - tree inspector to collect and process attributes. This parameter is required.@Stability(value=Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String,Object> props)
renderProperties in class CfnResourceprops - This parameter is required.@Stability(value=Stable) @NotNull public String getAttrId()
For example: 57f99797-3b20-4e1b-a728-27972a74082a .
@Stability(value=Stable) @NotNull public String getAttrLastModifiedTime()
@Stability(value=Stable) @NotNull protected Map<String,Object> getCfnProperties()
getCfnProperties in class CfnResource@Stability(value=Stable) @NotNull public Object getResponseHeadersPolicyConfig()
A response headers policy contains information about a set 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 that’s associated with the policy.
@Stability(value=Stable)
public void setResponseHeadersPolicyConfig(@NotNull
IResolvable value)
A response headers policy contains information about a set 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 that’s associated with the policy.
@Stability(value=Stable)
public void setResponseHeadersPolicyConfig(@NotNull
CfnResponseHeadersPolicy.ResponseHeadersPolicyConfigProperty value)
A response headers policy contains information about a set 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 that’s associated with the policy.
Copyright © 2022. All rights reserved.