Skip to content

Latest commit

 

History

History
54 lines (38 loc) · 2.47 KB

File metadata and controls

54 lines (38 loc) · 2.47 KB

Example Terraform Cloud agent on MIG Container VM

Overview

This example shows how to deploy a Terraform Cloud agent on Google Compute Engine Container VMs using the tfc-agent-mig-container-vm module.

It creates the Terraform Cloud agent pool, registers the agent to that pool and creates a project and an empty workspace with the agent attached.

Steps to deploy this example

  1. Create terraform.tfvars file with the necessary values.

    The Terraform Cloud agent token you would like to use. NOTE: This is a secret and should be marked as sensitive in Terraform Cloud.

    project_id   = "your-project-id"
    tfc_org_name = "your-tfc-org-name"
  2. Create the infrastructure.

    terraform init
    terraform plan
    terraform apply
  3. Your Terraform Cloud agents should become active at Organization Setting > Security > Agents.

  4. Create additonal workspaces or use the existing workspace to run Terraform through the Terraform Cloud agent.Click here for more info on running the workspace.

Inputs

Name Description Type Default Required
project_id The Google Cloud Platform project ID to deploy Terraform Cloud agent MIG string n/a yes
tfc_agent_pool_name Terraform Cloud agent pool name to be created string "tfc-agent-mig-container-vm-simple-pool" no
tfc_agent_pool_token_description Terraform Cloud agent pool token description string "tfc-agent-mig-container-vm-simple-pool-token" no
tfc_org_name Terraform Cloud org name where the agent pool will be created string n/a yes
tfc_project_name Terraform Cloud project name to be created string "GCP agents Container VM" no
tfc_workspace_name Terraform Cloud workspace name to be created string "tfc-agent-mig-container-vm-simple" no

Outputs

Name Description
mig_instance_group The instance group url of the created MIG
mig_instance_template The name of the MIG Instance Template
mig_name The name of the MIG
project_id The Google Cloud Platform project ID to deploy Terraform Cloud agent MIG
service_account_email Service account email used with the MIG template