Class HttpApi.Builder
java.lang.Object
software.amazon.awscdk.services.apigatewayv2.HttpApi.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<HttpApi>
- Enclosing class:
HttpApi
@Stability(Stable)
public static final class HttpApi.Builder
extends Object
implements software.amazon.jsii.Builder<HttpApi>
A fluent builder for
HttpApi.-
Method Summary
Modifier and TypeMethodDescriptionName for the HTTP API resource.build()corsPreflight(CorsPreflightOptions corsPreflight) Specifies a CORS configuration for an API.static HttpApi.BuildercreateDefaultStage(Boolean createDefaultStage) Whether a default stage and deployment should be automatically created.defaultAuthorizationScopes(List<String> defaultAuthorizationScopes) Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.defaultAuthorizer(IHttpRouteAuthorizer defaultAuthorizer) Default Authorizer applied to all routes in the gateway.defaultDomainMapping(DomainMappingOptions defaultDomainMapping) Configure a custom domain with the API mapping resource to the HTTP API.defaultIntegration(HttpRouteIntegration defaultIntegration) An integration that will be configured on the catch-all route ($default).description(String description) The description of the API.disableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) Specifies whether clients can invoke your API using the default endpoint.
-
Method Details
-
create
@Stability(Stable) public static HttpApi.Builder create(software.constructs.Construct scope, String id) - Parameters:
scope- This parameter is required.id- This parameter is required.- Returns:
- a new instance of
HttpApi.Builder.
-
apiName
Name for the HTTP API resource.Default: - id of the HttpApi construct.
- Parameters:
apiName- Name for the HTTP API resource. This parameter is required.- Returns:
this
-
corsPreflight
Specifies a CORS configuration for an API.Default: - CORS disabled.
- Parameters:
corsPreflight- Specifies a CORS configuration for an API. This parameter is required.- Returns:
this- See Also:
-
createDefaultStage
Whether a default stage and deployment should be automatically created.Default: true
- Parameters:
createDefaultStage- Whether a default stage and deployment should be automatically created. This parameter is required.- Returns:
this
-
defaultAuthorizationScopes
@Stability(Stable) public HttpApi.Builder defaultAuthorizationScopes(List<String> defaultAuthorizationScopes) Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.The scopes are used with a COGNITO_USER_POOLS authorizer to authorize the method invocation.
Default: - no default authorization scopes
- Parameters:
defaultAuthorizationScopes- Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route. This parameter is required.- Returns:
this
-
defaultAuthorizer
Default Authorizer applied to all routes in the gateway.Default: - no default authorizer
- Parameters:
defaultAuthorizer- Default Authorizer applied to all routes in the gateway. This parameter is required.- Returns:
this
-
defaultDomainMapping
@Stability(Stable) public HttpApi.Builder defaultDomainMapping(DomainMappingOptions defaultDomainMapping) Configure a custom domain with the API mapping resource to the HTTP API.Default: - no default domain mapping configured. meaningless if `createDefaultStage` is `false`.
- Parameters:
defaultDomainMapping- Configure a custom domain with the API mapping resource to the HTTP API. This parameter is required.- Returns:
this
-
defaultIntegration
@Stability(Stable) public HttpApi.Builder defaultIntegration(HttpRouteIntegration defaultIntegration) An integration that will be configured on the catch-all route ($default).Default: - none
- Parameters:
defaultIntegration- An integration that will be configured on the catch-all route ($default). This parameter is required.- Returns:
this
-
description
The description of the API.Default: - none
- Parameters:
description- The description of the API. This parameter is required.- Returns:
this
-
disableExecuteApiEndpoint
@Stability(Stable) public HttpApi.Builder disableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) Specifies whether clients can invoke your API using the default endpoint.By default, clients can invoke your API with the default
https://{api_id}.execute-api.{region}.amazonaws.comendpoint. Enable this if you would like clients to use your custom domain name.Default: false execute-api endpoint enabled.
- Parameters:
disableExecuteApiEndpoint- Specifies whether clients can invoke your API using the default endpoint. This parameter is required.- Returns:
this
-
build
-