本文介绍如何使用 Terraform 在 Azure 中创建一个 Windows VM 群集(其中包含三个 Windows VM 实例)。 先决条件 安装和配置 Terraform 实现Terraform 代码 备注 本文中的示例代码位于Azure Terraform GitHub 存储库中。 你可以查看包含当前和以前 Terraform 版本的测试结果的日志文件。
“Azure 上的 Terraform”文档:https://docs.microsoft.com/zh-cn/azure/developer/terraform/ 使用Terraform 在 Azure 中创建带有基础结构的 Linux VM:https://docs.microsoft.com/zh-cn/azure/developer/terraform/create-linux-virtual-machine-with-infrastructure#complete-terraform-script Install Azure CLI on Wi...
“Azure 上的 Terraform”文档:https://docs.microsoft.com/zh-cn/azure/developer/terraform/ 使用Terraform 在 Azure 中创建带有基础结构的 Linux VM:https://docs.microsoft.com/zh-cn/azure/developer/terraform/create-linux-virtual-machine-with-infrastructure#complete-terraform-script Install Azure CLI on Wi...
{var.vm_name}" location = "${var.azure_region_fullname}" resource_group_name = "${azurerm_resource_group.resource_group.name}" network_interface_ids = ["${azurerm_network_interface.vm_nic.id}"] vm_size = "${var.vm_size}" storage_image_reference { publisher = "MicrosoftWindows...
配置Terraform:如果尚未执行此操作,请使用以下选项之一配置 Terraform: 使用Bash 在 Azure Cloud Shell 中配置 Terraform 使用PowerShell 在 Azure Cloud Shell 中配置 Terraform 使用Bash 在 Windows 中配置 Terraform 使用PowerShell 在 Windows 中配置 Terraform在Azure 中使用 Terraform 创建中心辐射型混合网络拓扑。
keyvault_admin_objects_ids } module "vm" { source = "claranet/windows-vm/azurerm" version = "x.x.x" location = module.azure_region.location location_short = module.azure_region.location_short client_name = var.client_name environment = var.environment stack = var.stack resource_group_...
Create a file named outputs.tf and insert the following code: Terraform Kopēt output "resource_group_name" { value = azurerm_resource_group.rg.name } output "public_ip_address" { value = azurerm_linux_virtual_machine.my_terraform_vm.public_ip_address } Initialize...
default = "azureadmin" } Create a file named outputs.tf and insert the following code: Terraform Copiere output "resource_group_name" { value = azurerm_resource_group.rg.name } output "public_ip_address" { value = azurerm_linux_virtual_machine.my_terraform_vm.public_ip_address } Initi...
更改您的type_handler_version以匹配实际的your (根据您的调查结果为0.3.1.0)
For example, here is the VM resource template: resource "azurerm_virtual_machine" "vm" { name = "vm${count.index}" location = "${azurerm_resource_group.rg.location}" resource_group_name = "${azurerm_resource_group.rg.name}"