Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(apigateway): fix the readme sections order. #32650

Merged
merged 2 commits into from
Dec 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions packages/aws-cdk-lib/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ running on AWS Lambda, or any web application.
- [Amazon API Gateway Construct Library](#amazon-api-gateway-construct-library)
- [Table of Contents](#table-of-contents)
- [Defining APIs](#defining-apis)
- [Breaking up Methods and Resources across Stacks](#breaking-up-methods-and-resources-across-stacks)
- [AWS Lambda-backed APIs](#aws-lambda-backed-apis)
- [AWS StepFunctions backed APIs](#aws-stepfunctions-backed-apis)
- [Breaking up Methods and Resources across Stacks](#breaking-up-methods-and-resources-across-stacks)
- [Integration Targets](#integration-targets)
- [Usage Plan \& API Keys](#usage-plan--api-keys)
- [Adding an API Key to an imported RestApi](#adding-an-api-key-to-an-imported-restapi)
Expand Down Expand Up @@ -76,6 +76,23 @@ const method = api.root.addResource('books').addMethod('GET');
method.grantExecute(user);
```

### Breaking up Methods and Resources across Stacks

It is fairly common for REST APIs with a large number of Resources and Methods to hit the [CloudFormation
limit](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) of 500 resources per
stack.

To help with this, Resources and Methods for the same REST API can be re-organized across multiple stacks. A common
way to do this is to have a stack per Resource or groups of Resources, but this is not the only possible way.
The following example uses sets up two Resources '/pets' and '/books' in separate stacks using nested stacks:

[Resources grouped into nested stacks](test/integ.restapi-import.lit.ts)

> **Warning:** In the code above, an API Gateway deployment is created during the initial CDK deployment.
However, if there are changes to the resources in subsequent CDK deployments, a new API Gateway deployment is not
automatically created. As a result, the latest state of the resources is not reflected. To ensure the latest state
of the resources is reflected, a manual deployment of the API Gateway is required after the CDK deployment. See [Controlled triggering of deployments](#controlled-triggering-of-deployments) for more info.

## AWS Lambda-backed APIs

A very common practice is to use Amazon API Gateway with AWS Lambda as the
Expand Down Expand Up @@ -255,23 +272,6 @@ AWS Step Functions will receive the following execution input:
}
```

### Breaking up Methods and Resources across Stacks

It is fairly common for REST APIs with a large number of Resources and Methods to hit the [CloudFormation
limit](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) of 500 resources per
stack.

To help with this, Resources and Methods for the same REST API can be re-organized across multiple stacks. A common
way to do this is to have a stack per Resource or groups of Resources, but this is not the only possible way.
The following example uses sets up two Resources '/pets' and '/books' in separate stacks using nested stacks:

[Resources grouped into nested stacks](test/integ.restapi-import.lit.ts)

> **Warning:** In the code above, an API Gateway deployment is created during the initial CDK deployment.
However, if there are changes to the resources in subsequent CDK deployments, a new API Gateway deployment is not
automatically created. As a result, the latest state of the resources is not reflected. To ensure the latest state
of the resources is reflected, a manual deployment of the API Gateway is required after the CDK deployment. See [Controlled triggering of deployments](#controlled-triggering-of-deployments) for more info.

## Integration Targets

Methods are associated with backend integrations, which are invoked when this
Expand Down
Loading