Member-only story

šŸ”„Bootstrapping Azure Cloud to Your Terraform CI/CD

This blog series focuses on presenting complex DevOps projects as simple and approachable via plain language and lots of pictures. You can do it!

2 min readJan 6, 2020

--

Pairing Terraform with a CI/CD like Azure DevOps, Terraform Cloud, or GitHub Actions can be incredibly empowering. Your team can work on code simultaneously, check it into a central repo, and once code is approved it can be pushed out by your CI/CD and turned into resources in the cloud.

Photo from Skeeze@Pixabay

When you start rolling this out, you run into an immediate catch22 — you need a storage container to store the remote state in order to run terraform, but you need to run terraform in order to build these resources.

The best method I’ve found to get around this problem I’m calling ā€œpivotingā€. The basic order is:

  1. Run terraform from your local machine, and build the required remote resources.
  2. Tell terraform to use the remote state storage, then push your local .tfstate to the remote storage.
  3. Upload your terraform to the CI/CD, where it can access its state file and start building other cool things.

Let’s walk through the steps, and you’ll have an Azure account bootstrapped into your…

--

--

Kyler Middleton
Kyler Middleton

Written by Kyler Middleton

DevNetSecOps, DevRel, cloud security chick. I will teach you, it’s unavoidable. She/Her šŸ³ļøā€šŸŒˆšŸ³ļøā€šŸŒˆ, INFJ-A, support the EFF!

No responses yet