In this hands-on lab, you will author a Terraform configuration for Azure and apply the configuration using the Terraform Command Line Interface (CLI).
Successfully complete this lab by achieving the following learning objectives:
- Log In to Azure
- Connect to the virtual machine using the credentials provided.
- Using the terminal in Visual Studio Code, log in to Azure using the Azure CLI.
- Author Your Terraform Configuration
- Create a folder for your configuration.
- Create a
main.tffile in the folder.
- Author your configuration, including the
- Initialize the Working Directory
Use the Terraform executable to initialize the working directory.
- Declare Your Provider Configuration
- Add the provider configuration block to your Terraform configuration file.
skip_provider_registration = truemust be set.
- Import the Existing Resource Group
Import the existing resource group into your Terraform state.
- Declare a Storage Account Resource
Create an Azure Storage Account resource block, using the following properties:
``` account_tier = "Standard" account_replication_type = "LRS" ```
- Format and Validate the Configuration
Use the Terraform executable to format and validate the configuration.
- Plan and Deploy Your Configuration
Use the Terraform executable to plan and apply your configuration.