-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·39 lines (30 loc) · 1.01 KB
/
Copy pathdeploy.sh
File metadata and controls
executable file
·39 lines (30 loc) · 1.01 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
#!/bin/bash
set -e
ENVIRONMENT=${1:-production}
STACK_NAME="aws-textract-lamda"
S3_BUCKET="textract-aws-storage"
if [ "$ENVIRONMENT" = "staging" ]; then
STACK_NAME="aws-textract-lamda-staging"
fi
echo "🚀 Deploying to $ENVIRONMENT environment..."
echo "📦 Stack Name: $STACK_NAME"
echo "🪣 S3 Bucket: $S3_BUCKET"
echo "🔨 Building SAM application..."
sam build --use-container
echo "📤 Deploying to AWS..."
sam deploy \
--no-confirm-changeset \
--no-fail-on-empty-changeset \
--stack-name "$STACK_NAME" \
--capabilities CAPABILITY_IAM \
--region us-east-1 \
--parameter-overrides S3BucketName="$S3_BUCKET" \
--tags Environment="$ENVIRONMENT"
echo "✅ Deployment completed successfully!"
API_URL=$(aws cloudformation describe-stacks \
--stack-name "$STACK_NAME" \
--query 'Stacks[0].Outputs[?OutputKey==`TextractApi`].OutputValue' \
--output text \
--region us-east-1)
echo "🌐 API Gateway URL: $API_URL"
echo "🧪 Test URL: ${API_URL}?document_name=paysment-test.jpg"