Class CfnUrl.CorsProperty.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.CfnUrl.CorsProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnUrl.CorsProperty>
- Enclosing interface:
CfnUrl.CorsProperty
@Stability(Stable)
public static final class CfnUrl.CorsProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnUrl.CorsProperty>
A builder for
CfnUrl.CorsProperty-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowCredentials(Boolean allowCredentials) Sets the value ofCfnUrl.CorsProperty.getAllowCredentials()allowCredentials(IResolvable allowCredentials) Sets the value ofCfnUrl.CorsProperty.getAllowCredentials()allowHeaders(List<String> allowHeaders) Sets the value ofCfnUrl.CorsProperty.getAllowHeaders()allowMethods(List<String> allowMethods) Sets the value ofCfnUrl.CorsProperty.getAllowMethods()allowOrigins(List<String> allowOrigins) Sets the value ofCfnUrl.CorsProperty.getAllowOrigins()build()Builds the configured instance.exposeHeaders(List<String> exposeHeaders) Sets the value ofCfnUrl.CorsProperty.getExposeHeaders()Sets the value ofCfnUrl.CorsProperty.getMaxAge()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowCredentials
Sets the value ofCfnUrl.CorsProperty.getAllowCredentials()- Parameters:
allowCredentials- Whether you want to allow cookies or other credentials in requests to your function URL. The default isfalse.- Returns:
this
-
allowCredentials
@Stability(Stable) public CfnUrl.CorsProperty.Builder allowCredentials(IResolvable allowCredentials) Sets the value ofCfnUrl.CorsProperty.getAllowCredentials()- Parameters:
allowCredentials- Whether you want to allow cookies or other credentials in requests to your function URL. The default isfalse.- Returns:
this
-
allowHeaders
Sets the value ofCfnUrl.CorsProperty.getAllowHeaders()- Parameters:
allowHeaders- The HTTP headers that origins can include in requests to your function URL. For example:Date,Keep-Alive,X-Custom-Header.- Returns:
this
-
allowMethods
Sets the value ofCfnUrl.CorsProperty.getAllowMethods()- Parameters:
allowMethods- The HTTP methods that are allowed when calling your function URL. For example:GET,POST,DELETE, or the wildcard character (*).- Returns:
this
-
allowOrigins
Sets the value ofCfnUrl.CorsProperty.getAllowOrigins()- Parameters:
allowOrigins- The origins that can access your function URL. You can list any number of specific origins, separated by a comma. For example:https://www.example.com,http://localhost:60905.Alternatively, you can grant access to all origins with the wildcard character (
*).- Returns:
this
-
exposeHeaders
Sets the value ofCfnUrl.CorsProperty.getExposeHeaders()- Parameters:
exposeHeaders- The HTTP headers in your function response that you want to expose to origins that call your function URL. For example:Date,Keep-Alive,X-Custom-Header.- Returns:
this
-
maxAge
Sets the value ofCfnUrl.CorsProperty.getMaxAge()- Parameters:
maxAge- The maximum amount of time, in seconds, that browsers can cache results of a preflight request. By default, this is set to0, which means the browser will not cache results.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CfnUrl.CorsProperty>- Returns:
- a new instance of
CfnUrl.CorsProperty - Throws:
NullPointerException- if any required attribute was not provided
-