Today, we're thrilled to introduce our latest feature: Environment Discovery. With it, our customers can auto-generate new environments straight from their Git repository while preserving their current directory structure and aligning with industry best practices. 

With Environment Discovery, you can maintain your directory-based structure in your Version Control System (VCS), leveraging it as your primary source of truth. 

This enables you to continue using your existing approval workflows, take advantage of CodeOwners, ensure auditability, and stay aligned with Infrastructure as Code (IaC) best practices — all while benefiting from our platform's robust IaC automation and management capabilities.

How it works

Environment Discovery automatically creates, plans, and deploys new environments to env0 when you open pull requests in GitHub and other VCS. 

This follows Terraform/Terragrunt established best practices for maintaining a directory-based representation of your environments inside your Git repository. 

The feature works seamlessly, requiring zero changes to your current process or any specific manual action. Once a directory is added via a pull request, env0 will simply detect it and auto-generate a plan and status check, which is then posted on the PR for immediate feedback.

Once the PR has been reviewed, approved, and merged, env0 will apply the plan.

To see it in action, check down this video below:

To start, access env0 and go to 'Project Settings' > 'Environment Discovery'. Here, you'll find an introduction to the feature. Click 'Get Started' to proceed.

Next, you'll see a screen where you can select your IaC framework. Choose one of the frameworks (OpenTofu, Terraform, Terragrunt), or select ‘Workflow’ - if you want a flexible custom option or plan to use multiple frameworks simultaneously.

For the sake of this example, let’s proceed with Terragrunt.

After clicking ‘Next’, select the VCS you use. env0 supports GitHub, GitLab, Bitbucket, and Azure DevOps, including self-hosted versions of each. 

Next, you will need to configure env0 so that environments are created based on your Git directory structure.

You can also further customize by:

  • Choosing when redeployment would trigger:some text
    • If you choose the option ‘Changes on Template Directory files’, the environment will only plan/deploy changes to the directory matched by the main glob pattern.
    • If you choose ‘Changes by file filter pattern’, the environment will plan/deploy changes matching the given multi-glob pattern.
  • The environment placement:some text
    • If you choose to create the environments in this project, it will not place the environments in the sub-projects.
    • If you choose to create the environment in the closest matching sub-project path, it will place the new environments in the sub-project that matches the directory path.
  • Workspace naming:some text
    • You can choose to use 'default' as the workspace names.
    • You can derive the workspace naming from the environment's name.

With the configuration complete, let’s see the feature in action.

First, let's open a pull request that adds, for example, a MySQL QA Server in the AWS us-west-2 region for redundancy.

env0 will detect directory changes based on the mapping configuration and add a new environment according to the change in the terragrunt.hcl file. Finally, it will generate a PR plan.

The plan is also posted as a comment directly on the PR for author/reviewer visibility:

env0 will also ensure the approver can see the plan status.

Once the PR is approved and merged, env0 will deploy the new environment.

The newly created environment is now readily available for management alongside your existing env0 deployments. You can now access env0's capabilities within this new environment.

Familiar Workflows and GitOps Best Practices 

Maintaining a well-defined IaC directory structure fosters efficient file management, collaboration, and project maintainability. 

This allows you to align several common best practices, such as the separation of reusable modules from deployed resources and the segmentation by account, region, environment types (dev, staging, etc.), and specific domain (networking, databases).

Environment Discovery enables you to create a folder structure that aligns with the above recommendations, by providing the ability to create environments directly from the Git workflow. 

Moreover, it allows new users to preserve their existing familiar directory structure and continue to leverage useful Git functionalities like version control, auditing, change approvals, etc.

Lastly, this new capability streamlines the environment creation process and smoothens the learning curve of using our platform by enabling users to stay within the familiar GitOps workflow. This has the clear benefit of reducing onboarding time and reducing the likelihood of errors, while also helping expand IaC usage within the organization.

Wrapping Up

Environment Discovery simplifies IaC management by automatically creating environments directly within your existing GitOps workflow, preserving your directory structure, and adhering to best practices. 

Using it enables streamlined infrastructure creation, reduced onboarding time, and effortless IaC management. 

To learn more about this capability, our solution, and IaC at scale, schedule a technical demo and see env0 in action!

