Skip to content

GitHub Environments

Terrateam supports GitHub environments allowing you to associate your Terrateam workflows with specific GitHub environments. This integration provides an additional layer of security and isolation for your secrets and variables, ensuring that they are only accessible to the intended environment.

What are GitHub environments?

GitHub environments are a feature in GitHub Actions that allows you to define and manage different environments, such as production, staging, or qa, within your repository. Each environment can have its own set of secrets, protection rules, and deployment workflows, providing a secure and isolated context for your deployments. By integrating Terrateam with GitHub environments, you can leverage the benefits of GitHub environments while managing your infrastructure as code with Terraform.

Configuring GitHub environments

To associate a Terrateam workflow with a GitHub environment, you need to specify the environment attribute in your Terrateam configuration file (.terrateam/config.yml). Here’s an example configuration:

- tag_query: production
environment: production

In this example, the workflow with the tag_query of production is associated with the GitHub environment named production. Terrateam will use this environment when executing the workflow, ensuring that the secrets and variables defined in the production environment are accessible. You can configure multiple workflows with different GitHub environments based on your requirements. For example:

- tag_query: staging
environment: staging
- tag_query: qa
environment: qa

This configuration associates the staging workflow with the staging GitHub environment and the qa workflow with the qa GitHub environment.

Best practices

When using GitHub environments with Terrateam, consider the following best practices:

  • Define clear and meaningful names for your GitHub environments that reflect their purpose, such as production, staging, or qa.
  • Store sensitive information, such as API keys, passwords, or certificates, as secrets within the respective GitHub environments.
  • Implement appropriate approval processes and checks for critical environments, such as requiring manual approval or passing specific status checks before allowing deployments.
We use cookies and similar technologies to provide certain features, enhance the user experience and deliver content that is relevant to your interests. Depending on their purpose, analysis and marketing cookies may be used in addition to technically necessary cookies. By clicking on "Agree and continue", you declare your consent to the use of the aforementioned cookies. Here you can make detailed settings or revoke your consent (in part if necessary) with effect for the future. For further information, please refer to our Privacy Policy .