TF: Introduction

1 minute read

Description:

This will be a summary post of getting started with Terraform on Azure from what I have learned the first few months in a position that uses Terraform heavily.

To Resolve:

  1. First, I have bookmarked the following links and reference them daily while searching for things:

    • TF Core Docs - For learning anything about terraform itself like meta-arguments, expressions, and directory structures.
    • Azure RM Docs - For looking up Azure resources and what required/optional parameters they take.
    • Microsof’ts TF on Azure Docs - I don’t find myself referencing this too much, but useful nonetheless.
  2. So as will any language, the best way to start learning is to practice. Here is the progression I have done so far:

    • First, before starting this position, I used Terraform in cloud shell to deploy a VM all in one file, documented in this post.
    • Then after starting, I found a way to have Azure Devops use the Terraform executable to deploy into Azure using Service Connection/Service Principle. I documented that in this post.
    • Now I’m just learning Terraform itself by practicing deploying into a test tenant.
  3. As with any language, the first thing you need to do is read the docs to learn the syntax. In terraform, there isn’t much to learn syntax-wise since it is more like yaml and json than powershell or python. Nonetheless, I have a few post documenting some features I have had to learn:

  4. I found that by testing locally can be a faster method to testing things than to to push up to Azure Devops and have the build agent run the same commands. Essentially, this gets rid of messing with the pipeline files and focusing exactly what I’m trying to accomplish with Terraform.

  5. I plan to update this blog with more stuff as I learn. For example:

    • Conditionally deploy resources - I already have this post ready, just need to finish a few tweaks.
    • Using Terragrunt for managing environments and variables
    • More advanced usage of Terraform since these are basically intro posts so far.

Comments