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(Experimental) public static final class HttpApi.Builder extends Object implements software.amazon.jsii.Builder<HttpApi>
(experimental) A fluent builder for HttpApi.
  • Method Details

    • create

      @Stability(Experimental) 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

      @Stability(Experimental) public HttpApi.Builder apiName(String apiName)
      (experimental) 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

      @Stability(Experimental) public HttpApi.Builder corsPreflight(CorsPreflightOptions corsPreflight)
      (experimental) 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

      @Stability(Experimental) public HttpApi.Builder createDefaultStage(Boolean createDefaultStage)
      (experimental) 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(Experimental) public HttpApi.Builder defaultAuthorizationScopes(List<String> defaultAuthorizationScopes)
      (experimental) Default OIDC scopes attached to all routes in the gateway, unless explicitly configured on the route.

      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

      @Stability(Experimental) public HttpApi.Builder defaultAuthorizer(IHttpRouteAuthorizer defaultAuthorizer)
      (experimental) Default Authorizer to applied to all routes in the gateway.

      Default: - No authorizer

      Parameters:
      defaultAuthorizer - Default Authorizer to applied to all routes in the gateway. This parameter is required.
      Returns:
      this
    • defaultDomainMapping

      @Stability(Experimental) public HttpApi.Builder defaultDomainMapping(DomainMappingOptions defaultDomainMapping)
      (experimental) 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(Experimental) public HttpApi.Builder defaultIntegration(HttpRouteIntegration defaultIntegration)
      (experimental) 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

      @Stability(Experimental) public HttpApi.Builder description(String description)
      (experimental) The description of the API.

      Default: - none

      Parameters:
      description - The description of the API. This parameter is required.
      Returns:
      this
    • disableExecuteApiEndpoint

      @Stability(Experimental) public HttpApi.Builder disableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint)
      (experimental) 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.com endpoint. 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

      @Stability(Experimental) public HttpApi build()
      Specified by:
      build in interface software.amazon.jsii.Builder<HttpApi>
      Returns:
      a newly built instance of HttpApi.