Skip to content

Commit 625e862

Browse files
Adding build tools page
1 parent 0f6f5a2 commit 625e862

File tree

7 files changed

+16
-19
lines changed

7 files changed

+16
-19
lines changed

docs/build_recipes/build-tools.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ description: Package Lambda functions using different build tools and dependency
77

88
This guide covers different build tools and dependency managers for packaging Lambda functions with Powertools for AWS Lambda (Python). Each tool has its strengths and is optimized for different use cases.
99

10+
???+ info "Requirements file security"
11+
For simplicity, examples in this guide use `requirements.txt` with pinned versions. In production environments, you should use hash-checking for enhanced security by including `--hash` flags. Learn more about [secure package installation](https://pip.pypa.io/en/stable/topics/secure-installs/){target="_blank"} in the pip documentation.
12+
1013
## pip
1114

1215
**pip** is Python's standard package installer - simple, reliable, and available everywhere. Perfect for straightforward Lambda functions where you need basic dependency management without complex workflows.
@@ -19,7 +22,9 @@ This guide covers different build tools and dependency managers for packaging La
1922
=== "requirements.txt"
2023

2124
```bash
22-
--8<-- "examples/build_recipes/pip/requirements.txt"
25+
aws-lambda-powertools[all]==3.18.0
26+
pydantic==2.10.4
27+
requests>=2.32.4
2328
```
2429

2530
=== "app_pip.py"
@@ -41,13 +46,14 @@ Optimize your deployment by using Lambda Layers for Powertools for AWS:
4146
=== "requirements-layer.txt"
4247

4348
```bash
44-
--8<-- "examples/build_recipes/pip/requirements-layer.txt"
49+
aws-lambda-powertools[all]==3.18.0
4550
```
4651

4752
=== "requirements-app.txt"
4853

4954
```bash
50-
--8<-- "examples/build_recipes/pip/requirements-app.txt"
55+
pydantic==2.10.4
56+
requests>=2.32.4
5157
```
5258

5359
=== "app_pip.py"
@@ -248,7 +254,9 @@ Simple approach where all dependencies are packaged with the function code:
248254
=== "requirements.txt"
249255

250256
```txt
251-
--8<-- "examples/build_recipes/sam/no-layers/requirements.txt"
257+
aws-lambda-powertools[all]==3.18.0
258+
pydantic==2.10.4
259+
requests>=2.32.4
252260
```
253261

254262
=== "src/app_sam_no_layer.py"
@@ -279,7 +287,8 @@ Optimized approach using Lambda Layers to separate dependencies from application
279287
=== "layers/dependencies/requirements.txt"
280288

281289
```txt
282-
--8<-- "examples/build_recipes/sam/with-layers/layers/dependencies/requirements.txt"
290+
pydantic==2.10.4
291+
requests>=2.32.4
283292
```
284293

285294
=== "src/app/app_sam_layer.py"
@@ -384,7 +393,8 @@ Before starting, ensure you have:
384393
=== "requirements.txt"
385394

386395
```txt
387-
--8<-- "examples/build_recipes/cdk/basic/requirements.txt"
396+
aws-cdk-lib>=2.100.0
397+
constructs>=10.0.0
388398
```
389399

390400
=== "src/lambda_function.py"

examples/build_recipes/cdk/basic/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/build_recipes/pip/requirements-app.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/build_recipes/pip/requirements-layer.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/build_recipes/pip/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/build_recipes/sam/no-layers/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

examples/build_recipes/sam/with-layers/layers/dependencies/requirements.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)