Skip to content
v2.278.0

IRestApi Interface ​

Properties ​

deploymentStageStagedeployment_stageStagedeploymentStageStageDeploymentStageStageDeploymentStageStage #
API Gateway stage that points to the latest deployment (if defined).
The environment this resource belongs to.
notes

For resources that are created and managed in a Stack (those created by creating new class instances like new Role(), new Bucket(), etc.), this is always the same as the environment of the stack they belong to.

For referenced resources (those obtained from referencing methods like Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be different than the stack they were imported into.

latestDeploymentmay be undefinedDeploymentlatest_deploymentmay be undefinedDeploymentlatestDeploymentmay be undefinedDeploymentLatestDeploymentmay be undefinedDeploymentLatestDeploymentmay be undefinedDeployment #
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.

nodeNodenodeNodenodeNodeNodeNodeNodeNode #
The tree node.
restApiIdstringrest_api_idstrrestApiIdStringRestApiIdstringRestApiId*string #
The ID of this API Gateway RestApi.
restApiNamestringrest_api_namestrrestApiNameStringRestApiNamestringRestApiName*string #
The name of this API Gateway RestApi.
A reference to a RestApi resource.
restApiRootResourceIdstringrest_api_root_resource_idstrrestApiRootResourceIdStringRestApiRootResourceIdstringRestApiRootResourceId*string #
The resource ID of the root resource.
Represents the root resource ("/") of this API. Use it to define the API model:.

api.root.addMethod('ANY', redirectToHomePage); // "ANY /" api.root.addResource('friends').addMethod('GET', getFriendsHandler); // "GET /friends"

stackStackstackStackstackStackStackStackStackStack #
The stack in which this resource is defined.

Methods ​

applyRemovalPolicy(policy: RemovalPolicy): voiddef apply_removal_policy(self, policy: RemovalPolicy) -> Nonepublic void applyRemovalPolicy(RemovalPolicy policy)public void ApplyRemovalPolicy(RemovalPolicy policy)func ApplyRemovalPolicy(Policy RemovalPolicy) #
Apply the given removal policy to this resource.
notes

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 (RemovalPolicy.RETAIN).

arnForExecuteApi(method?: string, path?: string, stage?: string): stringdef arn_for_execute_api(self, method: typing.Optional[str] = None, path: typing.Optional[str] = None, stage: typing.Optional[str] = None) -> strpublic String arnForExecuteApi(String method, String path, String stage)public string ArnForExecuteApi(string? method = null, string? path = null, string? stage = null)func ArnForExecuteApi(Method *string, Path *string, Stage *string) *string #
Gets the "execute-api" ARN.
3 parameters · returns

Parameters

  • methodmethodmethodmethodMethod — The method (default *).
  • pathpathpathpathPath — The resource path.
  • stagestagestagestageStage — The stage (default *).

Returns: The "execute-api" ARN.

with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct #
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining