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.
This plugin gets installed through bitops.config.yaml
.
bitops:
fail_fast: true
run_mode: default
logging:
level: DEBUG
color:
enabled: true
filename: bitops-run
err: bitops.logs
path: /var/logs/bitops
opsrepo_root_default_dir: _default
plugins:
terraform:
source: https://github.com/bitops-plugins/terraform
...
...
...
terraform
plugin uses bitops.config.yaml
located in the operations repo when deploying resources using terraform scripts.
terraform:
cli:
var-file: my-vars.tfvars
target: terraform.module.resource
stack-action: "plan"
backend-config:
- KEY1=foo
- KEY2=bar
options:
version: "0.13.2"
workspace: test
terraform
will always run terraform init
and terraform plan
on every execution.
- BitOps Property:
var-file
- CLI Argument:
--var-file
- Environment Variable:
BITOPS_TF_VAR_FILE
- default:
""
- BitOps Property:
target
- CLI Argument:
--target
- Environment Variable:
BITOPS_TF_TARGET
- default:
""
- BitOps Property:
backend-config
- CLI Argument:
--KEY1=foo --KEY2=bar
- Environment Variable: ``
- default:
""
- BitOps Property:
stack-action
- Environment Variable:
BITOPS_TERRAFORM_COMMAND
- default:
"plan"
- required:
"True"
Controls what terraform command to run. e.g. apply
, destroy
, etc. This config is a required parameter.
- BitOps Property:
version
- Environment Variable:
BITOPS_TERRAFORM_VERSION
- default:
"0.12.29"
Allows customziation of which version of terraform to run
- NOTE:
This feature currently not supported.
- BitOps Property:
workspace
- Environment Variable:
BITOPS_TERRAFORM_WORKSPACE
- default:
""
Will select a terraform workspace using terraform workspace new $TERRAFORM_WORKSPACE || terraform workspace select $TERRAFORM_WORKSPACE
prior to running other terraform commands.
Although not captured in bitops.config.yml
, the following environment variables can be set to further customize behaviour
Will skill all terraform executions. This superseeds all other configuration
Will force call terraform apply
Will force call terraform destroy
Will add --upgrade
flag to the init command