diff --git a/crates/embucket-lambda/Makefile b/crates/embucket-lambda/Makefile index fc71cc79..d60d679b 100644 --- a/crates/embucket-lambda/Makefile +++ b/crates/embucket-lambda/Makefile @@ -2,6 +2,7 @@ # Function name (override with: make deploy FUNCTION_NAME=your-function) FUNCTION_NAME ?= embucket-lambda +ENV_FILE ?= .env # supported features: "streaming" FEATURES_PARAM := $(if $(FEATURES),--features $(FEATURES)) @@ -9,12 +10,12 @@ build: cd ../.. && cargo lambda build --release --arm64 --manifest-path crates/embucket-lambda/Cargo.toml $(FEATURES_PARAM) # Deploy to AWS (must run from workspace root for include paths to work) -deploy: build - cd ../.. && cargo lambda deploy --binary-name bootstrap $(FUNCTION_NAME) +deploy: build deploy-only + @echo "Deployed $(FUNCTION_NAME) to AWS" # Quick deploy without rebuild deploy-only: - cd ../.. && cargo lambda deploy --binary-name bootstrap $(FUNCTION_NAME) + cd ../.. && cargo lambda deploy --binary-name bootstrap $(FUNCTION_NAME) --env-file $(ENV_FILE) # Watch locally for development watch: diff --git a/crates/embucket-lambda/README.md b/crates/embucket-lambda/README.md index 0f16f581..9cb44dbb 100644 --- a/crates/embucket-lambda/README.md +++ b/crates/embucket-lambda/README.md @@ -68,9 +68,15 @@ cargo lambda deploy --binary-name bootstrap **Other Settings** (in `Cargo.toml`): - Memory: `memory = 3008` - Timeout: `timeout = 30` -- Environment variables: `[package.metadata.lambda.deploy.env]` - Included files: `include = ["config"]` +**Environment Variables** +- Set envs using `ENV_FILE=.env` environment variable: + ``` sh + ENV_FILE=".env.dev" make deploy + ``` +- It will deploy envs from `.env` if `ENV_FILE` not specified + ### Test locally ```bash