bitops-plugins / terraform

Terraform plugin for bitops
0 stars 1 forks source link

Bitops Plugin for Terraform

Table of contents

  1. Introduction
  2. Installation
  3. Deployment

Introduction

This plugin will let BitOps to automatically deploy terraform resources on any cloud provider. terraform plugin uses session variables while connecting to any cloud provider.

Deployment

terraform plugin uses bitops.config.yaml located in the operations repo when deploying resources using terraform scripts.

Example bitops.config.yaml, minimum required

terraform: {}

Example 2 bitops.config.yaml

terraform:
    cli:
        var-file: my-vars.tfvars
        targets: 
            - resource_identifier.foo
            - resource_identifier.bar
        backend-config:
            - KEY1=foo
            - KEY2=bar
        stack-action: "plan"
    options:
        workspace: test

terraform will always run terraform init and terraform plan on every execution.

Run BitOps with the environmental variable TERRAFORM_APPLY set to true or set stack-action in the bitops.config.yaml file to apply to run terraform apply.

CLI and options configuration of Terraform bitops.schema.yaml

Terraform BitOps Schema

bitops.schema.yaml


CLI Configurations


var-file


target


backend-config


stack-action

Options Configuration


skip-deploy



workspace


Additional Environment Variable Configuration

Although not captured in bitops.config.yml, the following environment variables can be set to further customize behaviour. Set the value of the environental variable to true to use


TERRAFORM_APPLY

Will force call terraform apply


TERRAFORM_DESTROY

Will force call terraform destroy


INIT_UPGRADE

Will add --upgrade flag to the init command