Skip to content

Commit f0b565d

Browse files
authored
Merge branch 'master' into add-new-attribute-code-sha256
2 parents cd0c6f4 + 3aa5b7e commit f0b565d

File tree

44 files changed

+235
-202
lines changed

Some content is hidden

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

44 files changed

+235
-202
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.89.1
3+
rev: v1.91.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_wrapper_module_for_each

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [7.6.0](https://github.com/terraform-aws-modules/terraform-aws-lambda/compare/v7.5.0...v7.6.0) (2024-06-12)
6+
7+
8+
### Features
9+
10+
* Support passing extra args to poetry export ([#584](https://github.com/terraform-aws-modules/terraform-aws-lambda/issues/584)) ([3aa288f](https://github.com/terraform-aws-modules/terraform-aws-lambda/commit/3aa288fee324e64a8db409e5a32abaeebe38e6c2))
11+
12+
## [7.5.0](https://github.com/terraform-aws-modules/terraform-aws-lambda/compare/v7.4.0...v7.5.0) (2024-06-07)
13+
14+
15+
### Features
16+
17+
* Renamed python3.8-11 to python3.12 in examples, added tag to resources ([#583](https://github.com/terraform-aws-modules/terraform-aws-lambda/issues/583)) ([02ab668](https://github.com/terraform-aws-modules/terraform-aws-lambda/commit/02ab668458c87792861a54f54fd1b00e97afcc68))
18+
519
## [7.4.0](https://github.com/terraform-aws-modules/terraform-aws-lambda/compare/v7.3.0...v7.4.0) (2024-05-03)
620

721

README.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module "lambda_function" {
3737
function_name = "my-lambda1"
3838
description = "My awesome lambda function"
3939
handler = "index.lambda_handler"
40-
runtime = "python3.8"
40+
runtime = "python3.12"
4141
4242
source_path = "../src/lambda-function1"
4343
@@ -56,7 +56,7 @@ module "lambda_function" {
5656
function_name = "lambda-with-layer"
5757
description = "My awesome lambda function"
5858
handler = "index.lambda_handler"
59-
runtime = "python3.8"
59+
runtime = "python3.12"
6060
publish = true
6161
6262
source_path = "../src/lambda-function1"
@@ -84,7 +84,7 @@ module "lambda_layer_s3" {
8484
8585
layer_name = "lambda-layer-s3"
8686
description = "My amazing lambda layer (deployed from S3)"
87-
compatible_runtimes = ["python3.8"]
87+
compatible_runtimes = ["python3.12"]
8888
8989
source_path = "../src/lambda-layer"
9090
@@ -102,7 +102,7 @@ module "lambda_function_existing_package_local" {
102102
function_name = "my-lambda-existing-package-local"
103103
description = "My awesome lambda function"
104104
handler = "index.lambda_handler"
105-
runtime = "python3.8"
105+
runtime = "python3.12"
106106
107107
create_package = false
108108
local_existing_package = "../existing_package.zip"
@@ -126,7 +126,7 @@ module "lambda_function_externally_managed_package" {
126126
function_name = "my-lambda-externally-managed-package"
127127
description = "My lambda function code is deployed separately"
128128
handler = "index.lambda_handler"
129-
runtime = "python3.8"
129+
runtime = "python3.12"
130130
131131
create_package = false
132132
local_existing_package = "./lambda_functions/code.zip"
@@ -161,7 +161,7 @@ module "lambda_function_existing_package_s3" {
161161
function_name = "my-lambda-existing-package-local"
162162
description = "My awesome lambda function"
163163
handler = "index.lambda_handler"
164-
runtime = "python3.8"
164+
runtime = "python3.12"
165165
166166
create_package = false
167167
s3_existing_package = {
@@ -197,9 +197,9 @@ module "lambda_layer_local" {
197197
198198
layer_name = "my-layer-local"
199199
description = "My amazing lambda layer (deployed from local)"
200-
compatible_runtimes = ["python3.8"]
200+
compatible_runtimes = ["python3.12"]
201201
202-
source_path = "../fixtures/python3.8-app1"
202+
source_path = "../fixtures/python-app1"
203203
}
204204
205205
module "lambda_layer_s3" {
@@ -209,9 +209,9 @@ module "lambda_layer_s3" {
209209
210210
layer_name = "my-layer-s3"
211211
description = "My amazing lambda layer (deployed from S3)"
212-
compatible_runtimes = ["python3.8"]
212+
compatible_runtimes = ["python3.12"]
213213
214-
source_path = "../fixtures/python3.8-app1"
214+
source_path = "../fixtures/python-app1"
215215
216216
store_on_s3 = true
217217
s3_bucket = "my-bucket-id-with-lambda-builds"
@@ -231,9 +231,9 @@ module "lambda_at_edge" {
231231
function_name = "my-lambda-at-edge"
232232
description = "My awesome lambda@edge function"
233233
handler = "index.lambda_handler"
234-
runtime = "python3.8"
234+
runtime = "python3.12"
235235
236-
source_path = "../fixtures/python3.8-app1"
236+
source_path = "../fixtures/python-app1"
237237
238238
tags = {
239239
Module = "lambda-at-edge"
@@ -250,9 +250,9 @@ module "lambda_function_in_vpc" {
250250
function_name = "my-lambda-in-vpc"
251251
description = "My awesome lambda function"
252252
handler = "index.lambda_handler"
253-
runtime = "python3.8"
253+
runtime = "python3.12"
254254
255-
source_path = "../fixtures/python3.8-app1"
255+
source_path = "../fixtures/python-app1"
256256
257257
vpc_subnet_ids = module.vpc.intra_subnets
258258
vpc_security_group_ids = [module.vpc.default_security_group_id]
@@ -396,12 +396,12 @@ source_path = [
396396
"!.*/.*\\.txt", # Skip all txt files recursively
397397
]
398398
}, {
399-
path = "src/python3.8-app1",
399+
path = "src/python-app1",
400400
pip_requirements = true,
401401
pip_tmp_dir = "/tmp/dir/location"
402402
prefix_in_zip = "foo/bar1",
403403
}, {
404-
path = "src/python3.8-app2",
404+
path = "src/python-app2",
405405
pip_requirements = "requirements-large.txt",
406406
patterns = [
407407
"!vendor/colorful-0.5.4.dist-info/RECORD",
@@ -414,7 +414,7 @@ source_path = [
414414
npm_tmp_dir = "/tmp/dir/location"
415415
prefix_in_zip = "foo/bar1",
416416
}, {
417-
path = "src/python3.8-app3",
417+
path = "src/python-app3",
418418
commands = [
419419
"npm install",
420420
":zip"
@@ -424,7 +424,7 @@ source_path = [
424424
"node_modules/.+", # Include all node_modules
425425
],
426426
}, {
427-
path = "src/python3.8-app3",
427+
path = "src/python-app3",
428428
commands = ["go build"],
429429
patterns = <<END
430430
bin/.*
@@ -459,6 +459,7 @@ source_path = [
459459
- `pip_requirements` - Controls whether to execute `pip install`. Set to `false` to disable this feature, `true` to run `pip install` with `requirements.txt` found in `path`. Or set to another filename which you want to use instead. When `source_path` is passed as a string containing a path (and not a list of maps), and `requirements.txt` is present, `pip install` is automatically executed.
460460
- `pip_tmp_dir` - Set the base directory to make the temporary directory for pip installs. Can be useful for Docker in Docker builds.
461461
- `poetry_install` - Controls whether to execute `poetry export` and `pip install`. Set to `false` to disable this feature, `true` to run `poetry export` with `pyproject.toml` and `poetry.lock` found in `path`. When `source_path` is passed as a string containing a path (and not a list of maps), and `pyproject.toml` with a build system `poetry` is present, `poetry export` and `pip install` are automatically executed.
462+
- `poetry_export_extra_args` - A list of additional poetry arguments to add to the poetry export command
462463
- `npm_requirements` - Controls whether to execute `npm install`. Set to `false` to disable this feature, `true` to run `npm install` with `package.json` found in `path`. Or set to another filename which you want to use instead.
463464
- `npm_tmp_dir` - Set the base directory to make the temporary directory for npm installs. Can be useful for Docker in Docker builds.
464465
- `prefix_in_zip` - If specified, will be used as a prefix inside zip-archive. By default, everything installs into the root of zip-archive.
@@ -468,16 +469,16 @@ source_path = [
468469
If your Lambda Function or Layer uses some dependencies you can build them in Docker and have them included into deployment package. Here is how you can do it:
469470

470471
build_in_docker = true
471-
docker_file = "src/python3.8-app1/docker/Dockerfile"
472-
docker_build_root = "src/python3.8-app1/docker"
473-
docker_image = "public.ecr.aws/sam/build-python3.8"
474-
runtime = "python3.8" # Setting runtime is required when building package in Docker and Lambda Layer resource.
472+
docker_file = "src/python-app1/docker/Dockerfile"
473+
docker_build_root = "src/python-app1/docker"
474+
docker_image = "public.ecr.aws/sam/build-python"
475+
runtime = "python3.12" # Setting runtime is required when building package in Docker and Lambda Layer resource.
475476

476477
Using this module you can install dependencies from private hosts. To do this, you need for forward SSH agent:
477478

478479
docker_with_ssh_agent = true
479480

480-
Note that by default, the `docker_image` used comes from the registry `public.ecr.aws/sam/`, and will be based on the `runtime` that you specify. In other words, if you specify a runtime of `python3.8` and do not specify `docker_image`, then the `docker_image` will resolve to `public.ecr.aws/sam/build-python3.8`. This ensures that by default the `runtime` is available in the docker container.
481+
Note that by default, the `docker_image` used comes from the registry `public.ecr.aws/sam/`, and will be based on the `runtime` that you specify. In other words, if you specify a runtime of `python3.12` and do not specify `docker_image`, then the `docker_image` will resolve to `public.ecr.aws/sam/build-python3.12`. This ensures that by default the `runtime` is available in the docker container.
481482

482483
If you override `docker_image`, be sure to keep the image in sync with your `runtime`. During the plan phase, when using docker, there is no check that the `runtime` is available to build the package. That means that if you use an image that does not have the runtime, the plan will still succeed, but then the apply will fail.
483484

@@ -524,7 +525,7 @@ This can be implemented in two steps: download file locally using CURL, and pass
524525

525526
```hcl
526527
locals {
527-
package_url = "https://raw.githubusercontent.com/terraform-aws-modules/terraform-aws-lambda/master/examples/fixtures/python3.8-zip/existing_package.zip"
528+
package_url = "https://raw.githubusercontent.com/terraform-aws-modules/terraform-aws-lambda/master/examples/fixtures/python-zip/existing_package.zip"
528529
downloaded = "downloaded_package_${md5(local.package_url)}.zip"
529530
}
530531
@@ -551,7 +552,7 @@ module "lambda_function_existing_package_from_remote_url" {
551552
function_name = "my-lambda-existing-package-local"
552553
description = "My awesome lambda function"
553554
handler = "index.lambda_handler"
554-
runtime = "python3.8"
555+
runtime = "python3.12"
555556
556557
create_package = false
557558
local_existing_package = data.null_data_source.downloaded_package.outputs["filename"]

examples/alias/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ module "lambda_function" {
2525

2626
function_name = "${random_pet.this.id}-lambda"
2727
handler = "index.lambda_handler"
28-
runtime = "python3.8"
28+
runtime = "python3.12"
2929
publish = true
3030

31-
source_path = "${path.module}/../fixtures/python3.8-app1"
31+
source_path = "${path.module}/../fixtures/python-app1"
3232
hash_extra = "yo"
3333

3434
create_async_event_config = true

examples/async/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ module "lambda_function" {
1616

1717
function_name = "${random_pet.this.id}-lambda-async"
1818
handler = "index.lambda_handler"
19-
runtime = "python3.8"
19+
runtime = "python3.12"
2020
architectures = ["arm64"]
2121

22-
source_path = "${path.module}/../fixtures/python3.8-app1"
22+
source_path = "${path.module}/../fixtures/python-app1"
2323

2424
create_async_event_config = true
2525
attach_async_event_policy = true

0 commit comments

Comments
 (0)