mousom's picture
Upload folder using huggingface_hub
e6c137b verified
Raw History Blame Contribute Delete
1.54 kB
#!/bin/bash
# Caltrans Payment Tracking API - AWS Lambda Deployment Script
# This script deploys the FastAPI application to AWS Lambda using SAM
set -e # Exit on any error
echo "πŸš€ Starting deployment of Caltrans Payment Tracking API to AWS Lambda..."
# Check if SAM CLI is installed
if ! command -v sam &> /dev/null; then
echo "❌ SAM CLI is not installed. Please install it first:"
echo " https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html"
exit 1
fi
# Check if AWS CLI is configured
if ! aws sts get-caller-identity &> /dev/null; then
echo "❌ AWS CLI is not configured. Please run 'aws configure' first."
exit 1
fi
# Build the SAM application
echo "πŸ“¦ Building SAM application..."
sam build
# Deploy the application
echo "πŸš€ Deploying to AWS Lambda..."
sam deploy --guided
echo "βœ… Deployment completed successfully!"
echo "🌐 Your API is now available at the URL shown above."
echo ""
echo "πŸ“‹ Available endpoints:"
echo " GET / - API information"
echo " GET /health - Health check"
echo " GET /contracts/{contract_number}/payments - Get contract payments"
echo " GET /contracts/{contract_number}/payments/monthly/{month} - Get monthly detailed payments"
echo ""
echo "πŸ“ Example usage:"
echo " curl https://your-api-url/contracts/033F0704/payments"
echo " curl https://your-api-url/contracts/033F0704/payments/monthly/2024-12"