Class OpenApiGatewayToLambda.Builder

java.lang.Object
software.amazon.awsconstructs.services.openapigatewaylambda.OpenApiGatewayToLambda.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<OpenApiGatewayToLambda>
Enclosing class:
OpenApiGatewayToLambda

public static final class OpenApiGatewayToLambda.Builder extends Object implements software.amazon.jsii.Builder<OpenApiGatewayToLambda>
A fluent builder for OpenApiGatewayToLambda.
  • Method Details

    • create

      public static OpenApiGatewayToLambda.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of OpenApiGatewayToLambda.Builder.
    • apiIntegrations

      public OpenApiGatewayToLambda.Builder apiIntegrations(List<? extends ApiIntegration> apiIntegrations)
      One or more key-value pairs that contain an id for the api integration and either an existing lambda function or an instance of the LambdaProps.

      Example: const apiIntegrations: ApiIntegration[] = [ { id: 'MessagesHandler', lambdaFunctionProps: { runtime: defaults.COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME, handler: 'index.handler', code: lambda.Code.fromAsset(${__dirname}/messages-lambda), } }, { id: 'PhotosHandler', existingLambdaObj: new lambda.Function(this, 'PhotosLambda', { runtime: defaults.COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME, handler: 'index.handler', code: lambda.Code.fromAsset(${__dirname}/photos-lambda), }) } ]

      Parameters:
      apiIntegrations - One or more key-value pairs that contain an id for the api integration and either an existing lambda function or an instance of the LambdaProps. This parameter is required.
      Returns:
      this
    • apiDefinitionAsset

      public OpenApiGatewayToLambda.Builder apiDefinitionAsset(software.amazon.awscdk.services.s3.assets.Asset apiDefinitionAsset)
      Local file asset of the OpenAPI spec file.

      Parameters:
      apiDefinitionAsset - Local file asset of the OpenAPI spec file. This parameter is required.
      Returns:
      this
    • apiDefinitionBucket

      public OpenApiGatewayToLambda.Builder apiDefinitionBucket(software.amazon.awscdk.services.s3.IBucket apiDefinitionBucket)
      S3 Bucket where the OpenAPI spec file is located.

      When specifying this property, apiDefinitionKey must also be specified.

      Parameters:
      apiDefinitionBucket - S3 Bucket where the OpenAPI spec file is located. This parameter is required.
      Returns:
      this
    • apiDefinitionJson

      public OpenApiGatewayToLambda.Builder apiDefinitionJson(Object apiDefinitionJson)
      OpenAPI specification represented in a JSON object to be embedded in the CloudFormation template.

      IMPORTANT - Including the spec in the template introduces a risk of the template growing too big, but there are some use cases that require an embedded spec. Unless your use case explicitly requires an embedded spec you should pass your spec as an S3 asset.

      Parameters:
      apiDefinitionJson - OpenAPI specification represented in a JSON object to be embedded in the CloudFormation template. This parameter is required.
      Returns:
      this
    • apiDefinitionKey

      public OpenApiGatewayToLambda.Builder apiDefinitionKey(String apiDefinitionKey)
      S3 Object name of the OpenAPI spec file.

      When specifying this property, apiDefinitionBucket must also be specified.

      Parameters:
      apiDefinitionKey - S3 Object name of the OpenAPI spec file. This parameter is required.
      Returns:
      this
    • apiGatewayProps

      public OpenApiGatewayToLambda.Builder apiGatewayProps(software.amazon.awscdk.services.apigateway.RestApiBaseProps apiGatewayProps)
      Optional user-provided props to override the default props for the API.

      Default: - Default props are used.

      Parameters:
      apiGatewayProps - Optional user-provided props to override the default props for the API. This parameter is required.
      Returns:
      this
    • internalTransformMemorySize

      public OpenApiGatewayToLambda.Builder internalTransformMemorySize(Number internalTransformMemorySize)
      Optional user-defined memory size for the Lambda function custom resource installed to do the OpenAPI definition transformation.

      This setting does not affect the deployed architecture - only the ability for the Construct to complete its work.

      Defaults to 1024 MiB, but for larger files (hundreds of megabytes or gigabytes in size) this value may need to be increased.

      Default: 1024

      Parameters:
      internalTransformMemorySize - Optional user-defined memory size for the Lambda function custom resource installed to do the OpenAPI definition transformation. This parameter is required.
      Returns:
      this
    • internalTransformTimeout

      public OpenApiGatewayToLambda.Builder internalTransformTimeout(software.amazon.awscdk.Duration internalTransformTimeout)
      Optional user-defined timeout for the Lambda function custom resource installed to do the OpenAPI definition transformation.

      This setting does not affect the deployed architecture - only the ability for the Construct to complete its work.

      Defaults to 1 minute, but for larger files (hundreds of megabytes or gigabytes in size) this value may need to be increased.

      Default: Duration.minutes(1)

      Parameters:
      internalTransformTimeout - Optional user-defined timeout for the Lambda function custom resource installed to do the OpenAPI definition transformation. This parameter is required.
      Returns:
      this
    • logGroupProps

      public OpenApiGatewayToLambda.Builder logGroupProps(software.amazon.awscdk.services.logs.LogGroupProps logGroupProps)
      User provided props to override the default props for the CloudWatchLogs LogGroup.

      Default: - Default props are used

      Parameters:
      logGroupProps - User provided props to override the default props for the CloudWatchLogs LogGroup. This parameter is required.
      Returns:
      this
    • build

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