-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_lambda.sh
More file actions
40 lines (30 loc) · 886 Bytes
/
Copy pathdeploy_lambda.sh
File metadata and controls
40 lines (30 loc) · 886 Bytes
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
#!/bin/bash
# Deployment script for AWS Lambda
set -e
echo "Building Lambda package..."
# Create build directory
mkdir -p build
cd build
# Copy requirements
pip install -r ../requirements.txt -t ./
# Add application code
cp -r ../app .
cp ../aws/lambda_handler.py .
# Create deployment package
zip -r ../lambda_deployment.zip .
cd ..
echo "Lambda package created: lambda_deployment.zip"
# Deploy to AWS Lambda (requires AWS CLI)
if command -v aws &> /dev/null; then
echo "Deploying to AWS Lambda..."
aws lambda update-function-code \
--function-name ecommerce-recommendations \
--zip-file fileb://lambda_deployment.zip \
--region us-east-1
echo "Deployment complete!"
else
echo "AWS CLI not found. Please install it to deploy to Lambda."
echo "Upload lambda_deployment.zip manually to AWS Lambda console."
fi
# Cleanup
rm -rf build