Class ResponseHeadersPolicy.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.ResponseHeadersPolicy.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ResponseHeadersPolicy>
- Enclosing class:
ResponseHeadersPolicy
@Stability(Stable)
public static final class ResponseHeadersPolicy.Builder
extends Object
implements software.amazon.jsii.Builder<ResponseHeadersPolicy>
A fluent builder for
ResponseHeadersPolicy.-
Method Summary
Modifier and TypeMethodDescriptionbuild()A comment to describe the response headers policy.corsBehavior(ResponseHeadersCorsBehavior corsBehavior) A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).customHeadersBehavior(ResponseCustomHeadersBehavior customHeadersBehavior) A configuration for a set of custom HTTP response headers.removeHeaders(List<String> removeHeaders) A list of HTTP response headers that CloudFront removes from HTTP responses that it sends to viewers.responseHeadersPolicyName(String responseHeadersPolicyName) A unique name to identify the response headers policy.securityHeadersBehavior(ResponseSecurityHeadersBehavior securityHeadersBehavior) A configuration for a set of security-related HTTP response headers.serverTimingSamplingRate(Number serverTimingSamplingRate) The percentage of responses that you want CloudFront to add the Server-Timing header to.
-
Method Details
-
create
@Stability(Stable) public static ResponseHeadersPolicy.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope- This parameter is required.id- This parameter is required.- Returns:
- a new instance of
ResponseHeadersPolicy.Builder.
-
comment
A comment to describe the response headers policy.Default: - no comment
- Parameters:
comment- A comment to describe the response headers policy. This parameter is required.- Returns:
this
-
corsBehavior
@Stability(Stable) public ResponseHeadersPolicy.Builder corsBehavior(ResponseHeadersCorsBehavior corsBehavior) A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS).Default: - no cors behavior
- Parameters:
corsBehavior- A configuration for a set of HTTP response headers that are used for cross-origin resource sharing (CORS). This parameter is required.- Returns:
this
-
customHeadersBehavior
@Stability(Stable) public ResponseHeadersPolicy.Builder customHeadersBehavior(ResponseCustomHeadersBehavior customHeadersBehavior) A configuration for a set of custom HTTP response headers.Default: - no custom headers behavior
- Parameters:
customHeadersBehavior- A configuration for a set of custom HTTP response headers. This parameter is required.- Returns:
this
-
removeHeaders
A list of HTTP response headers that CloudFront removes from HTTP responses that it sends to viewers.Default: - no headers are removed
- Parameters:
removeHeaders- A list of HTTP response headers that CloudFront removes from HTTP responses that it sends to viewers. This parameter is required.- Returns:
this
-
responseHeadersPolicyName
@Stability(Stable) public ResponseHeadersPolicy.Builder responseHeadersPolicyName(String responseHeadersPolicyName) A unique name to identify the response headers policy.Default: - generated from the `id`
- Parameters:
responseHeadersPolicyName- A unique name to identify the response headers policy. This parameter is required.- Returns:
this
-
securityHeadersBehavior
@Stability(Stable) public ResponseHeadersPolicy.Builder securityHeadersBehavior(ResponseSecurityHeadersBehavior securityHeadersBehavior) A configuration for a set of security-related HTTP response headers.Default: - no security headers behavior
- Parameters:
securityHeadersBehavior- A configuration for a set of security-related HTTP response headers. This parameter is required.- Returns:
this
-
serverTimingSamplingRate
@Stability(Stable) public ResponseHeadersPolicy.Builder serverTimingSamplingRate(Number serverTimingSamplingRate) The percentage of responses that you want CloudFront to add the Server-Timing header to.Default: - no Server-Timing header is added to HTTP responses
- Parameters:
serverTimingSamplingRate- The percentage of responses that you want CloudFront to add the Server-Timing header to. This parameter is required.- Returns:
this
-
build
- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<ResponseHeadersPolicy>- Returns:
- a newly built instance of
ResponseHeadersPolicy.
-