-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (42 loc) · 1.14 KB
/
Makefile
File metadata and controls
52 lines (42 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FUNCTION_NAME := rotel-pino-lambda-example
ROTEL_AXIOM_KEY ?= "set-me"
ROTEL_AXIOM_DATASET ?= "set-me"
ROTEL_VERSION := 36
.PHONY: install deploy destroy invoke invoke-custom clean test-local
install:
npm install
deploy: install
@echo "Deploying with AWS CDK..."
npx cdk deploy --require-approval never
destroy:
@echo "Destroying CDK stack..."
npx cdk destroy --force
invoke:
@echo "Invoking Lambda function..."
aws lambda invoke \
--function-name $(FUNCTION_NAME) \
--log-type Tail \
--cli-binary-format raw-in-base64-out \
--payload '{"zipCode": "10001"}' \
response.json | jq -r '.LogResult' | base64 -d
@echo "Response:"
@cat response.json
@echo ""
invoke-custom:
@echo "Invoking Lambda function with custom zip code..."
@read -p "Enter zip code: " zipcode; \
aws lambda invoke \
--cli-binary-format raw-in-base64-out \
--function-name $(FUNCTION_NAME) \
--payload "{\"zipCode\": \"$$zipcode\"}" \
response.json
@echo "Response:"
@cat response.json
@echo ""
clean:
rm -f response.json
rm -rf node_modules/ cdk.out/
# Local testing target
test-local: install
@echo "🧪 Running local tests..."
node test-local.js