Skip to content

Commit 079c1e2

Browse files
authored
chore(apigateway): fix the readme sections order. (#32650)
### Description of changes Fixes the readme sections order to match the original order when `Breaking up Methods and Resources across Stacks` section was originally added in this PR #8270. The current order does not make sense, this section does not related to the Step function backed rest API ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 491475a commit 079c1e2

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

packages/aws-cdk-lib/aws-apigateway/README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ running on AWS Lambda, or any web application.
1212
- [Amazon API Gateway Construct Library](#amazon-api-gateway-construct-library)
1313
- [Table of Contents](#table-of-contents)
1414
- [Defining APIs](#defining-apis)
15+
- [Breaking up Methods and Resources across Stacks](#breaking-up-methods-and-resources-across-stacks)
1516
- [AWS Lambda-backed APIs](#aws-lambda-backed-apis)
1617
- [AWS StepFunctions backed APIs](#aws-stepfunctions-backed-apis)
17-
- [Breaking up Methods and Resources across Stacks](#breaking-up-methods-and-resources-across-stacks)
1818
- [Integration Targets](#integration-targets)
1919
- [Usage Plan \& API Keys](#usage-plan--api-keys)
2020
- [Adding an API Key to an imported RestApi](#adding-an-api-key-to-an-imported-restapi)
@@ -76,6 +76,23 @@ const method = api.root.addResource('books').addMethod('GET');
7676
method.grantExecute(user);
7777
```
7878

79+
### Breaking up Methods and Resources across Stacks
80+
81+
It is fairly common for REST APIs with a large number of Resources and Methods to hit the [CloudFormation
82+
limit](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) of 500 resources per
83+
stack.
84+
85+
To help with this, Resources and Methods for the same REST API can be re-organized across multiple stacks. A common
86+
way to do this is to have a stack per Resource or groups of Resources, but this is not the only possible way.
87+
The following example uses sets up two Resources '/pets' and '/books' in separate stacks using nested stacks:
88+
89+
[Resources grouped into nested stacks](test/integ.restapi-import.lit.ts)
90+
91+
> **Warning:** In the code above, an API Gateway deployment is created during the initial CDK deployment.
92+
However, if there are changes to the resources in subsequent CDK deployments, a new API Gateway deployment is not
93+
automatically created. As a result, the latest state of the resources is not reflected. To ensure the latest state
94+
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.
95+
7996
## AWS Lambda-backed APIs
8097

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

258-
### Breaking up Methods and Resources across Stacks
259-
260-
It is fairly common for REST APIs with a large number of Resources and Methods to hit the [CloudFormation
261-
limit](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) of 500 resources per
262-
stack.
263-
264-
To help with this, Resources and Methods for the same REST API can be re-organized across multiple stacks. A common
265-
way to do this is to have a stack per Resource or groups of Resources, but this is not the only possible way.
266-
The following example uses sets up two Resources '/pets' and '/books' in separate stacks using nested stacks:
267-
268-
[Resources grouped into nested stacks](test/integ.restapi-import.lit.ts)
269-
270-
> **Warning:** In the code above, an API Gateway deployment is created during the initial CDK deployment.
271-
However, if there are changes to the resources in subsequent CDK deployments, a new API Gateway deployment is not
272-
automatically created. As a result, the latest state of the resources is not reflected. To ensure the latest state
273-
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.
274-
275275
## Integration Targets
276276

277277
Methods are associated with backend integrations, which are invoked when this

0 commit comments

Comments
 (0)