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.
What is an Environment?
Section titled “What is an Environment?”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
Environment Properties
Section titled “Environment Properties”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
Environment Lifecycle
Section titled “Environment Lifecycle”Creating an Environment
Section titled “Creating an Environment”Create a new environment using the CLI:
odin create env <env-name> --accounts <account1>,<account2>Example:
odin create env staging --accounts aws/dev,aws/sharedThis creates an environment named “staging” associated with two AWS accounts.
Listing Environments
Section titled “Listing Environments”List all environments you have access to:
odin list envFilter by provider account:
odin list env --account aws/productionInclude environments from other users (requires access):
odin list env --allDescribing an Environment
Section titled “Describing an Environment”Get detailed information about an environment:
odin describe env <env-name>Filter by service or component:
odin describe env staging --service my-serviceodin describe env staging --service my-service --component databaseChecking Environment Status
Section titled “Checking Environment Status”Check the deployment status of an environment:
odin status env <env-name>Get status for a specific service:
odin status env staging --service my-serviceDeleting an Environment
Section titled “Deleting an Environment”Delete an environment and all its services:
odin delete env <env-name>Environment States
Section titled “Environment States”Environments transition through several states:
| State | Description |
|---|---|
CREATING | Environment is being provisioned |
READY | Environment is available for deployments |
DELETING | Environment is being torn down |
DELETED | Environment has been removed |
Environment Best Practices
Section titled “Environment Best Practices”Naming Conventions
Section titled “Naming Conventions”Use clear, consistent names for environments:
devordevelopment: Developer environmentsqaorstaging: Testing and QA environmentsprodorproduction: Production environmentsfeature-<name>: Feature-specific ephemeral environments
Multi-Account Strategy
Section titled “Multi-Account Strategy”Separate environments by purpose:
# Development environmentodin create env dev --accounts aws/dev-account
# Staging environment (dev + shared services)odin create env staging --accounts aws/dev-account,aws/shared-services
# Production environmentodin create env prod --accounts aws/prod-account,aws/shared-servicesEphemeral Environments
Section titled “Ephemeral Environments”Create temporary environments for feature branches:
odin create env feature-auth-v2 --accounts aws/dev-account# ... deploy and test ...odin delete env feature-auth-v2Default Environment
Section titled “Default Environment”Set a default environment for your profile to avoid typing --env every time:
odin set env stagingNow all commands will use “staging” unless you specify a different --env.
Environment Isolation
Section titled “Environment Isolation”Environments provide isolation at multiple levels:
- Resource Isolation: Services in different environments use separate cloud resources
- Namespace Isolation: Kubernetes deployments use environment-specific namespaces
- Configuration Isolation: Each environment can have different provisioning configs
- Access Control: Environments can have different access policies
Examples
Section titled “Examples”Create a Development Environment
Section titled “Create a Development Environment”odin create env dev --accounts aws/devCreate a Production Environment with Multiple Accounts
Section titled “Create a Production Environment with Multiple Accounts”odin create env production \ --accounts aws/prod-compute,aws/prod-data,aws/shared-servicesCheck All Services in an Environment
Section titled “Check All Services in an Environment”odin status env stagingOutput:
Environment: stagingStatus: 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 │└──────────────┴─────────┴────────────┴────────────┘Delete an Ephemeral Environment
Section titled “Delete an Ephemeral Environment”odin delete env feature-new-dashboardRelated Concepts
Section titled “Related Concepts”- Service: Deploy services to environments
- Provisioning: Configure how components are deployed in environments
- Versioning: Manage service versions across environments