Deploy: AWS
Deploy agents to AWS ECS/Fargate using praisonai deploy
Deploy agents to AWS ECS/Fargate using praisonai deploy run --type cloud --provider aws.
Quick Start – CLI
- Install PraisonAI
bash pip install praisonai - Set Environment Variables
bash export OPENAI_API_KEY="your-key" export AWS_ACCESS_KEY_ID="your-aws-key" export AWS_SECRET_ACCESS_KEY="your-aws-secret" - Initialize AWS Config
bash praisonai deploy init --file agents.yaml --type cloud --provider aws - Check Readiness
bash praisonai deploy doctor --provider aws - Deploy to AWS
bash praisonai deploy run --file agents.yaml --type cloud --provider awsExpected Output:
🚀 Starting deployment... ☁️ Deploying to AWS ECS/Fargate • Region: us-east-1 • Service: praisonai-service • CPU: 256 • Memory: 512MB 📦 Building and pushing Docker image... 🚀 Creating ECS task definition... 🔄 Deploying to Fargate... ✅ Deployment successful! 🔗 URL: https://praisonai-service.us-east-1.amazonaws.com Metadata: • provider: aws • region: us-east-1 • cluster: praisonai-cluster • service: praisonai-service • task_definition: praisonai-task:1 - Verify
bash curl https://praisonai-service.us-east-1.amazonaws.com/health
Quick Start – SDK
- Create Deploy Script
python from praisonai.deploy import Deploy, DeployConfig, DeployType, CloudProvider from praisonai.deploy.models import CloudConfig config = DeployConfig( type=DeployType.CLOUD, cloud=CloudConfig( provider=CloudProvider.AWS, region="us-east-1", service_name="praisonai-service", cpu="256", memory="512", min_instances=1, max_instances=10 ) ) deploy = Deploy(config, "agents.yaml") result = deploy.deploy() print(f"URL: {result.url}") - Run
bash python deploy_aws.py
agents.yaml with AWS Config
framework: praisonai
topic: helpful assistant
roles:
assistant:
role: Assistant
goal: Help users with their questions
backstory: You are a helpful assistant
tasks:
help_task:
description: Answer user questions
expected_output: Helpful response
deploy:
type: cloud
cloud:
provider: aws
region: "us-east-1"
service_name: "praisonai-service"
cpu: "256"
memory: "512"
min_instances: 1
max_instances: 10
cluster_name: "praisonai-cluster"
env_vars:
OPENAI_API_KEY: "${OPENAI_API_KEY}"AWS Cloud Config Options
| Field | Type | Default | Description |
|---|---|---|---|
provider | string | – | Must be aws |
region | string | – | AWS region (e.g., us-east-1) |
service_name | string | – | ECS service name |
cpu | string | 256 | CPU units (256, 512, 1024, etc.) |
memory | string | 512 | Memory in MB |
min_instances | int | 1 | Minimum running instances |
max_instances | int | 10 | Maximum instances for scaling |
cluster_name | string | null | ECS cluster name |
task_definition | string | null | Task definition name |
env_vars | dict | null | Environment variables |
Check Deployment Status
praisonai deploy status --file agents.yamlExpected Output:
📊 Checking deployment status...
╭─────────────────────────────────────────────────────────────────────────────╮
│ Deployment Status │
├─────────────────┬───────────────────────────────────────────────────────────┤
│ Property │ Value │
├─────────────────┼───────────────────────────────────────────────────────────┤
│ State │ RUNNING │
│ Service Name │ praisonai-service │
│ Provider │ aws │
│ Region │ us-east-1 │
│ URL │ https://praisonai-service.us-east-1.amazonaws.com │
│ Healthy │ ✅ Yes │
│ Instances │ 1/1 │
╰─────────────────┴───────────────────────────────────────────────────────────╯Destroy Deployment
praisonai deploy destroy --file agents.yaml --yesTroubleshooting
| Issue | Fix |
|---|---|
| AWS credentials | export AWS_ACCESS_KEY_ID=... |
| Region not set | Add region to agents.yaml |
| Permission denied | Check IAM permissions for ECS |
| Deploy failed | Run praisonai deploy doctor --provider aws |
Manual AWS CLI Validation (Optional)
These commands are for manual validation only. Use praisonai deploy for deployment.
# Verify AWS CLI
aws sts get-caller-identity
# List ECS clusters
aws ecs list-clusters
# Describe service
aws ecs describe-services --cluster praisonai-cluster --services praisonai-service
# View logs
aws logs get-log-events --log-group-name /ecs/praisonai-service --log-stream-name <stream>Related
- Deploy CLI Overview – All deploy commands
- API Deploy – Deploy as local API server
- Docker Deploy – Deploy to Docker
- GCP Deploy – Deploy to Google Cloud Run