Demonstrate how to use modules shared on the public Terraform Registry, and create your own. The goal is to use modules to deploy a web server in Azure.
An Azure RM template is included in infrastructure/
to create the environment:
Using Azure PowerShell, do the following to provision the resources:
.\startup.ps1
Alternatively, you can perform a one-click deploy with the following button:
-
Create a Bash Azure Cloud Shell in the cloudshell storage account that is created by the template. Terraform is installed in the cloud shell by default and is automatically authenticated.
-
Copy the files in the
src/
directory to the Cloud Shell file share. -
Change into the
clouddrive/
directory in the Cloud Shell to see the copied files. -
Initialize the working directory with
terraform init
- Cloud Shell doesn't support soft links. As a workaround you can create copies of the modules in the
.terraform/modules
directory using the directory names given in the error messages
- Cloud Shell doesn't support soft links. As a workaround you can create copies of the modules in the
-
Apply the configuration changes with
terraform apply
to have all the resources created and the VM provisioned.
When finished, remove the Azure resources with:
.\teardown.ps1