Skip to content

Environment

An Environment in Odin is an isolated namespace for deploying services. It represents a stage in your development lifecycle and provides logical separation between different deployment contexts.

Environments allow you to:

  • Deploy the same service to different stages (dev, staging, production)
  • Isolate deployments from each other
  • Associate services with specific cloud provider accounts
  • Manage service lifecycle independently per environment

Each environment has the following properties:

  • Name: Unique identifier (e.g., dev, staging, production)
  • Organization ID: The organization that owns the environment
  • Provider Accounts: One or more cloud provider accounts associated with the environment
  • Provisioning Type: Default provisioning strategy (e.g., kubernetes, ec2)
  • Status: Current state (CREATING, READY, DELETING, DELETED)
  • Auto-deletion Time: Optional scheduled cleanup for ephemeral environments

Create a new environment using the CLI:

Terminal window
odin create env <env-name> --accounts <account1>,<account2>

Example:

Terminal window
odin create env staging --accounts aws/dev,aws/shared

This creates an environment named “staging” associated with two AWS accounts.

List all environments you have access to:

Terminal window
odin list env

Filter by provider account:

Terminal window
odin list env --account aws/production

Include environments from other users (requires access):

Terminal window
odin list env --all

Get detailed information about an environment:

Terminal window
odin describe env <env-name>

Filter by service or component:

Terminal window
odin describe env staging --service my-service
odin describe env staging --service my-service --component database

Check the deployment status of an environment:

Terminal window
odin status env <env-name>

Get status for a specific service:

Terminal window
odin status env staging --service my-service

Delete an environment and all its services:

Terminal window
odin delete env <env-name>

Environments transition through several states:

StateDescription
CREATINGEnvironment is being provisioned
READYEnvironment is available for deployments
DELETINGEnvironment is being torn down
DELETEDEnvironment has been removed

Use clear, consistent names for environments:

  • dev or development: Developer environments
  • qa or staging: Testing and QA environments
  • prod or production: Production environments
  • feature-<name>: Feature-specific ephemeral environments

Separate environments by purpose:

Terminal window
# Development environment
odin create env dev --accounts aws/dev-account
# Staging environment (dev + shared services)
odin create env staging --accounts aws/dev-account,aws/shared-services
# Production environment
odin create env prod --accounts aws/prod-account,aws/shared-services

Create temporary environments for feature branches:

Terminal window
odin create env feature-auth-v2 --accounts aws/dev-account
# ... deploy and test ...
odin delete env feature-auth-v2

Set a default environment for your profile to avoid typing --env every time:

Terminal window
odin set env staging

Now all commands will use “staging” unless you specify a different --env.

Environments provide isolation at multiple levels:

  1. Resource Isolation: Services in different environments use separate cloud resources
  2. Namespace Isolation: Kubernetes deployments use environment-specific namespaces
  3. Configuration Isolation: Each environment can have different provisioning configs
  4. Access Control: Environments can have different access policies
Terminal window
odin create env dev --accounts aws/dev

Create a Production Environment with Multiple Accounts

Section titled “Create a Production Environment with Multiple Accounts”
Terminal window
odin create env production \
--accounts aws/prod-compute,aws/prod-data,aws/shared-services
Terminal window
odin status env staging

Output:

Environment: staging
Status: READY
Services:
┌──────────────┬─────────┬────────────┬────────────┐
│ Service │ Version │ Status │ Components │
├──────────────┼─────────┼────────────┼────────────┤
│ user-api │ 1.2.0 │ DEPLOYED │ 3 │
│ payment-svc │ 2.0.1 │ DEPLOYED │ 2 │
│ analytics │ 1.0.0 │ DEPLOYING │ 4 │
└──────────────┴─────────┴────────────┴────────────┘
Terminal window
odin delete env feature-new-dashboard
  • Service: Deploy services to environments
  • Provisioning: Configure how components are deployed in environments
  • Versioning: Manage service versions across environments