learn-terraform

Course outlines for learning terraform.

View the Project on GitHub robertdebock/learn-terraform

CI/CD for releases

expected time requirements
30 minutes A computer with Terraform installed, terraform knowledge.

Goal: Setup CI/CD for Terraform releases.

Explanation

When you’ve used Terraform modules, you can start to integrate different modules into a root-module. The pipeline looks quite similar to the Terraform module pipeline.

Howto

This howto is specific for bitbucket, from the CI/CD for Modules chapter, you can steal code for GitHub and continue to develop.

Start with a bitbucket-pipelines.yml:

---
image: hashicorp/terraform:full

pipelines:
  default:
    - step:
      script:
        - terraform init

In this case, we want to also plan and apply. BitBucket needs to pass some secrets to Terraform in order to connect to the configured providers.

Assignment

Questions

  1. What’s different to this pipeline compared to the module pipeline?

Solution