From e9fe7aa517c727f054033d4a8a29052e1e68cfe9 Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Mon, 22 Sep 2025 14:17:29 +0200 Subject: [PATCH 1/4] Add hot reload deploy options --- lambda-debugging-sam-javascript/Makefile | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lambda-debugging-sam-javascript/Makefile b/lambda-debugging-sam-javascript/Makefile index f138e1f..9074630 100644 --- a/lambda-debugging-sam-javascript/Makefile +++ b/lambda-debugging-sam-javascript/Makefile @@ -1,4 +1,4 @@ -.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-sam invoke clean start stop ready test-ci +.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-aws-hot-reload deploy-sam invoke clean start stop ready test-ci enable-hot-reload AWS_ENDPOINT_URL ?= http://localhost.localstack.cloud:4566 AWS ?= AWS_ENDPOINT_URL=$(AWS_ENDPOINT_URL) \ @@ -56,11 +56,21 @@ deploy-aws: ## Deploy the Lambda function via AWS CLI --zip-file fileb://hello-world/hello-world-javascript.zip \ --timeout 2 +deploy-aws-hot-reload: ## Deploy the Lambda function with hot reload via AWS CLI + $(AWS) lambda create-function \ + --function-name $(FUNCTION_NAME) \ + --runtime $(LAMBDA_RUNTIME) \ + --role arn:aws:iam::000000000000:role/lambda-role \ + --handler app.lambdaHandler \ + --code S3Bucket="hot-reload",S3Key="/$$PWD/hello-world" \ + --timeout 2 + deploy-sam: ## Deploy the Lambda function via AWS SAM CLI $(SAM) deploy invoke: ## Invoke the Lambda function and show logs AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \ + --cli-binary-format raw-in-base64-out \ --payload file://events/event.json \ --cli-connect-timeout 3600 \ --cli-read-timeout 3600 \ @@ -88,3 +98,9 @@ ready: ## Wait until LocalStack is running test-ci: make start install ready deploy wait invoke; return_code=`echo $$?`;\ echo "Interactive debugging not tested in CI"; exit $$return_code; + +enable-hot-reload: ## Enable hot reload via AWS CLI + $(AWS) lambda update-function-code \ + --function-name $(FUNCTION_NAME) \ + --s3-bucket "hot-reload" \ + --s3-key "$$PWD/hello-world" From dee0e9f6987193107f78770e3727e5f1f9db569e Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Mon, 2 Feb 2026 15:51:43 +0100 Subject: [PATCH 2/4] Refine Makefile target order (grouping hot-reload) --- lambda-debugging-sam-javascript/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lambda-debugging-sam-javascript/Makefile b/lambda-debugging-sam-javascript/Makefile index 9074630..e9f78a7 100644 --- a/lambda-debugging-sam-javascript/Makefile +++ b/lambda-debugging-sam-javascript/Makefile @@ -1,4 +1,4 @@ -.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-aws-hot-reload deploy-sam invoke clean start stop ready test-ci enable-hot-reload +.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-aws-hot-reload enable-hot-reload deploy-sam invoke clean start stop ready test-ci AWS_ENDPOINT_URL ?= http://localhost.localstack.cloud:4566 AWS ?= AWS_ENDPOINT_URL=$(AWS_ENDPOINT_URL) \ @@ -65,6 +65,12 @@ deploy-aws-hot-reload: ## Deploy the Lambda function with hot reload v --code S3Bucket="hot-reload",S3Key="/$$PWD/hello-world" \ --timeout 2 +enable-hot-reload: ## Enable hot reload via AWS CLI + $(AWS) lambda update-function-code \ + --function-name $(FUNCTION_NAME) \ + --s3-bucket "hot-reload" \ + --s3-key "$$PWD/hello-world" + deploy-sam: ## Deploy the Lambda function via AWS SAM CLI $(SAM) deploy @@ -98,9 +104,3 @@ ready: ## Wait until LocalStack is running test-ci: make start install ready deploy wait invoke; return_code=`echo $$?`;\ echo "Interactive debugging not tested in CI"; exit $$return_code; - -enable-hot-reload: ## Enable hot reload via AWS CLI - $(AWS) lambda update-function-code \ - --function-name $(FUNCTION_NAME) \ - --s3-bucket "hot-reload" \ - --s3-key "$$PWD/hello-world" From a076164166e0cc6726a6f0daab3b8442458e56c9 Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Mon, 2 Feb 2026 15:57:35 +0100 Subject: [PATCH 3/4] Add hot-reload option for Python sample --- lambda-debugging-sam-python/Makefile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/lambda-debugging-sam-python/Makefile b/lambda-debugging-sam-python/Makefile index 77468f0..6d020f6 100644 --- a/lambda-debugging-sam-python/Makefile +++ b/lambda-debugging-sam-python/Makefile @@ -1,4 +1,4 @@ -.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-sam invoke clean start stop ready test-ci +.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-aws-hot-reload enable-hot-reload deploy-sam invoke clean start stop ready test-ci AWS_ENDPOINT_URL ?= http://localhost.localstack.cloud:4566 AWS ?= AWS_ENDPOINT_URL=$(AWS_ENDPOINT_URL) \ @@ -56,6 +56,21 @@ deploy-aws: ## Deploy the Lambda function via AWS CLI --zip-file fileb://hello_world/hello_world_python.zip \ --timeout 2 +deploy-aws-hot-reload: ## Deploy the Lambda function with hot reload via AWS CLI + $(AWS) lambda create-function \ + --function-name $(FUNCTION_NAME) \ + --runtime $(LAMBDA_RUNTIME) \ + --role arn:aws:iam::000000000000:role/lambda-role \ + --handler app.lambda_handler \ + --code S3Bucket="hot-reload",S3Key="/$$PWD/hello_world" \ + --timeout 2 + +enable-hot-reload: ## Enable hot reload via AWS CLI + $(AWS) lambda update-function-code \ + --function-name $(FUNCTION_NAME) \ + --s3-bucket "hot-reload" \ + --s3-key "$$PWD/hello_world" + deploy-sam: ## Deploy the Lambda function via AWS SAM CLI $(SAM) deploy From 1f376afbc974068c9b8b57f20e0ae91ae8a289e5 Mon Sep 17 00:00:00 2001 From: Joel Scheuner Date: Wed, 11 Feb 2026 14:28:51 +0100 Subject: [PATCH 4/4] Add CLI option for raw input --- lambda-debugging-sam-java/Makefile | 1 + lambda-debugging-sam-python/Makefile | 1 + lambda-debugging-sam-typescript/Makefile | 1 + 3 files changed, 3 insertions(+) diff --git a/lambda-debugging-sam-java/Makefile b/lambda-debugging-sam-java/Makefile index 0c6c1f6..1f2707c 100644 --- a/lambda-debugging-sam-java/Makefile +++ b/lambda-debugging-sam-java/Makefile @@ -58,6 +58,7 @@ deploy-sam: ## Deploy the Lambda function via AWS SAM CLI invoke: ## Invoke the Lambda function and show logs AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \ + --cli-binary-format raw-in-base64-out \ --payload file://events/event.json \ --cli-connect-timeout 3600 \ --cli-read-timeout 3600 \ diff --git a/lambda-debugging-sam-python/Makefile b/lambda-debugging-sam-python/Makefile index 6d020f6..2956e0f 100644 --- a/lambda-debugging-sam-python/Makefile +++ b/lambda-debugging-sam-python/Makefile @@ -76,6 +76,7 @@ deploy-sam: ## Deploy the Lambda function via AWS SAM CLI invoke: ## Invoke the Lambda function and show logs AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \ + --cli-binary-format raw-in-base64-out \ --payload file://events/event.json \ --cli-connect-timeout 3600 \ --cli-read-timeout 3600 \ diff --git a/lambda-debugging-sam-typescript/Makefile b/lambda-debugging-sam-typescript/Makefile index a13e626..9e35569 100644 --- a/lambda-debugging-sam-typescript/Makefile +++ b/lambda-debugging-sam-typescript/Makefile @@ -62,6 +62,7 @@ deploy-sam: ## Deploy the Lambda function via AWS SAM CLI invoke: ## Invoke the Lambda function and show logs AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \ + --cli-binary-format raw-in-base64-out \ --payload file://events/event.json \ --cli-connect-timeout 3600 \ --cli-read-timeout 3600 \