Spaces:
Sleeping
Sleeping
Download lambda-deployment/deploy.sh from mousom/caltrans-pt: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/spaces/mousom/caltrans-pt/resolve/main/lambda-deployment/deploy.sh
- Command line
-
hf download hf://spaces/mousom/caltrans-pt/lambda-deployment/deploy.sh
-
curl -L -o deploy.sh https://huggingface.co/spaces/mousom/caltrans-pt/resolve/main/lambda-deployment/deploy.sh
1.54 kB
| # 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" | |