Sign inSign up

gendall/drone-terraform

By gendall

•Updated over 6 years ago

Drone plugin for automating the creation of servers and cloud infrastructure

Image
0

1.0K

gendall/drone-terraform repository overview

⁠Drone Terraform Plugin

A plugin for Drone⁠ that uses Terraform⁠ to automate the provisioning of cloud infrastructure such as servers and DNS records.

This is a simplified replacement for the community Drone plugin⁠.

⁠Usage

The plugin first initialises the state by calling terraform init, then applies any configuration (.tf) files found in the working directory by calling terraform apply.

⁠Config

The following parameters are used to configure the plugin:

  • workspace - if using multiple configurations in seperate .tf files (e.g. for staging and production), place each file in a folder called .terraform and use this parameter to specify which one to apply
  • backend - specify any number of backend configuration⁠ parameters that will be passed to the init command, e.g. to store Terraform state in a remote database
  • vars - specify any number of input variables that will be passed to the apply command
  • key - an SSH key used for remote provisioning, if required
⁠Example
kind: pipeline
type: docker
name: default

steps:
- name: provide
  image: gendall/drone-terraform
  settings:
    workspace: ${DRONE_DEPLOY_TO=development}
    backend:
      - conn_str=$TERRAFORM_CONF
      - schema_name=${DRONE_REPO_NAME/-/_}
    vars:
      - project=${DRONE_REPO_NAME}
      - output=.ansible
    key:
      from_secret: ssh_key
  environment:
    TERRAFORM_CONF:
      from_secret: terraform_conf

⁠Deployment

This image will be automatically built and deployed to DockerHub⁠ when a Semver⁠ tag is pushed to the repo.

Tag summary

Content type

Image

Digest

Size

29.2 MB

Last updated

over 6 years ago

docker pull gendall/drone-terraform