Skip to main content
A production appโ€™s infrastructure consists of many different resources. As those resources grow, managing and deploying them requires more thought and effort. We tend to look at managing resources as we do with code - split them into smaller manageable pieces (env zero Environments) where each piece is cohesive and loosely coupled. In theory, this textbook solution sounds great because each environment is independent and can be deployed at any time, but in the real world, we have dependencies - deploying all those env zero Environments simultaneously is impractical.
Basic Dependency ExampleEnvironment โ€œNetwork and VPCโ€ manages all necessary network configuration.\
Environment โ€œDBโ€ manages a database that multiple services use. Environment โ€œEKSโ€ manages the Elastic Kubernetes Service onto which pods of services will be deployed. Environments โ€œBilling Serviceโ€, โ€œConfiguration Serviceโ€ and โ€œNotification Serviceโ€ all manage the deployments of services on EKS. Those services need access to the database. For this use case:
Environment โ€œDBโ€ depends on the VPC from the โ€œNetwork and VPCโ€ IaC stack. Environment โ€œEKSโ€ also depends on the VPC from the โ€œNetwork and VPCโ€ IaC stack. All service environments depend on DB, and EKS.
As can be seen, the dependencies make it impossible for all the Environments to be deployed simultaneously. And of course, as the resources and environments grow the complexity of the dependencies will increase.

โœจ Here come env zero Workflows to the rescue! โœจ

env zero Workflows allow deploying many env zero Environments with complex dependencies between them as a single unit.
env zero Workflow benefits
  1. Manage your entire infrastructure with complex dependencies between Environments
  2. Visual presentation of the complex deployment
  3. Each environment can use a different IaC tool - one environment can be managed by Terraform while another is managed by Kubernetes
  4. Enhanced experience from all surrounding env zero features such as Policies, Custom flows, Drift Detection and Continuous Deployment
To set up an env zero Workflow follow this simple guide: env zero relies on a file named env0.workflow.yml which describes the dependencies and configuration of the sub environments in your workflow, create this file with your specific definitions, each environment should define:
  1. name: Will be displayed in the workflow graph
  2. templateName: A name of a pre-defined Template to deploy
  3. needs (optional): An array of sub environments which all must be successfully deployed before this sub environment can start deploying
environments:
  vpc:
    name: 'VPC and Network'
    templateName: 'VPC'
  db:
    name: DB
    templateName: 'DB'
    needs:
      - vpc
  eks:
    name: EKS
    templateName: 'EKS'
    needs:
      - vpc
  service1:
    name: 'Billing Service'
    templateName: 'Billing Service'
    needs:
      - db
      - eks
  service2:
    name: 'Configuration Service'
    templateName: 'Configuration Service'
    needs:
      - db
      - eks
  service3:
    name: 'Notification Service'
    templateName: 'Notification Service'
    needs:
      - db
      - eks
  1. Create a new Template and select env zero Workflow as the Template Type
Screen Shot 2022-06-08 at 16.19.14
In the VCS step fill in your VCS details and fill in the directory that contains your env0.workflow.yml file
Screen Shot 2022-06-08 at 16.24.35
  1. Create an Environment based on the Workflow template
  2. Deploy
Screen Shot 2022-06-20 at 16.50.22
You can view your Workflow progress in the GRAPH tab.
โŒ˜I