-
Viewing the current state – Infrastructure as Code (IaC) with Terraform
To view the current state, we can run the following command:$ terraform show That will output all resources that Terraform has created and manages, including outputs. Of course, this can…
-
Cleaning up – Infrastructure as Code (IaC) with Terraform
Now, let’s go ahead and clean up both resource groups to avoid unnecessary charges. As we’re already within the test workspace, let’s run the following command to destroy resources within…
-
Inspecting resources – Infrastructure as Code (IaC) with Terraform
Let’s use the az command to list the resource groups. As we know, our resource groups have a resource group prefix of terraform-ws. Therefore, use the following command to list…
-
Terraform workspaces – Infrastructure as Code (IaC) with Terraform-2
To access the name of the workspace, Terraform provides the terraform.workspace variable, which we have used to define the resource_group name. So, the template is now ready to take configuration…
-
Terraform workspaces – Infrastructure as Code (IaC) with Terraform-1
Software development requires multiple environments. You develop software within your workspace, deploy it into the development environment, unit test it, and then promote the tested code to a test environment.…
-
Using the Azure Storage backend – Infrastructure as Code (IaC) with Terraform
As we will end up in a chicken -or- egg situation if we use Terraform to build a backend to store its state, we will have to configure this bit…
-
Managing Terraform state – Infrastructure as Code (IaC) with Terraform
Terraform uses a state file to track what it has deployed and what resources it is managing. The state file is essential as it records all the infrastructure Terraform maintains.…
-
Terraform modules – Infrastructure as Code (IaC) with Terraform
Terraform modules are reusable, repeatable templates. They allow abstraction in provisioning infrastructure, which is much needed if your usage grows beyond just some proof of concept. HashiCorp visualizes modules as…
-
terraform destroy – Infrastructure as Code (IaC) with Terraform
To destroy the resource group, we can run a speculative plan first. It is always a best practice to run a speculative plan to confirm that what we need to…