The type definition for the API paths.
The type definition for the API operations.
Creates an instance of RestApi.
The scope in which this construct is defined.
The scoped construct ID.
The properties of the RestApi construct.
Private
_functionsA collection of Lambda functions used as integrations for the API operations.
Readonly
apiThe AWS API Gateway REST API instance.
Protected
Optional
Readonly
apiProtected
Optional
Readonly
apiFQDNProtected
Optional
Readonly
apiReadonly
apiThe OpenAPI specification for the REST API.
Protected
Optional
Readonly
hostedReadonly
nodeThe tree node.
Private
propsThe properties of the RestApi construct.
Protected
cleanupreturn the generated Lambda function for the specified API operation
return a list of all generated Lambda functions
Visitor method to modify the given functions
the list of functions to visit
the function to call for every function
Protected
patchAWS does not properly apply the 'security' option to every single path-method. According to documentation, global security gets applied, if there is no security set for the particular path-method. If there is any, even empty, it will get precedence. THIS DOES NOT HAPPEN ON AWS. IT JUST ALWAYS USES THE GLOBAL SETTING!
'security applies [...] schemes globally to all API operations, unless overridden on the operation level'
Private
tableStatic
isChecks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
Any object
true if x
is an object created from a class which extends Construct
.
Generated using TypeDoc
The RestApi construct sets up an AWS API Gateway REST API using OpenAPI specification. This construct facilitates the creation of a REST API with various configurations, including custom domain, CORS support, and integration with Lambda functions. It allows auto-generating routes based on the provided OpenAPI definition and provides methods to dynamically add custom routes and manage Lambda function integrations.
Example