aws-cdk-lib.aws_apigateway.S3ApiDefinition

class S3ApiDefinition

LanguageType name
.NETAmazon.CDK.AWS.APIGateway.S3ApiDefinition
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#S3ApiDefinition
Javasoftware.amazon.awscdk.services.apigateway.S3ApiDefinition
Pythonaws_cdk.aws_apigateway.S3ApiDefinition
TypeScript (source)aws-cdk-lib » aws_apigateway » S3ApiDefinition

Extends ApiDefinition

OpenAPI specification from an S3 archive.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_apigateway as apigateway } from 'aws-cdk-lib';
import { aws_s3 as s3 } from 'aws-cdk-lib';

declare const bucket: s3.Bucket;
const s3ApiDefinition = new apigateway.S3ApiDefinition(bucket, 'key', /* all optional props */ 'objectVersion');

Initializer

new S3ApiDefinition(bucket: IBucket, key: string, objectVersion?: string)

Parameters

  • bucket IBucket
  • key string
  • objectVersion string

Methods

NameDescription
bind(_scope)Called when the specification is initialized to allow this object to bind to the stack, add resources and have fun.
bindAfterCreate(_scope, _restApi)Called after the CFN RestApi resource has been created to allow the Api Definition to bind to it.

bind(_scope)

public bind(_scope: Construct): ApiDefinitionConfig

Parameters

  • _scope Construct

Returns

  • ApiDefinitionConfig

Called when the specification is initialized to allow this object to bind to the stack, add resources and have fun.


bindAfterCreate(_scope, _restApi)

public bindAfterCreate(_scope: Construct, _restApi: IRestApi): void

Parameters

  • _scope Construct
  • _restApi IRestApi

Called after the CFN RestApi resource has been created to allow the Api Definition to bind to it.

Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.