This is a conversion of ARM template 101-vnet-two-subnets from the repository azure\azure-quickstart-templates to Terraform configuration.
This configuration allows you to create a Virtual Network with two subnets, and it will deploy the following resources…
Note:
If the specified resource group is already exist then the script will not continue with the deployment. If you want to deploy the resources to the existing resource group, then import the resource group to state before deployment.
# To initialize the configuration directory
PS C:\Terraform\101-vnet-two-subnets> terraform init
# To check the execution plan
PS C:\Terraform\101-vnet-two-subnets> terraform plan
# To deploy the configuration
PS C:\Terraform\101-vnet-two-subnets> terraform apply
# Initialize
PS C:\Terraform\101-vnet-two-subnets> terraform init
# Plan
PS C:\Terraform\101-vnet-two-subnets> terraform plan
# Apply
PS C:\Terraform\101-vnet-two-subnets> terraform apply
azurerm_resource_group.arg-01: Creating...
<--- output truncated --->
azurerm_subnet.as-01: Creation complete after 10s
Apply complete! Resources: 4 added, 0 changed, 0 destroyed.