Skip to content

API Integration - Github Actions Terraform

Actions
Communicate with Github Actions and Terraform Cloud
v0.1.0
Latest
Star (2)

Tags

 (1)

Action Integration Terraform Cloud

Sets up Terraform API in your GitHub Actions workflow.

Cases

This project arose in the need to create dynamic environment with Terraform Cloud interaction.

  1. We had a problem when creating an environment variable in the Terraform Cloud workspace that would be used to define STAGE in the AWS API Gateway depending on the branch used. example: main: stage -> prod and develop: stage dev

Variables

Go CI test integration CI Docker

Usage

The Mona-bele/action-integration-terraform action is used to set up Terraform API in your GitHub Actions workflow.

Example workflow

name: Terraform API
on:
  push:
    branches:
      - main
        
jobs:
  terraform-apply:
    name: 'Terraform'
    runs-on: ubuntu-latest
    environment: production
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      
      - name: Terraform API Integration Create Variable
        uses: Mona-bele/action-integration-terraform@v1
        with:
          tf_api_token: ${{ secrets.TF_API_TOKEN }}
          tf_workspace: ${{ env.workspace }}
          tf_organization: ${{ env.organization }}
          tf_run_type: 'variable_create'
          tf_variable_key: 'test'
          tf_variable_value: 'test'
          tf_variable_category: 'terraform'
          tf_variable_sensitive: 'false'
          tf_variable_hcl: 'false'
          tf_variable_description: 'test'
          
      - name: Terraform API Integration Delete Variable
        uses: Mona-bele/action-integration-terraform@v1
        with:
          tf_api_token: ${{ secrets.TF_API_TOKEN }}
          tf_workspace: ${{ env.workspace }}
          tf_organization: ${{ env.organization }}
          tf_run_type: 'variable_delete'
          tf_variable_key: 'test'
      
      

License

action-integration-terraform is licensed under the MIT License.

API Integration - Github Actions Terraform is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Communicate with Github Actions and Terraform Cloud
v0.1.0
Latest

Tags

 (1)

API Integration - Github Actions Terraform is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.