diff --git a/quickstart/101-vm-with-infrastructure/main.tf b/quickstart/101-vm-with-infrastructure/main.tf index f323361c..978e5f06 100644 --- a/quickstart/101-vm-with-infrastructure/main.tf +++ b/quickstart/101-vm-with-infrastructure/main.tf @@ -8,7 +8,7 @@ resource "azurerm_resource_group" "rg" { } # Create virtual network -resource "azurerm_virtual_network" "myterraformnetwork" { +resource "azurerm_virtual_network" "my_terraform_network" { name = "myVnet" address_space = ["10.0.0.0/16"] location = azurerm_resource_group.rg.location @@ -16,15 +16,15 @@ resource "azurerm_virtual_network" "myterraformnetwork" { } # Create subnet -resource "azurerm_subnet" "myterraformsubnet" { +resource "azurerm_subnet" "my_terraform_subnet" { name = "mySubnet" resource_group_name = azurerm_resource_group.rg.name - virtual_network_name = azurerm_virtual_network.myterraformnetwork.name + virtual_network_name = azurerm_virtual_network.my_terraform_network.name address_prefixes = ["10.0.1.0/24"] } # Create public IPs -resource "azurerm_public_ip" "myterraformpublicip" { +resource "azurerm_public_ip" "my_terraform_public_ip" { name = "myPublicIP" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name @@ -32,7 +32,7 @@ resource "azurerm_public_ip" "myterraformpublicip" { } # Create Network Security Group and rule -resource "azurerm_network_security_group" "myterraformnsg" { +resource "azurerm_network_security_group" "my_terraform_nsg" { name = "myNetworkSecurityGroup" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name @@ -51,27 +51,27 @@ resource "azurerm_network_security_group" "myterraformnsg" { } # Create network interface -resource "azurerm_network_interface" "myterraformnic" { +resource "azurerm_network_interface" "my_terraform_nic" { name = "myNIC" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name ip_configuration { - name = "myNicConfiguration" - subnet_id = azurerm_subnet.myterraformsubnet.id + name = "my_nic_configuration" + subnet_id = azurerm_subnet.my_terraform_subnet.id private_ip_address_allocation = "Dynamic" - public_ip_address_id = azurerm_public_ip.myterraformpublicip.id + public_ip_address_id = azurerm_public_ip.my_terraform_public_ip.id } } # Connect the security group to the network interface resource "azurerm_network_interface_security_group_association" "example" { - network_interface_id = azurerm_network_interface.myterraformnic.id - network_security_group_id = azurerm_network_security_group.myterraformnsg.id + network_interface_id = azurerm_network_interface.my_terraform_nic.id + network_security_group_id = azurerm_network_security_group.my_terraform_nsg.id } # Generate random text for a unique storage account name -resource "random_id" "randomId" { +resource "random_id" "random_id" { keepers = { # Generate a new ID only when a new resource group is defined resource_group = azurerm_resource_group.rg.name @@ -81,8 +81,8 @@ resource "random_id" "randomId" { } # Create storage account for boot diagnostics -resource "azurerm_storage_account" "mystorageaccount" { - name = "diag${random_id.randomId.hex}" +resource "azurerm_storage_account" "my_storage_account" { + name = "diag${random_id.random_id.hex}" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name account_tier = "Standard" @@ -96,11 +96,11 @@ resource "tls_private_key" "example_ssh" { } # Create virtual machine -resource "azurerm_linux_virtual_machine" "myterraformvm" { +resource "azurerm_linux_virtual_machine" "my_terraform_vm" { name = "myVM" location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name - network_interface_ids = [azurerm_network_interface.myterraformnic.id] + network_interface_ids = [azurerm_network_interface.my_terraform_nic.id] size = "Standard_DS1_v2" os_disk { @@ -126,6 +126,6 @@ resource "azurerm_linux_virtual_machine" "myterraformvm" { } boot_diagnostics { - storage_account_uri = azurerm_storage_account.mystorageaccount.primary_blob_endpoint + storage_account_uri = azurerm_storage_account.my_storage_account.primary_blob_endpoint } } \ No newline at end of file diff --git a/quickstart/101-vm-with-infrastructure/outputs.tf b/quickstart/101-vm-with-infrastructure/outputs.tf index 6a3a68b6..545f6482 100644 --- a/quickstart/101-vm-with-infrastructure/outputs.tf +++ b/quickstart/101-vm-with-infrastructure/outputs.tf @@ -3,7 +3,7 @@ output "resource_group_name" { } output "public_ip_address" { - value = azurerm_linux_virtual_machine.myterraformvm.public_ip_address + value = azurerm_linux_virtual_machine.my_terraform_vm.public_ip_address } output "tls_private_key" {