名称输入“subnet-1”。 IPv4 IPv4 地址范围保留默认值“10.0.0.0/16”。 开始地址保留默认值“10.0.0.0”。 大小保留默认值“/24 (256 个地址)”。 选择“保存”。 在窗口底部选择“查看 + 创建”。 验证通过后,选择“创建”。 创建专用终结点
Terraform 复制 resource "azurerm_virtual_network" "vnet" { name = "${var.prefix}-VNet" address_space = var.vnet_range dns_servers = var.dns_servers location = var.deploy_location resource_group_name = var.rg_name depends_on = [azurerm_resource_group.rg] } resource "azurerm_subnet"...
{ name = "terraformnetworkprofile" primary = true ip_configuration { name = "IPConfiguration" subnet_id = azurerm_subnet.vmss.id load_balancer_backend_address_pool_ids = [azurerm_lb_backend_address_pool.bpepool.id] primary = true } } tags = var.tags } resource "azurerm_public_ip" "...
# Add a subnet to each virtual networkresource"azurerm_subnet""subnet_vnet"{ count =3name ="default"virtual_network_name = azurerm_virtual_network.vnet[count.index].name resource_group_name = azurerm_resource_group.rg.name address_prefixes = ["10.${count.index}.0.0/24"...
source = "terraform" } } resource "azurerm_virtual_network" "vnet1" { name = var.vnet_name address_space = var.vnet_range location = azurerm_resource_group.rg.location resource_group_name = azurerm_resource_group.rg.name } resource "azurerm_subnet" "sub1" { ...
resource "azurerm_virtual_network" "helloterraformnetwork" { name = "tfvn" address_space = ["10.0.0.0/16"] location = "China North" resource_group_name = "${azurerm_resource_group.helloterraform.name}" } # 创建一个虚拟子网 resource "azurerm_subnet" "helloterraformsubnet" { ...
subnet和azurerm_network_security_group并使用它作为ID,你必须使用资源属性,而不是变量。例如:
subnet和azurerm_network_security_group并使用它作为ID,你必须使用资源属性,而不是变量。例如:
name="NickNicConfiguration"subnet_id="${azurerm_subnet.nicktfsubnet.id}"private_ip_address_allocation="dynamic"public_ip_address_id="${azurerm_public_ip.nicktfpublicip.id}"} tags { environment="My Terraform Demo"} } 创建存储账户 若要为新建的虚机存储启动诊断日志,需要一个存储帐户。这些启动诊...
NameVersion terraform >= 1.3 azurerm >= 3.11, < 4.0 random >=3.0.0 Providers NameVersion azurerm >= 3.11, < 4.0 random >=3.0.0 Modules NameSourceVersion os ./os n/a Resources NameType azurerm_availability_set.vm resource azurerm_managed_disk.vm_data_disk resource azurerm_managed_disk...