- class aws_cdk.aws_apigateway.IRestApi(*args, **kwds)
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (
- Return type:
- arn_for_execute_api(method=None, path=None, stage=None)
Gets the “execute-api” ARN.
str]) – The method (default
str]) – The resource path. Must start with ‘/’ (default
str]) – The stage (default
“*” returns the execute API ARN for all methods/resources in this API.
- Return type:
The “execute-api” ARN.
API Gateway stage that points to the latest deployment (if defined).
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
API Gateway deployment that represents the latest changes of the API.
This resource will be automatically updated every time the REST API model changes.
undefinedwhen no deployment is configured.
The construct tree node for this construct.
The ID of this API Gateway RestApi.
The resource ID of the root resource.
api.root.addMethod(‘ANY’, redirectToHomePage); // “ANY /” api.root.addResource(‘friends’).addMethod(‘GET’, getFriendsHandler); // “GET /friends”
Represents the root resource (“/”) of this API. Use it to define the API model
The stack in which this resource is defined.