Create a New Workflow

To set up a Workflow follow this simple guide:

env0 relies on a file named env0.workflow.yml to describe the dependencies and configuration of the sub environments in your workflow. Each environment definition in the file should contain:

  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

Optional attributes:

  1. revision: A revision for this specific environment's Template to deploy.
  2. workspace: A name for the terraform workspace for a new environment.
    Note: The workspace attribute can not be set for an existing environment.
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' 
    revision: feature-branch
    needs:
      - db
      - eks
  service3:
    name: 'Notification Service'
    templateName: 'Notification Service'
    workspace: env0-workspace
    needs:
      - db
      - eks
  1. Create a new Template and select env0 Workflow as the Template Type
2830

In the VCS step, fill in your VCS details and the directory that contains your env0.workflow.yml file

2884
  1. Create an Environment based on the Workflow template.
    You can choose any of the workflow environments from the dropdown box at the top right corner.
1660

After choosing one of the workflow sub-environment you can modify its Environment's variables, workspace and revision.

🚧

Overrides Note

The values you set here for workspace and revision will override the ones you defined in the workflow file for the corresponding environment.

if you would like to set the whole workflow to the the same workspace name value, you can do so by setting the workflow workspace name, and leaving the sub environments blank.

note that since Terragrunt uses a working directory instead of workspace name, the workspace name override won't apply to Terragrunt template type.

2922
  1. Deploy
1049