File tree Expand file tree Collapse file tree 5 files changed +149
-7
lines changed Expand file tree Collapse file tree 5 files changed +149
-7
lines changed Original file line number Diff line number Diff line change 1+ ```text
2+ ├── app
3+ │ └── hello.js
4+ ├── build.gradle
5+ ├── clean-up.sh
6+ ├── deploy-all.sh
7+ ├── device-api
8+ │ ├── bin
9+ │ │ └── index.ts
10+ │ ├── cdk.json
11+ │ ├── config.ts
12+ │ ├── jest.config.js
13+ │ └── lib
14+ │ └── device-api-stack.ts
15+ ├── package-lock.json
16+ ├── package.json
17+ ├── product-api
18+ │ ├── bin
19+ │ │ └── index.ts
20+ │ ├── cdk.json
21+ │ ├── config.ts
22+ │ ├── jest.config.js
23+ │ └── lib
24+ │ └── product-api-stack.ts
25+ ├── root-api
26+ │ ├── bin
27+ │ │ └── index.ts
28+ │ ├── cdk.json
29+ │ ├── config.ts
30+ │ ├── jest.config.js
31+ │ └── lib
32+ │ └── root-api-stack.ts
33+ ├── screenshots
34+ │ └── apigw.png
35+ └── tsconfig.json
36+ ```
Original file line number Diff line number Diff line change @@ -31,14 +31,18 @@ Use the `cdk` command-line toolkit to interact with your project:
3131
3232| Stack | Time |
3333| -------------------------------| ---------|
34- | root-api (24kb) | 1m 30s |
35- | device-api (24kb) | 1m 30s |
36- | product-api (20kb) | 1m 30s |
34+ | root-api (24kb) | 1m 30s |
35+ | device-api (24kb) | 1m 30s |
36+ | product-api (20kb) | 1m 30s |
3737| Total | 4m 30s |
3838
39+ ## Steps
40+
41+ Use the [ deploy-all.sh] ( ./deploy-all.sh ) file if you want to deploy all stacks without prompt at a time.
42+
3943### Step 1: root-api
4044
41- Create the Root API and dummy method to import from device-api and product-api.
45+ Create the root API and dummy method to import from device-api and product-api stacks .
4246
4347``` bash
4448cd root-api
@@ -75,7 +79,54 @@ SSM parameter:
7579* /cdk-lambda-apigateway/rest-api-id
7680* /cdk-lambda-apigateway/root-resource-id
7781
78- ### Reference
82+ ## Clean Up
83+
84+ [ clean-up.sh] ( ./clean-up.sh )
85+
86+ ## Structure
87+
88+ ``` text
89+ ├── app
90+ │ └── hello.js
91+ ├── build.gradle
92+ ├── clean-up.sh
93+ ├── deploy-all.sh
94+ ├── device-api
95+ │ ├── bin
96+ │ │ └── index.ts
97+ │ ├── cdk.json
98+ │ ├── config.ts
99+ │ ├── jest.config.js
100+ │ └── lib
101+ │ └── device-api-stack.ts
102+ ├── package-lock.json
103+ ├── package.json
104+ ├── product-api
105+ │ ├── bin
106+ │ │ └── index.ts
107+ │ ├── cdk.json
108+ │ ├── config.ts
109+ │ ├── jest.config.js
110+ │ └── lib
111+ │ └── product-api-stack.ts
112+ ├── root-api
113+ │ ├── bin
114+ │ │ └── index.ts
115+ │ ├── cdk.json
116+ │ ├── config.ts
117+ │ ├── jest.config.js
118+ │ └── lib
119+ │ └── root-api-stack.ts
120+ ├── screenshots
121+ │ └── apigw.png
122+ └── tsconfig.json
123+ ```
124+ ## Reference
125+
126+ * [ CloudFormation quotas] ( https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html )
127+ * Template body size: 512k
128+ * Template body size in an Amazon S3: 1M
129+
130+ ### CDK Lib
79131
80- * Template body size: 512k
81- * Template body size in an Amazon S3: 1M
132+ * [ API Gateway] ( https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway-readme.html )
Original file line number Diff line number Diff line change 1+ apply plugin : ' base'
2+ apply plugin : ' org.sonarqube'
3+ archivesBaseName = ' cdk-lambda-apigateway'
4+
5+ buildscript {
6+ repositories {
7+ mavenCentral()
8+ }
9+ dependencies {
10+ classpath(" org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5" )
11+ }
12+ }
13+
14+ sonarqube {
15+ properties {
16+ property " sonar.projectName" , " cdk-lambda-apigateway"
17+ property " sonar.projectKey" , " cdk-lambda-apigateway"
18+ property " sonar.sourceEncoding" , " UTF-8"
19+ property " sonar.sources" , " ."
20+ property " sonar.exclusions" , " **/node_modules/**"
21+ property " sonar.cpd.exclusions" , " **/*index.ts"
22+ property " sonar.links.ci" , " https://github.com/engel80/cdk-lambda-apigateway"
23+ property " sonar.log.level" , " DEBUG"
24+ }
25+ }
Original file line number Diff line number Diff line change 1+
2+ find . -name " cdk.out" -exec rm -rf {} \;
3+ find . -name " cdk.context.json" -exec rm -f {} \;
4+
5+ echo " destroy product-api"
6+ cd product-api
7+ cdk destroy
8+
9+ echo " destroy device-api"
10+ cd ../device-api
11+ cdk destroy
12+
13+ echo " destroy root-api"
14+ cd ../root-api
15+ cdk destroy
16+
17+ rm -rf " node_modules" ;
Original file line number Diff line number Diff line change 1+ find . -name " cdk.context.json" -exec rm -f {} \;
2+
3+ echo " Deploy root-api"
4+ cd ./root-api
5+ cdk deploy --require-approval never
6+
7+ echo " Deploy device-api"
8+ cd ../device-api
9+ cdk deploy --require-approval never
10+
11+ echo " Deploy product-api"
12+ cd ../product-api
13+ cdk deploy --require-approval never
You can’t perform that action at this time.
0 commit comments