使用azurerm_network_interface_security_group_association在网络安全组和网络接口之间创建关联。 使用random_id为唯一存储帐户名称生成随机值。 使用azurerm_storage_account 创建用于启动诊断的存储帐户。 使用azurerm_windows_virtual_machine创建包含 IIS Web 服务器的 Windows VM。
resource"azurerm_virtual_machine""hub-nva-vm"{ name ="${local.prefix-hub-nva}-vm"location = azurerm_resource_group.hub-nva-rg.location resource_group_name = azurerm_resource_group.hub-nva-rg.name network_interface_ids = [azurerm_network_interface.hub-nva-nic.id] vm_size = var.vmsize...
azurerm_virtual_network.onprem-vnet.name address_prefixes = ["192.168.1.128/25"] }resource"azurerm_public_ip""onprem-pip"{ name ="${local.prefix-onprem}-pip"location = azurerm_resource_group.onprem-vnet-rg.location resource_group_name = azurerm_resource_group.onprem-vnet-rg.name ...
resource "azurerm_subnet" "internal" { name = "internal" resource_group_name = azurerm_resource_group.example.name virtual_network_name = azurerm_virtual_network.main.name address_prefixes = ["10.0.2.0/24"] } resource "azurerm_network_interface" "main" { name = "${var.prefix}-nic" lo...
azurerm_public_ip.myterraformpublicip.id } tags = { environment = "Terraform Demo" } } # Connect the security group to the network interface resource "azurerm_network_interface_security_group_association" "example" { network_interface_id = azurerm_network_...
azurerm_linux_virtual_machine.demo[2] azurerm_network_interface.demo[0] azurerm_network_interface.demo[1] azurerm_network_interface.demo[2] azurerm_public_ip.demo[0] azurerm_public_ip.demo[1] azurerm_public_ip.demo[2] 通过命令terraform show可以查看资源的详细信息,比如公网的 IP 地址等等。
resource"azurerm_virtual_machine""nicktfvm"{ name="NickVM"location="eastasia"resource_group_name="${azurerm_resource_group.nicktfrg.name}"network_interface_ids= ["${azurerm_network_interface.nicktfnic.id}"] vm_size="Standard_DS1_v2"storage_os_disk { ...
[azurerm_network_interface.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface) | resource | | [azurerm_network_interface_security_group_association.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface...
{docker-version=var.node-definition.docker-version,admin-username=var.node-definition.admin-username,additionalCommand="${var.commandToExecute} --address ${azurerm_public_ip.publicIp[count.index].ip_address} --internal-address ${azurerm_network_interface.nic[count.index].ip_configuration[0]....
azurerm_network_interface.vm resource azurerm_network_interface_security_group_association.test resource azurerm_network_security_group.vm resource azurerm_network_security_rule.vm resource azurerm_public_ip.vm resource azurerm_storage_account.vm_sa resource azurerm_virtual_machine.vm_linux resource azu...