File size: 939 Bytes
a8d5a9f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
LAMBDA_NAME="visual-narrator-engine"
S3_BUCKET="visual-narrator-models-yg"
S3_KEY="visual-narrator-engine.zip"
AWS_REGION="us-east-1"

echo "๐Ÿš€ Deploying Visual Narrator Engine to AWS Lambda..."

# Upload to S3 first (make sure package is ready)
aws s3 cp lambda-package/visual-narrator-engine.zip s3://$S3_BUCKET/$S3_KEY

# Check if Lambda exists
aws lambda get-function --function-name $LAMBDA_NAME --region $AWS_REGION > /dev/null 2>&1

if [ $? -eq 0 ]; then
    echo "๐Ÿ“ฆ Updating existing Lambda function..."
    aws lambda update-function-code \
        --function-name $LAMBDA_NAME \
        --s3-bucket $S3_BUCKET \
        --s3-key $S3_KEY \
        --region $AWS_REGION
else
    echo "โŒ Lambda function doesn't exist. You'll need to create it manually via AWS Console first."
    echo "๐Ÿ’ก Go to AWS Lambda Console โ†’ Create Function โ†’ Upload from S3"
    echo "๐Ÿ“ฆ S3 Location: s3://$S3_BUCKET/$S3_KEY"
fi