Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
azure terraform能否消化ARM资源调配期间创建的json文件?_Azure_Terraform_Azureportal_Terraform Provider Azure - Fatal编程技术网

azure terraform能否消化ARM资源调配期间创建的json文件?

azure terraform能否消化ARM资源调配期间创建的json文件?,azure,terraform,azureportal,terraform-provider-azure,Azure,Terraform,Azureportal,Terraform Provider Azure,使用“.tf.json”与“.tf”相比有什么优势 @kimdav111从Azure门户创建资源时生成的json文件称为ARM模板,是的,Terraform可以使用这些json模板。以下是相同的示例: resource "azurerm_resource_group" "test" { name = "acctestRG-01" location = "West US" } resource "azurerm_template_deployment" "test" { na

使用“.tf.json”与“.tf”相比有什么优势

@kimdav111从Azure门户创建资源时生成的json文件称为ARM模板,是的,Terraform可以使用这些json模板。以下是相同的示例:

resource "azurerm_resource_group" "test" {
  name     = "acctestRG-01"
  location = "West US"
}

resource "azurerm_template_deployment" "test" {
  name                = "acctesttemplate-01"
  resource_group_name = "${azurerm_resource_group.test.name}"

  template_body = <<DEPLOY
{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageAccountType": {
      "type": "string",
      "defaultValue": "Standard_LRS",
      "allowedValues": [
        "Standard_LRS",
        "Standard_GRS",
        "Standard_ZRS"
      ],
      "metadata": {
        "description": "Storage Account type"
      }
    }
  },
  "variables": {
    "location": "[resourceGroup().location]",
    "storageAccountName": "[concat(uniquestring(resourceGroup().id), 'storage')]",
    "publicIPAddressName": "[concat('myPublicIp', uniquestring(resourceGroup().id))]",
    "publicIPAddressType": "Dynamic",
    "apiVersion": "2015-06-15",
    "dnsLabelPrefix": "terraform-acctest"
  },
  "resources": [
    {
      "type": "Microsoft.Storage/storageAccounts",
      "name": "[variables('storageAccountName')]",
      "apiVersion": "[variables('apiVersion')]",
      "location": "[variables('location')]",
      "properties": {
        "accountType": "[parameters('storageAccountType')]"
      }
    },
    {
      "type": "Microsoft.Network/publicIPAddresses",
      "apiVersion": "[variables('apiVersion')]",
      "name": "[variables('publicIPAddressName')]",
      "location": "[variables('location')]",
      "properties": {
        "publicIPAllocationMethod": "[variables('publicIPAddressType')]",
        "dnsSettings": {
          "domainNameLabel": "[variables('dnsLabelPrefix')]"
        }
      }
    }
  ],
  "outputs": {
    "storageAccountName": {
      "type": "string",
      "value": "[variables('storageAccountName')]"
    }
  }
}
DEPLOY

  # these key-value pairs are passed into the ARM Template's `parameters` block
  parameters = {
    "storageAccountType" = "Standard_GRS"
  }

  deployment_mode = "Incremental"
}

output "storageAccountName" {
  value = "${lookup(azurerm_template_deployment.test.outputs, "storageAccountName")}"
}
resource“azurerm\u资源组”测试{
name=“acctestRG-01”
地点=“美国西部”
}
资源“azurerm_模板_部署”“测试”{
name=“acctesttemplate-01”
resource_group_name=“${azurerm_resource_group.test.name}”
模板体=