Configure Terraform Connection Details

Terraform is an infrastructure as code (IaC) tool that allows you to define, provision, and manage cloud infrastructure in a declarative configuration language. It is widely used for automating the creation and management of resources like virtual machines, networks, and databases across various cloud providers. By using Terraform, you can ensure consistent, repeatable, and scalable infrastructure provisioning across different environments, streamlining operations and reducing manual errors.

You can execute Terraform scripts from within the Lazsa Platform and provision and manage infrastructure for products you build on the platform. Whether you choose to run your scripts on Terraform Cloud workspaces or directly from a Git repository (such as GitLab, GitHub, or Bitbucket), the first step is to configure Terraform connection details in Lazsa.

Contents

Required permissions

To successfully connect Lazsa to Terraform, ensure the user you configure in the connection details has the following specific permissions.

  • For Terraform Cloud

    The Team API Token being used in the connection details must have permissions to execute runs and manage workspaces.

  • For Terraform execution using Git repository

    To execute Terraform scripts using your Git repositories from the Lazsa Platform interface, the user configured in your source code repository connection details must have the read permissions.

    To execute scripts in Terraform Cloud, the Team API Token being used in the connection details must have permissions to execute runs and manage workspaces.

Configuring connection details

To access your Terraform Cloud workspaces or your Git repositories containing your Terraform scripts from within the Lazsa Platform, configure the cluster connection details as described in the following steps:

  1. Sign in to the Lazsa Platform and click Configuration in the left navigation pane.
  2. On the Platform Setup screen, on the Cloud Platforms, Tools & Technologies tile, click Configure.
  3. On the Cloud Platforms, Tools & Technologies screen, in the Terraform Configuration section, click Configure.

    (After you save your first Terraform connection configuration, you see the Modify button here.)

    Terraform Configuration

  4. Depending on whether you plan to execute your Terraform workspace runs using Terraform Cloud or want to run Terraform scripts directly from your Git repository using Jenkins, configure the connection details accordingly. On the Terraform Configuration screen, click one of the following tiles:

    Configuration options based on how you execute Terraform runs

    The choice between using Terraform Cloud or a Git repository to run Terraform scripts in Lazsa depends on your project requirements and preferences. Depending on your choice, configure the details as follows:

    • Terraform Cloud

      Configure your Terraform Cloud connection details if you want to utilize your pre-configured Terraform Cloud workspace, which is already linked to your VCS provider, working directory, and execution settings and you want to trigger the runs from the deployment workflow in the Lazsa interface. In this method, your Terraform runs, state files, variables are managed by Terraform Cloud.

    • Terraform Git

      To run Terraform scripts stored in your Git repository, select your Terraform-specific repositories in this configuration. When you run Terraform scripts from the deployment workflow in the Lazsa interface, you choose from the script source repositories that you save in this configuration. In the method, you manage everything, including the execution process, state files, and CI/CD flow. This gives you maximum flexibility.

     

Related Topics Link IconRecommended Topics

What's next? Configure Connection Details of Secrets Management Tools