Interface HttpApiProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
HttpApiProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-11T15:55:52.661Z") @Stability(Stable) public interface HttpApiProps extends software.amazon.jsii.JsiiSerializable
Properties to initialize an instance of HttpApi.

Example:

 import software.amazon.awscdk.aws_apigatewayv2_integrations.HttpAlbIntegration;
 ApplicationLoadBalancer lb;
 ApplicationListener listener = lb.addListener("listener", BaseApplicationListenerProps.builder().port(80).build());
 listener.addTargets("target", AddApplicationTargetsProps.builder()
         .port(80)
         .build());
 HttpApi httpEndpoint = HttpApi.Builder.create(this, "HttpProxyPrivateApi")
         .defaultIntegration(HttpAlbIntegration.Builder.create("DefaultIntegration", listener)
                 .parameterMapping(new ParameterMapping().custom("myKey", "myValue"))
                 .build())
         .build();
 
  • Method Details

    • getApiName

      @Stability(Stable) @Nullable default String getApiName()
      Name for the HTTP API resource.

      Default: - id of the HttpApi construct.

    • getCorsPreflight

      @Stability(Stable) @Nullable default CorsPreflightOptions getCorsPreflight()
      Specifies a CORS configuration for an API.

      Default: - CORS disabled.

      See Also:
    • getCreateDefaultStage

      @Stability(Stable) @Nullable default Boolean getCreateDefaultStage()
      Whether a default stage and deployment should be automatically created.

      Default: true

    • getDefaultAuthorizationScopes

      @Stability(Stable) @Nullable default List<String> getDefaultAuthorizationScopes()
      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

    • getDefaultAuthorizer

      @Stability(Stable) @Nullable default IHttpRouteAuthorizer getDefaultAuthorizer()
      Default Authorizer applied to all routes in the gateway.

      Default: - no default authorizer

    • getDefaultDomainMapping

      @Stability(Stable) @Nullable default DomainMappingOptions getDefaultDomainMapping()
      Configure a custom domain with the API mapping resource to the HTTP API.

      Default: - no default domain mapping configured. meaningless if `createDefaultStage` is `false`.

    • getDefaultIntegration

      @Stability(Stable) @Nullable default HttpRouteIntegration getDefaultIntegration()
      An integration that will be configured on the catch-all route ($default).

      Default: - none

    • getDescription

      @Stability(Stable) @Nullable default String getDescription()
      The description of the API.

      Default: - none

    • getDisableExecuteApiEndpoint

      @Stability(Stable) @Nullable default Boolean getDisableExecuteApiEndpoint()
      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.

    • getRouteSelectionExpression

      @Stability(Stable) @Nullable default Boolean getRouteSelectionExpression()
      Whether to set the default route selection expression for the API.

      When enabled, "${request.method} ${request.path}" is set as the default route selection expression.

      Default: false

    • builder

      @Stability(Stable) static HttpApiProps.Builder builder()
      Returns:
      a HttpApiProps.Builder of HttpApiProps