IRestApi

class aws_cdk.aws_apigateway.IRestApi(*args, **kwargs)

Bases: aws_cdk.core.IResource, typing_extensions.Protocol

__init__(*args, **kwargs)

Methods

arn_for_execute_api(method=None, path=None, stage=None)

Gets the “execute-api” ARN.

Parameters
  • method (Optional[str]) – The method (default *).

  • path (Optional[str]) – The resource path. Must start with ‘/’ (default *)

  • stage (Optional[str]) – The stage (default *).

default :default:

“*” returns the execute API ARN for all methods/resources in this API.

return :rtype: str :return: The “execute-api” ARN.

Attributes

deployment_stage

API Gateway stage that points to the latest deployment (if defined).

Return type

Stage

latest_deployment

API Gateway deployment that represents the latest changes of the API.

This resource will be automatically updated every time the REST API model changes. undefined when no deployment is configured.

Return type

Optional[Deployment]

node

The construct tree node for this construct.

Return type

ConstructNode

rest_api_id

The ID of this API Gateway RestApi.

attribute: :attribute:: true

Return type

str

rest_api_root_resource_id

The resource ID of the root resource.

attribute: :attribute:: true

Return type

str

root

.

api.root.addMethod(‘ANY’, redirectToHomePage); // “ANY /” api.root.addResource(‘friends’).addMethod(‘GET’, getFriendsHandler); // “GET /friends”

Type

Represents the root resource (“/”) of this API. Use it to define the API model

Return type

IResource

stack

The stack in which this resource is defined.

Return type

Stack