Today, we're thrilled to introduce our latest feature: Environment Discovery. With it, our customers can auto-generate new environments straight from their Git repository while preserving their current directory structure and aligning with industry best practices. 

With Environment Discovery, you can maintain your directory-based structure in your Version Control System (VCS), leveraging it as your primary source of truth. 

This enables you to continue using your existing approval workflows, take advantage of CodeOwners, ensure auditability, and stay aligned with Infrastructure as Code (IaC) best practices — all while benefiting from our platform's robust IaC automation and management capabilities.

How it works

Environment Discovery automatically creates, plans, and deploys new environments to env0 when you open pull requests in GitHub and other VCS. 

This follows Terraform/Terragrunt established best practices for maintaining a directory-based representation of your environments inside your Git repository. 

The feature works seamlessly, requiring zero changes to your current process or any specific manual action. Once a directory is added via a pull request, env0 will simply detect it and auto-generate a plan and status check, which is then posted on the PR for immediate feedback.

Once the PR has been reviewed, approved, and merged, env0 will apply the plan.

To see it in action, check down this video below:

To start, access env0 and go to 'Project Settings' > 'Environment Discovery'. Here, you'll find an introduction to the feature. Click 'Get Started' to proceed.

Next, you'll see a screen where you can select your IaC framework. Choose one of the frameworks (OpenTofu, Terraform, Terragrunt), or select ‘Workflow’ - if you want a flexible custom option or plan to use multiple frameworks simultaneously.

For the sake of this example, let’s proceed with Terragrunt.

After clicking ‘Next’, select the VCS you use. env0 supports GitHub, GitLab, Bitbucket, and Azure DevOps, including self-hosted versions of each. 

Next, you will need to configure env0 so that environments are created based on your Git directory structure.

You can also further customize by:

  • Choosing when redeployment would trigger:some text
    • If you choose the option ‘Changes on Template Directory files’, the environment will only plan/deploy changes to the directory matched by the main glob pattern.
    • If you choose ‘Changes by file filter pattern’, the environment will plan/deploy changes matching the given multi-glob pattern.
  • The environment placement:some text
    • If you choose to create the environments in this project, it will not place the environments in the sub-projects.
    • If you choose to create the environment in the closest matching sub-project path, it will place the new environments in the sub-project that matches the directory path.
  • Workspace naming:some text
    • You can choose to use 'default' as the workspace names.
    • You can derive the workspace naming from the environment's name.

With the configuration complete, let’s see the feature in action.

First, let's open a pull request that adds, for example, a MySQL QA Server in the AWS us-west-2 region for redundancy.

env0 will detect directory changes based on the mapping configuration and add a new environment according to the change in the terragrunt.hcl file. Finally, it will generate a PR plan.

The plan is also posted as a comment directly on the PR for author/reviewer visibility:

env0 will also ensure the approver can see the plan status.

Once the PR is approved and merged, env0 will deploy the new environment.

The newly created environment is now readily available for management alongside your existing env0 deployments. You can now access env0's capabilities within this new environment.

Familiar Workflows and GitOps Best Practices 

Maintaining a well-defined IaC directory structure fosters efficient file management, collaboration, and project maintainability. 

This allows you to align several common best practices, such as the separation of reusable modules from deployed resources and the segmentation by account, region, environment types (dev, staging, etc.), and specific domain (networking, databases).

Environment Discovery enables you to create a folder structure that aligns with the above recommendations, by providing the ability to create environments directly from the Git workflow. 

Moreover, it allows new users to preserve their existing familiar directory structure and continue to leverage useful Git functionalities like version control, auditing, change approvals, etc.

Lastly, this new capability streamlines the environment creation process and smoothens the learning curve of using our platform by enabling users to stay within the familiar GitOps workflow. This has the clear benefit of reducing onboarding time and reducing the likelihood of errors, while also helping expand IaC usage within the organization.

Wrapping Up

Environment Discovery simplifies IaC management by automatically creating environments directly within your existing GitOps workflow, preserving your directory structure, and adhering to best practices. 

Using it enables streamlined infrastructure creation, reduced onboarding time, and effortless IaC management. 

To learn more about this capability, our solution, and IaC at scale, schedule a technical demo and see env0 in action!

Logo Podcast
With special guest
Andrew Brown

Schedule a technical demo. See env0 in action.

Footer Illustration