Skip to content

Commit e04f3cd

Browse files
authored
docs(maintenance): update examples to v2 (#2242)
* docs(examples): refresh cdk example * docs(examples): refresh cdk example * docs: update template & functions * chore: update arch to arm * chore: update comments & confis * chore: removed sam folder & merged samples * chore: fix tests * chore: reliability
1 parent bfeae84 commit e04f3cd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1876
-2254
lines changed

.github/boring-cyborg.yml

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,7 @@ labelPRBasedOnFilePath:
7171
- docs/**/*
7272
- mkdocs.yml
7373
- typedoc.js
74-
- examples/cdk/bin/*
75-
- examples/cdk/functions/*
76-
- examples/cdk/functions/**/*
77-
- examples/cdk/src/*
78-
- examples/cdk/src/**/*
79-
- examples/cdk/tests/*
80-
- examples/cdk/tests/**/*
81-
- examples/cdk/README.md
82-
- examples/cdk/cdk.json
83-
- examples/sam/events/*
84-
- examples/sam/src/*
85-
- examples/sam/src/**/*
86-
- examples/sam/tests/*
87-
- examples/sam/tests/**/*
88-
- examples/sam/README.md
89-
- examples/sam/template.yaml
74+
- examples/app/*
9075

9176
area/automation:
9277
- .github/scripts/*
@@ -137,8 +122,7 @@ labelPRBasedOnFilePath:
137122
- packages/parser/README.md
138123
- layers/tsconfig*.json
139124
- layers/README.md
140-
- examples/sam/tsconfig*.json
141-
- examples/cdk/tsconfig*.json
125+
- examples/app/tsconfig*.json
142126

143127
type/dependencies:
144128
- package.json
@@ -153,8 +137,7 @@ labelPRBasedOnFilePath:
153137
- packages/validator/package.json
154138
- packages/batch/package.json
155139
- layers/package.json
156-
- examples/cdk/package.json
157-
- examples/sam/package.json
140+
- examples/app/package.json
158141

159142
##### Greetings ########################################################################################################
160143
firstPRWelcomeComment: >

.github/workflows/reusable-run-linting-check-and-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
NODE_ENV: dev
3838
strategy:
3939
matrix:
40-
example: ["sam", "cdk"]
40+
example: ["app"]
4141
fail-fast: false
4242
defaults:
4343
run:

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ site
4141
# Generated API documentation (from TypeDoc)
4242
/api
4343

44-
# SAM Example copies files
45-
/examples/sam/src/handlers/*
46-
!/examples/sam/src/handlers/COPY_LAMBDA_FUNCTIONS_HERE
47-
4844
# Layer temp files
4945
tmp
5046

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ Or refer to the installation guide of each utility:
8484

8585
### Examples
8686

87-
* [CDK](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/cdk)
88-
* [SAM](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/sam)
87+
You can find examples of how to use Powertools for AWS Lambda (TypeScript) in the [examples](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/app) directory. The application is a simple REST API that can be deployed via either AWS CDK or AWS SAM.
8988

9089
### Demo applications
9190

docs/contributing/conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Whenever possible, we use the same directory structure for all utilities. This m
3131
There are also a few other workspaces that are not utilities published to npm, but that still share dependencies and/or runtime code with the utilities. These workspaces are:
3232

3333
* `docs/snippets`: contains the documentation code snippets
34-
* `examples/*`: contains the example projects deployed via AWS CDK or AWS SAM
34+
* `examples/app`: contains an example project that can be deployed via AWS CDK or AWS SAM
3535
* `layers`: contains the code used to build and publish the [Lambda layers](../index.md#lambda-layer)
3636

3737
## Testing definition

docs/index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,9 @@ The examples in this documentation will feature all the approaches described abo
272272

273273
## Examples
274274

275-
The project's repository includes examples of how to instrument your functions both in AWS CDK and AWS SAM:
275+
You can find examples of how to use Powertools for AWS Lambda (TypeScript) in the [examples](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/app){target="_blank"} directory. The application is a simple REST API that can be deployed via either AWS CDK or AWS SAM.
276276

277-
* [AWS CDK](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/cdk){target="_blank"}
278-
* [AWS SAM](https://github.com/aws-powertools/powertools-lambda-typescript/tree/main/examples/sam){target="_blank"}
279-
280-
If instead you want to see Powertools for AWS Lambda (TypeScript) in a slightly more complex use case, check the [Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo) or the [AWS Lambda performance tuning](https://github.com/aws-samples/optimizations-for-lambda-functions) repository. Both demos use Powertools for AWS Lambda (TypeScript) as well as demonstrating other common techniques for Lambda functions written in TypeScript.
277+
If instead you want to see Powertools for AWS Lambda (TypeScript) in slightly different use cases, check the [Serverless TypeScript Demo](https://github.com/aws-samples/serverless-typescript-demo) or the [AWS Lambda performance tuning](https://github.com/aws-samples/optimizations-for-lambda-functions) repository. Both demos use Powertools for AWS Lambda (TypeScript) as well as demonstrating other common techniques for Lambda functions written in TypeScript.
281278

282279

283280
## Features

examples/cdk/.gitignore renamed to examples/app/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,13 @@ node_modules
88
.cdk.staging
99
cdk.out
1010
lib
11+
# npm lock file - this is managed by the npm workspace
12+
package-lock.json
13+
14+
**/.aws-sam
15+
16+
# SAM
17+
samconfig.toml
18+
1119
# npm lock file - this is managed by the npm workspace
1220
package-lock.json
File renamed without changes.
File renamed without changes.

examples/cdk/cdk.json renamed to examples/app/cdk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"app": "npx ts-node --prefer-ts-exts bin/cdk-app.ts",
2+
"app": "tsx cdk/example-app.ts",
33
"watch": {
44
"include": [
55
"**"

0 commit comments

Comments
 (0)