Onboarding (Import external environments into env0)

If you're advanced in your IaC journey and have decided to adopt env0, you likely have existing environments that you want to import and manage within the platform.

The Environment Discovery feature simplifies this process by scanning your external environments and offering the ability to import them directly into env0.

Bulk imports allow you to select and configure multiple environments simultaneously, reducing manual work and lowering the chances of human error. This process helps minimize the time required to migrate your environments into env0.

Discover

Activate the Environment Discovery feature within your project and configure it to detect your existing environments.

Once configured, env0 will display all detected environments in the Discovered Environments table. Each discovered environment will include the following details:

  • Path: The environment’s location within your Git repository.
  • Target Project: The project where the environment will be placed (as defined by your Environment Placement configuration).
  • Target Environment: The generated name for the new environment, based on your Environment Placement configuration.

Initiate Import Batch

Once env0 has discovered your environments, you can initiate the import by selecting the desired environments and clicking the ‘Import’ button.

Next, you'll need to configure each environment, including shared settings that can be defined at the Project level. The following configurations must be provided:

  • Workspace Name (required): Enter the workspace name for each selected environment to ensure that env0 references the same environment and state, rather than creating a new one.
  • Variables: Define the necessary Terraform or environment variables. These can be set at either the Environment or Project level.
  • Deployment Credentials (recommended but not required): Specify the credentials env0 will use to deploy your environment and connect to your cloud account successfully.

📘

Pre-filled Terraform Variables

During the environment discovery process, env0 scanned your Git repository and reviewed the Terraform environments and variables in use.

env0 will automatically pre-fill your Terraform variable keys with those defined in the environment. If a default value was specified for a variable, env0 will pre-fill the corresponding value as well.

Once you’ve completed the configuration, click the ‘Import’ button in the bottom-right corner to initiate the batch import process.

👍

What is considered a Successful Import?

An import is considered successful and its status will update to "Imported" when the following conditions are met:

  • The deployment completes successfully, with no errors during the process.
  • The Terraform plan shows 0 changes, meaning env0 deployed the environment in the same workspace without attempting to create new resources. It successfully uses the existing resources.

If these conditions are not met, the status will change to "Error."

Rerun Imports

Mistakes can happen—whether it's a missed variable, incorrect credentials, or other human errors. These issues can cause an import to fail. To address this, env0 provides a Rerun option.

You can select the environments that encountered errors, adjust their configurations as needed, and run the import process again.