Sign in

An experienced IT professional, focused on Cloud and DevOps. Specialising in Azure & Terraform.

Not all SQL applications are fully compatible with cloud-native database services such as Azure SQL (PaaS) or CosmosDB, and Azure SQL Managed Instance (Managed IaaS) which provides higher compatibility may be too expensive an option or require application changes to fully exploit (e.g. drivers may need to be updated). It is still necessary in many scenarios to run a SQL server in Azure.

Luckily terraform supports this management with the azurerm_mssql_virtual_machine resource block.

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mssql_virtual_machine

It can be used to set up the license, connectivity, username and password, patching, and storage options, as well as many other configuration areas of the…


When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the last in the series which focuses on point 9 in the list, ‘Test your code’.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a project are easier and faster to work with
  8. Limit resources in the project to reduce the blast radius
  9. Test your code

Overview

As…


When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the seventh in the series which focuses on points 7 and 8 in the list, ‘Less resources in a project are easier and faster to work with’, and ‘Limit resources in the project to reduce the blast radius’.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a…


When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the sixth in the series which focuses on point 6 in the list, ‘Avoid hardcoding variables’, and also shows best practice for general variable use in Terraform.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a project are easier and faster to work with
  8. Limit resources in…


When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the fifth in the series which focuses on point 5 in the list, ‘Hold your state file remotely, not on your local machine’.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a project are easier and faster to work with
  8. Limit resources in the project to reduce…


When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the fourth in the series which focuses on point 4 in the list, ‘Use a consistent format and style’.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a project are easier and faster to work with
  8. Limit resources in the project to reduce the blast radius
  9. Test…

When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the third in the series which focuses on point 3 in the list, ‘use a consistent naming convention’.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a project are easier and faster to work with
  8. Limit resources in the project to reduce the blast radius
  9. Test your…


When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the second in the series which focuses on point 2 in the list, ‘use modules wherever possible’.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a project are easier and faster to work with
  8. Limit resources in the project to reduce the blast radius
  9. Test your code

What are ‘Modules’ in Terraform?


When starting out with Terraform it’s hard to know what is considered ‘best practice’ in a number of areas.

This post is the first in the series which focuses on point 1 in the list, how to structure your Terraform projects.

  1. Use a consistent file structure across your projects
  2. Use modules wherever possible
  3. Use a consistent naming convention
  4. Use a consistent format and style
  5. Hold your state file remotely, not on your local machine
  6. Avoid hardcoding variables
  7. Less resources in a project are easier and faster to work with
  8. Limit resources in the project to reduce the blast radius
  9. Test…


My previous posts have covered how to setup GitLab runners, which are the are processes that pick up and execute jobs for GitLab.

You’ll need to register one with your project to use CI/CD in GitLab. If you don’t have that setup already, check the links below and then come back here!

GitLab runner setup in a docker container on windows

GitLab runner setup on Azure Kubernetes Service

If you do have a runner already setup, you can progress to the actually setting up the pipeline.

Enable CI/CD for your project

In Gitlab, first enable CI/CD for the project under settings -> general -> pipelines…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store