aws-cdk-lib.aws_apigateway.InlineApiDefinition

class InlineApiDefinition

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

Extends ApiDefinition

OpenAPI specification from an inline JSON object.

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';

declare const definition: any;
const inlineApiDefinition = new apigateway.InlineApiDefinition(definition);

Initializer

new InlineApiDefinition(definition: any)

Parameters

  • definition any

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.