Class ResponseHeadersCorsBehavior.Builder
java.lang.Object
software.amazon.awscdk.services.cloudfront.ResponseHeadersCorsBehavior.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ResponseHeadersCorsBehavior>
- Enclosing interface:
- ResponseHeadersCorsBehavior
@Stability(Stable)
public static final class ResponseHeadersCorsBehavior.Builder
extends Object
implements software.amazon.jsii.Builder<ResponseHeadersCorsBehavior>
A builder for
ResponseHeadersCorsBehavior
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccessControlAllowCredentials
(Boolean accessControlAllowCredentials) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowCredentials()
accessControlAllowHeaders
(List<String> accessControlAllowHeaders) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowHeaders()
accessControlAllowMethods
(List<String> accessControlAllowMethods) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowMethods()
accessControlAllowOrigins
(List<String> accessControlAllowOrigins) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowOrigins()
accessControlExposeHeaders
(List<String> accessControlExposeHeaders) Sets the value ofResponseHeadersCorsBehavior.getAccessControlExposeHeaders()
accessControlMaxAge
(Duration accessControlMaxAge) Sets the value ofResponseHeadersCorsBehavior.getAccessControlMaxAge()
build()
Builds the configured instance.originOverride
(Boolean originOverride) Sets the value ofResponseHeadersCorsBehavior.getOriginOverride()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
accessControlAllowCredentials
@Stability(Stable) public ResponseHeadersCorsBehavior.Builder accessControlAllowCredentials(Boolean accessControlAllowCredentials) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowCredentials()
- Parameters:
accessControlAllowCredentials
- A Boolean that CloudFront uses as the value for the Access-Control-Allow-Credentials HTTP response header. This parameter is required.- Returns:
this
-
accessControlAllowHeaders
@Stability(Stable) public ResponseHeadersCorsBehavior.Builder accessControlAllowHeaders(List<String> accessControlAllowHeaders) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowHeaders()
- Parameters:
accessControlAllowHeaders
- A list of HTTP header names that CloudFront includes as values for the Access-Control-Allow-Headers HTTP response header. This parameter is required. You can specify['*']
to allow all headers.- Returns:
this
-
accessControlAllowMethods
@Stability(Stable) public ResponseHeadersCorsBehavior.Builder accessControlAllowMethods(List<String> accessControlAllowMethods) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowMethods()
- Parameters:
accessControlAllowMethods
- A list of HTTP methods that CloudFront includes as values for the Access-Control-Allow-Methods HTTP response header. This parameter is required.- Returns:
this
-
accessControlAllowOrigins
@Stability(Stable) public ResponseHeadersCorsBehavior.Builder accessControlAllowOrigins(List<String> accessControlAllowOrigins) Sets the value ofResponseHeadersCorsBehavior.getAccessControlAllowOrigins()
- Parameters:
accessControlAllowOrigins
- A list of origins (domain names) that CloudFront can use as the value for the Access-Control-Allow-Origin HTTP response header. This parameter is required. You can specify['*']
to allow all origins.- Returns:
this
-
originOverride
@Stability(Stable) public ResponseHeadersCorsBehavior.Builder originOverride(Boolean originOverride) Sets the value ofResponseHeadersCorsBehavior.getOriginOverride()
- Parameters:
originOverride
- A Boolean that determines whether CloudFront overrides HTTP response headers received from the origin with the ones specified in this response headers policy. This parameter is required.- Returns:
this
-
accessControlExposeHeaders
@Stability(Stable) public ResponseHeadersCorsBehavior.Builder accessControlExposeHeaders(List<String> accessControlExposeHeaders) Sets the value ofResponseHeadersCorsBehavior.getAccessControlExposeHeaders()
- Parameters:
accessControlExposeHeaders
- A list of HTTP headers that CloudFront includes as values for the Access-Control-Expose-Headers HTTP response header. You can specify['*']
to expose all headers.- Returns:
this
-
accessControlMaxAge
@Stability(Stable) public ResponseHeadersCorsBehavior.Builder accessControlMaxAge(Duration accessControlMaxAge) Sets the value ofResponseHeadersCorsBehavior.getAccessControlMaxAge()
- Parameters:
accessControlMaxAge
- A number that CloudFront uses as the value for the Access-Control-Max-Age HTTP response header.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ResponseHeadersCorsBehavior>
- Returns:
- a new instance of
ResponseHeadersCorsBehavior
- Throws:
NullPointerException
- if any required attribute was not provided
-