> ## Documentation Index
> Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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

<Steps>
  <Step title="Install PraisonAI">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    pip install praisonai
    ```
  </Step>

  <Step title="Set Environment Variables">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    export OPENAI_API_KEY="your-key"
    export AWS_ACCESS_KEY_ID="your-aws-key"
    export AWS_SECRET_ACCESS_KEY="your-aws-secret"
    ```
  </Step>

  <Step title="Initialize AWS Config">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai deploy init --file agents.yaml --type cloud --provider aws
    ```
  </Step>

  <Step title="Check Readiness">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai deploy doctor --provider aws
    ```
  </Step>

  <Step title="Deploy to AWS">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    praisonai deploy run --file agents.yaml --type cloud --provider aws
    ```

    **Expected 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
    ```
  </Step>

  <Step title="Verify">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    curl https://praisonai-service.us-east-1.amazonaws.com/health
    ```
  </Step>
</Steps>

## Quick Start - SDK

<Steps>
  <Step title="Create Deploy Script">
    ```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    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}")
    ```
  </Step>

  <Step title="Run">
    ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
    python deploy_aws.py
    ```
  </Step>
</Steps>

## agents.yaml with AWS Config

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy status --file agents.yaml
```

**Expected 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

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
praisonai deploy destroy --file agents.yaml --yes
```

## Troubleshooting

| 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` |

<Accordion title="Manual AWS CLI Validation (Optional)">
  These commands are for manual validation only. Use `praisonai deploy` for deployment.

  ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  # 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>
  ```
</Accordion>

## Related

* [Deploy CLI Overview](./index) - All deploy commands
* [API Deploy](./api) - Deploy as local API server
* [Docker Deploy](./docker) - Deploy to Docker
* [GCP Deploy](./gcp) - Deploy to Google Cloud Run
