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

# Deployment

> Safe deployments, previews, and rollbacks.

Backdrift deploys real cloud infrastructure. We take this seriously with previews, change classification, and instant rollbacks.

## Deployment Flow

```mermaid theme={null}
graph LR
    A[Blueprint] --> B[Preview]
    B --> C[Classify Changes]
    C --> D[Deploy]
    D --> E[Monitor]
    E --> F[Rollback?]
```

## Preview Before Deploy

Before any infrastructure is touched, click **Preview** to see:

### Infrastructure Changes

What resources will be created, updated, or deleted:

```diff theme={null}
+ AWS::DynamoDB::Table (tasks-table)
+ AWS::Lambda::Function (create-task-handler)
+ AWS::Lambda::Function (list-tasks-handler)
~ AWS::ApiGateway::RestApi (update routes)
```

### Cost Estimate

Estimated monthly costs at different usage tiers:

| Tier                    | Estimated Cost |
| ----------------------- | -------------- |
| Starter (0-100 users)   | \$12/month     |
| Production (100k users) | \$180/month    |

### Validation Summary

A final check of security, reliability, and performance issues.

## Change Classification

When updating an existing deployment, changes are classified:

<AccordionGroup>
  <Accordion title="Safe Changes (Green)" icon="check">
    No user confirmation needed:

    * Adding new entities
    * Adding new API endpoints
    * Adding new fields (nullable)
    * Updating Lambda function code
  </Accordion>

  <Accordion title="Unsafe Changes (Yellow)" icon="triangle-exclamation">
    Require acknowledgment:

    * Changing field types
    * Removing nullable constraint
    * Modifying indexes
    * Changing authentication settings
  </Accordion>

  <Accordion title="Blocked Changes (Red)" icon="ban">
    Cannot proceed automatically:

    * Deleting entities with data
    * Removing required fields
    * Changing primary keys
    * Breaking API compatibility
  </Accordion>
</AccordionGroup>

## Deployment Progress

During deployment, you see real-time progress:

```
Deploying to us-east-2...

✅ Cognito Stack (authentication)
✅ DynamoDB Stack (database)
🔄 Lambda Stack (functions) - 3/5 complete
⏳ API Gateway Stack (endpoints)
⏳ Amplify Stack (frontend)
```

Each stack deploys independently. If one fails, others continue.

## Stack Status

After deployment, the **Infrastructure** tab shows per-stack status:

| Stack    | Status     | Actions       |
| -------- | ---------- | ------------- |
| cognito  | ✅ Complete | -             |
| dynamodb | ✅ Complete | -             |
| lambda   | ✅ Complete | View Logs     |
| api      | ✅ Complete | Test Health   |
| amplify  | ✅ Complete | View Frontend |

## Rollback

Made a mistake? Rollback to any previous version:

1. Go to the **Infrastructure** tab
2. Click **Rollback**
3. Select a previous deployment
4. Confirm

Rollback is fast (usually under 60 seconds) because we're reverting to a known-good state.

<Warning>
  Rollback reverts infrastructure configuration but does not restore deleted data. Always backup critical data before making changes.
</Warning>

## Continue Deploy

If a deployment partially fails, you don't have to start over.

Click **Continue Deploy** to:

* Skip already-completed stacks
* Retry failed stacks
* Complete remaining stacks

## Regions

Deploy to any supported AWS region:

| Region    | Location    | Durable Functions |
| --------- | ----------- | ----------------- |
| us-east-1 | N. Virginia | ❌                 |
| us-east-2 | Ohio        | ✅                 |
| us-west-2 | Oregon      | ❌                 |

<Note>
  **Durable Functions** (long-running workflows) are currently only available in us-east-2.
</Note>

## Destroy Stack

To completely remove all infrastructure:

1. Go to the **Infrastructure** tab
2. Click **Destroy All**
3. Confirm deletion

Stacks are deleted in dependency order (frontend → API → database → auth) to avoid errors.

<Warning>
  Destroying a stack permanently deletes all data. This cannot be undone.
</Warning>

## What Gets Deployed

A typical Backdrift deployment creates:

| Resource          | Purpose                          |
| ----------------- | -------------------------------- |
| Cognito User Pool | Authentication                   |
| DynamoDB Tables   | Data storage                     |
| Lambda Functions  | API handlers                     |
| API Gateway       | REST API                         |
| CloudWatch        | Logs and monitoring              |
| Amplify App       | Frontend hosting                 |
| S3 Buckets        | File storage (if configured)     |
| EventBridge Rules | Scheduled jobs (if configured)   |
| SQS Queues        | Async processing (if configured) |

<Card title="Admin Dashboard" icon="gauge" href="/operations/admin-dashboard">
  Learn how to manage your deployed backend.
</Card>
