Terraforming Infrastructure
Using Terraform with Concourse
terraform
- ljfranklin's terraform resource doesn't ship as a standard container with Concourse, and therefore must be declared as a resource type. It's very important to pin the resource to a tag; things in terraform world keep evolving. If you don't pin your terraform resource to a tag, concourse will get the latest version which at some point might become backwards-incompatible with your *.tf files.terraform
- definition of the resource, not to be confused with the resource type above,tf-repo
- git repo containing the terraform declarations. The sample pipeline below assumes the *.tf files are located in theterraform/
directory at the root of the repo
resource_types:- name: terraformtype: docker-imagesource:repository: ljfranklin/terraform-resourcetag: 1.0.6resources:- name: terraformtype: terraformsource:env_name: my-infrastructure-envbackend_type: s3backend_config:bucket: infra-bucketkey: terraform.tfstateregion: ((aws_region))access_key: ((aws_access))secret_key: ((aws_secret))vars:domain: mywebsite.com- name: tf-repotype: gitsource:branch: masterprivate_key: ((deploy_key))uri: git@gitlab.com:oozie/myrepo.gitpaths: [ terraform ]jobs:- name: terraformserial_groups: [ terraform ]plan:- get: tf-repotrigger: true- put: terraformparams:terraform_source: tf-repo/terraform