class S3ApiDefinition
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGateway.S3ApiDefinition |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsapigateway#S3ApiDefinition |
![]() | software.amazon.awscdk.services.apigateway.S3ApiDefinition |
![]() | aws_cdk.aws_apigateway.S3ApiDefinition |
![]() | aws-cdk-lib » aws_apigateway » S3ApiDefinition |
Extends
Api
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
Name | Description |
---|---|
bind(_scope) | Called when the specification is initialized to allow this object to bind to the stack, add resources and have fun. |
bind | 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
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
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.