Skip to content

Commit 88a671c

Browse files
authored
Add hot reload deploy options (#260)
* Add hot reload deploy options * Refine Makefile target order (grouping hot-reload) * Add hot-reload option for Python sample * Add CLI option for raw input
1 parent fda8753 commit 88a671c

File tree

4 files changed

+36
-2
lines changed

4 files changed

+36
-2
lines changed

lambda-debugging-sam-java/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ deploy-sam: ## Deploy the Lambda function via AWS SAM CLI
5858

5959
invoke: ## Invoke the Lambda function and show logs
6060
AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \
61+
--cli-binary-format raw-in-base64-out \
6162
--payload file://events/event.json \
6263
--cli-connect-timeout 3600 \
6364
--cli-read-timeout 3600 \

lambda-debugging-sam-javascript/Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-sam invoke clean start stop ready test-ci
1+
.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
22

33
AWS_ENDPOINT_URL ?= http://localhost.localstack.cloud:4566
44
AWS ?= AWS_ENDPOINT_URL=$(AWS_ENDPOINT_URL) \
@@ -56,11 +56,27 @@ deploy-aws: ## Deploy the Lambda function via AWS CLI
5656
--zip-file fileb://hello-world/hello-world-javascript.zip \
5757
--timeout 2
5858

59+
deploy-aws-hot-reload: ## Deploy the Lambda function with hot reload via AWS CLI
60+
$(AWS) lambda create-function \
61+
--function-name $(FUNCTION_NAME) \
62+
--runtime $(LAMBDA_RUNTIME) \
63+
--role arn:aws:iam::000000000000:role/lambda-role \
64+
--handler app.lambdaHandler \
65+
--code S3Bucket="hot-reload",S3Key="/$$PWD/hello-world" \
66+
--timeout 2
67+
68+
enable-hot-reload: ## Enable hot reload via AWS CLI
69+
$(AWS) lambda update-function-code \
70+
--function-name $(FUNCTION_NAME) \
71+
--s3-bucket "hot-reload" \
72+
--s3-key "$$PWD/hello-world"
73+
5974
deploy-sam: ## Deploy the Lambda function via AWS SAM CLI
6075
$(SAM) deploy
6176

6277
invoke: ## Invoke the Lambda function and show logs
6378
AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \
79+
--cli-binary-format raw-in-base64-out \
6480
--payload file://events/event.json \
6581
--cli-connect-timeout 3600 \
6682
--cli-read-timeout 3600 \

lambda-debugging-sam-python/Makefile

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: usage install build build-docker build-local build-sam wait deploy deploy-aws deploy-sam invoke clean start stop ready test-ci
1+
.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
22

33
AWS_ENDPOINT_URL ?= http://localhost.localstack.cloud:4566
44
AWS ?= AWS_ENDPOINT_URL=$(AWS_ENDPOINT_URL) \
@@ -56,11 +56,27 @@ deploy-aws: ## Deploy the Lambda function via AWS CLI
5656
--zip-file fileb://hello_world/hello_world_python.zip \
5757
--timeout 2
5858

59+
deploy-aws-hot-reload: ## Deploy the Lambda function with hot reload via AWS CLI
60+
$(AWS) lambda create-function \
61+
--function-name $(FUNCTION_NAME) \
62+
--runtime $(LAMBDA_RUNTIME) \
63+
--role arn:aws:iam::000000000000:role/lambda-role \
64+
--handler app.lambda_handler \
65+
--code S3Bucket="hot-reload",S3Key="/$$PWD/hello_world" \
66+
--timeout 2
67+
68+
enable-hot-reload: ## Enable hot reload via AWS CLI
69+
$(AWS) lambda update-function-code \
70+
--function-name $(FUNCTION_NAME) \
71+
--s3-bucket "hot-reload" \
72+
--s3-key "$$PWD/hello_world"
73+
5974
deploy-sam: ## Deploy the Lambda function via AWS SAM CLI
6075
$(SAM) deploy
6176

6277
invoke: ## Invoke the Lambda function and show logs
6378
AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \
79+
--cli-binary-format raw-in-base64-out \
6480
--payload file://events/event.json \
6581
--cli-connect-timeout 3600 \
6682
--cli-read-timeout 3600 \

lambda-debugging-sam-typescript/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ deploy-sam: ## Deploy the Lambda function via AWS SAM CLI
6262

6363
invoke: ## Invoke the Lambda function and show logs
6464
AWS_MAX_ATTEMPTS=1 $(AWS) lambda invoke --function-name $(FUNCTION_NAME) \
65+
--cli-binary-format raw-in-base64-out \
6566
--payload file://events/event.json \
6667
--cli-connect-timeout 3600 \
6768
--cli-read-timeout 3600 \

0 commit comments

Comments
 (0)