Deploy: Multi-Environment Deployments
Deploy the same prompt pack to dev, staging, and production environments from a single configuration.
What You’ll Build
Section titled “What You’ll Build”A multi-environment deployment setup where each environment has its own configuration overrides, independent state tracking, and separate cloud resources.
Learning Objectives
Section titled “Learning Objectives”In this tutorial, you’ll learn to:
- Configure multiple environments in arena.yaml
- Override base config per environment
- Deploy to a specific environment
- Manage independent environment state
- Promote packs across environments
Time Required
Section titled “Time Required”25 minutes
Prerequisites
Section titled “Prerequisites”- Completed Tutorial: First Deployment
- An installed deploy adapter
- A compiled
.pack.jsonfile
Step 1: Configure Environments
Section titled “Step 1: Configure Environments”Update your arena.yaml deploy section with environment-specific overrides:
deploy: provider: agentcore config: region: us-west-2 instance_type: t3.medium timeout: 300 environments: dev: config: instance_type: t3.small timeout: 60 staging: config: instance_type: t3.medium timeout: 300 production: config: region: us-east-1 instance_type: c5.large timeout: 600 enable_autoscaling: trueHow config merging works:
The base config provides defaults. Each environment’s config is merged on top, overriding matching keys and adding new ones.
For the production environment, the effective config is:
{ "region": "us-east-1", "instance_type": "c5.large", "timeout": 600, "enable_autoscaling": true}Step 2: Deploy to Dev
Section titled “Step 2: Deploy to Dev”Start by deploying to the dev environment:
promptarena deploy plan --env devExpected output:
Planning deployment (env: dev)...Provider: agentcore v0.2.0
Changes: + agent_runtime.greeting Create agent runtime + a2a_endpoint.greeting Create A2A endpoint
Summary: 2 resources to create, 0 to update, 0 to deleteApply the dev deployment:
promptarena deploy --env devStep 3: Deploy to Staging
Section titled “Step 3: Deploy to Staging”Deploy the same pack to staging with different configuration:
promptarena deploy --env stagingEach environment maintains its own state independently. Deploying to staging does not affect the dev deployment.
Step 4: Check Environment Status
Section titled “Step 4: Check Environment Status”Check the status of each environment:
# Check devpromptarena deploy status --env dev
# Check stagingpromptarena deploy status --env stagingExpected output (dev):
Status: deployedLast deployed: 2026-02-16T10:30:00ZPack checksum: sha256:abc123...
Resources: agent_runtime.greeting: healthy a2a_endpoint.greeting: healthyStep 5: Promote to Production
Section titled “Step 5: Promote to Production”After validating in dev and staging, deploy to production:
# Preview production changespromptarena deploy plan --env production
# Apply to productionpromptarena deploy --env productionProduction uses different instance types and enables autoscaling as configured in Step 1.
Step 6: Update a Single Environment
Section titled “Step 6: Update a Single Environment”When you update your pack, you can redeploy to a single environment:
# Recompile after prompt changespackc compile --config arena.yaml --output app.pack.json --id my-app
# Deploy updated pack to dev firstpromptarena deploy --env dev
# Plan will show updates instead of createspromptarena deploy plan --env devExpected output:
Planning deployment (env: dev)...
Changes: ~ agent_runtime.greeting Update agent runtime a2a_endpoint.greeting No change
Summary: 0 to create, 1 to update, 0 to deleteStep 7: Clean Up Environments
Section titled “Step 7: Clean Up Environments”Tear down environments you no longer need:
# Destroy devpromptarena deploy destroy --env dev
# Destroy stagingpromptarena deploy destroy --env staging
# Destroy productionpromptarena deploy destroy --env productionEach destroy only affects the targeted environment.
What You Learned
Section titled “What You Learned”Congratulations! You’ve successfully:
- Configured multiple environments with overrides
- Deployed independently to dev, staging, and production
- Managed per-environment state
- Promoted packs across environments
- Updated and torn down individual environments
Environment Strategy Tips
Section titled “Environment Strategy Tips”Keep Base Config Minimal
Section titled “Keep Base Config Minimal”Put shared defaults in the base config. Only override what differs per environment:
deploy: provider: agentcore config: region: us-west-2 # shared default environments: production: config: region: us-east-1 # only override what's differentUse Consistent Naming
Section titled “Use Consistent Naming”The --env flag value is passed directly to the adapter as the environment name. Use consistent, lowercase names:
# Goodpromptarena deploy --env productionpromptarena deploy --env staging
# Avoidpromptarena deploy --env PRODpromptarena deploy --env Staging-v2Default Environment
Section titled “Default Environment”When no --env flag is provided, the environment defaults to "default". This is fine for single-environment projects.
Common Issues
Section titled “Common Issues”Issue: wrong environment deployed
Section titled “Issue: wrong environment deployed”Solution: Always use deploy plan before deploy to preview the target environment:
promptarena deploy plan --env productionIssue: environments sharing state
Section titled “Issue: environments sharing state”Each environment is tracked independently. If you see unexpected state, check that you’re using the correct --env flag consistently.
Next Steps
Section titled “Next Steps”Now that you understand multi-environment deployments, explore:
- How-To: Configure Deploy — Advanced configuration patterns
- How-To: CI/CD Integration — Automate multi-environment deployments
- Explanation: State Management — How state tracking works per environment