小编Moh*_*nth的帖子

使用 terraform 从映像创建 azure vm

我参考了github代码。请找到下面的URL

https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples/vm-from-management-image

我修改了脚本并执行了 terraform init。我收到以下错误。

读取 azurerm_network_interface[main] 的配置时出错:在 1:18 处解析错误:预期为“)”,但发现为“.”[0m

我的脚本:

    # Configure the Microsoft Azure Provider
provider "azurerm" {
    subscription_id = "xxxxxxxx"
    client_id       = "xxxxxxxx"
    client_secret   = "xxxxxxxx"
    tenant_id       = "xxxxxxxx"
}

# Locate the existing custom/golden image
data "azurerm_image" "search" {
  name                = "AZLXSPTDEVOPS01_Image"
  resource_group_name = "RG-PLATFORM"
}

output "image_id" {
  value = "/subscriptions/4f5c9f2a-3584-4bbd-a26e-bbf69ffbfbe6/resourceGroups/RG-EASTUS-SPT-PLATFORM/providers/Microsoft.Compute/images/AZLXSPTDEVOPS01_Image"
}

# Create a Resource Group for the new Virtual Machine.
resource "azurerm_resource_group" "main" {
  name     = "RG-TEST"
  location = "eastus"
}

# Create …
Run Code Online (Sandbox Code Playgroud)

image virtual-machine azure orchestration terraform

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

azure ×1

image ×1

orchestration ×1

terraform ×1

virtual-machine ×1