How To: Configure GIThub.com connection for Terraform Plans

Overview

You may have a requirement to configure a connection back to a GIT repo where you host your Terraform plans. We will walk you through the requirements, how to establish the connection and the options available for your terraform plans.

Considerations

  • Have configured GIT Repo’s for each terraform plan

  • Have copied down the GIT Repo you wish to use

  • Have configured a Personal Authorization Token in github

Procedure

Creating your Personal Authorization Token in github

To create your personal authorization token for use with your github connection, see the github documentation : https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token

Setting up your Git Connection

  1. From your Cloudbolt Admin tab, under External Systems (1) click on Connection Info (2)

  2. Click on New Git Connection Info

  3. Enter the information requested and click on Create.
    Name: Name of your new connection (Something relevant)
    Host: for github.com connections, simply put github.com
    Protocol: This can be HTTP or HTTPS
    Username: This is the username you use to log into github.com .
    Auth Token: This is your Personal Authorisation Token you have generated from github.com
    Labels: For this to work for Terraform plans, you MUST add the label terraform-plan-source. Without this label your terraform action will not resolve your git connection


  4. You will now have a new git connection created in your connection info list


Creating a Terraform action in a blueprint

  1. Inside your blueprint in the Build tab, click on Action

  2. Click on Terraform Plan

  3. Click on Create a new Terraform Plan action now

  4. Provide a meaningful name for your new Terraform plan and optionally complete the rest of the items until you reach Plan Files

  5. Under Plan Files, place the radio button next to Fetch a git repo from a URL and then enter the git repo name then click on Save .
    NOTE: Replace <myaccount> with your github account and <myRepo> with your repo name. You can capture this information from within your github repo by clicking on the Code button and copying out the HTTPS string

  6. Once it has saved, you will have the Terraform plan on your blueprint


Additional information

CloudBolt Connection Info : https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/connection-info/a/h2__903876181
CloudBolt Terraform Plan Action : https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/create-terraform-plan-action/a/h3__1399048011

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.