Ensuring Your Terraform is Correctly Formatted with Terraform fmt using GitHub Actions

Screenshot of a GitHub Actions workflow log showing the execution of the terraform fmt command. Showing how Terraform code is being automatically formatted, with specific lines indicating changes made to the code to adhere to formatting standards.

As with all pull requests, we want to run various CI checks to ensure validation of your code and one of these is code quality, writing Terraform? Unsure if the Terraform in the pull-request is formatted correctly? This is where GitHub Actions come in handy. In this post, we’ll explore how to ensure your Terraform code … Read more

Displaying Terraform Plan as a comment in Azure DevOps Repo PRs with Azure DevOps Pipelines

Screenshot showing a Terraform Plan output as a comment in Azure DevOps. The comment, added automatically by the Azure DevOps pipeline, details the planned changes to the infrastructure, providing a clear overview of the proposed modifications before they are applied.

In this blog post – we will displaying Terraform plans directly within Azure DevOps Repository Pull Requests as a comment using Azure DevOps Pipelines. Prerequisites Please read this blog post prior, it has some prerequisites that are required before this pipeline will work successfully. Ensure you have: Azure DevOps Pipeline The Azure DevOps pipeline is … Read more

Adding pull-request comments to Azure DevOps Repo from Azure DevOps Pipelines

Screenshot showing a comment added in Azure DevOps by the pipeline. The comment, generated automatically by the pipeline process

Sometimes as part of your pull request process, you may want to include outputs, checks, or other relevant information as comments after your pipeline runs on various stages and tasks. In this blog post we will look and how this can be achieved using a bash task and Azure DevOps API Prerequisites I will be … Read more

Resolving steps.plan.outputs.* returns Empty Issue with hashicorp/setup-terraform@v3

A quick blog post to include the fix/what is needed to resolve steps.plan.outputs.* is empty when using GitHub Action hashicorp/setup-terraform@v3 I recently came across a situation while working with the hashicorp/setup-terraform@v3 GitHub Action. I wanted to make use of steps.plan.outputs.stdout to display the Terraform Plan, but I noticed that the output was consistently empty. Even … Read more

Displaying Terraform Plans in GitHub PRs with GitHub Actions

Screenshot of a GitHub pull request comment displaying a series of successful Terraform-related tasks. The comment includes detailed output from a Terraform Plan, indicating that various Terraform operations, such as formatting and validation, have completed successfully, along with a summary of the planned infrastructure changes

In this blog post, I’ll show you a cool trick – how to share your Terraform Plan right in the comments of your GitHub Pull Request using GitHub Actions. This comes with some handy benefits for your workflow: How to achieve this As part of my Action workflow, I have used a step that is … Read more

Resolving Terraform Error ApplicationGatewayInvalidPublicIpSku : Application Gateway SKU Mismatch with Public IP

If you’ve stumbled upon the following Terraform error while setting up an Application Gateway with a Public IP, this blog post will guide you through the steps to fix it. The error is straightforward—it points to a discrepancy in the SKU (Stock Keeping Unit) between the Application Gateway and the associated Public IP. The Application … Read more

Deploying Azure AKS GitOps Flux extension with Terraform

In a previous blog post, I provided a comprehensive guide on deploying Azure AKS, Application Gateway, and GitOps extension with AKS. This involved an in-depth overview of flux/kustomization, among other components. In this post, I’ll specifically focus on deploying the Azure AKS GitOps extension and configuring flux using this extension. The Terraform Lets jump right … Read more

How to use If-Else in Terraform

Having been writing alot recently on if, else in various tools I use, and now it’s time to explore what Terraform brings to the table. As with any Infrastructure as Code (IaC) solution, there often comes a need to incorporate logic and conditionals into your configurations, enabling you to make choices based on specific criteria. … Read more

Referencing Azure Key Vault Certificates in Terraform

Another quick blog post on how you can reference certificates in your Azure Key Vault within your Terraform configurations. This subject follows a previous blog post in which I demonstrated how to reference Azure Key Vault secrets in Terraform. After receiving an inquiry in the comments about the possibility of doing the same for certificates, … Read more

Terraform import blocks to import Azure resources into Terraform

In a recent announcement with Terraform v1.5.0, Terraform released the option to import your resources into Terraform using import blocks. This feature is a great addition to Terraform as it allows you to import existing resources into your Terraform state file, which can be useful when you have resources that were created outside of Terraform. … Read more