azure-rm

Use output value from module that has a for_each set

瘦欲@ 提交于 2021-02-11 04:31:39
问题 I had my code setup to export the dynamic private ip address when the VM is created. I did this via an outputs value. Since then, I have updated to tf 0.13 and I'm using a for_each in the module but when I reference this value now I get the below error. I'm not sure how I can export the dynamic private address attribute of the NIC now the for_each has been set to be used in the source_address_prefixes. I understand what the error is saying but not sure on correct way of exporting the value to

Use output value from module that has a for_each set

喜欢而已 提交于 2021-02-11 04:31:28
问题 I had my code setup to export the dynamic private ip address when the VM is created. I did this via an outputs value. Since then, I have updated to tf 0.13 and I'm using a for_each in the module but when I reference this value now I get the below error. I'm not sure how I can export the dynamic private address attribute of the NIC now the for_each has been set to be used in the source_address_prefixes. I understand what the error is saying but not sure on correct way of exporting the value to

azurerm_resource_group_template_deployment ignoring parameter file

和自甴很熟 提交于 2021-01-01 17:51:16
问题 I am attempting to use terraform and embedded ARM templates to permit creating a simple logic app in Azure. I have the resource block in terraform as: resource "azurerm_resource_group_template_deployment" "templateTEST" { name = "arm-Deployment" resource_group_name = azurerm_resource_group.rg.name deployment_mode = "Incremental" template_content = file("${path.module}/arm/createLogicAppsTEST.json") parameters_content = jsonencode({ logic_app_name = { value = "logic-${var.prefix}" } }) } and

Terraform on Azure - Deploy multiple subnet

与世无争的帅哥 提交于 2020-02-25 13:17:58
问题 I'm trying to implement a Terraform script to create multiple subnets. resource "azurerm_subnet" "test_subnet" { name = "testSUBNET" resource_group_name = "${local.resource_group_name}" virtual_network_name = "${azurerm_virtual_network.lab_vnet.name}" address_prefix = "10.0.1.0/24" } Is there a way to do a for-each or a loop on a variable in order to create them at the same time? Best Regards! 回答1: You can achieve this using a variable and count index as follows: variable "subnet_prefix" {

Terraform on Azure - Deploy multiple subnet

混江龙づ霸主 提交于 2020-02-25 13:17:09
问题 I'm trying to implement a Terraform script to create multiple subnets. resource "azurerm_subnet" "test_subnet" { name = "testSUBNET" resource_group_name = "${local.resource_group_name}" virtual_network_name = "${azurerm_virtual_network.lab_vnet.name}" address_prefix = "10.0.1.0/24" } Is there a way to do a for-each or a loop on a variable in order to create them at the same time? Best Regards! 回答1: You can achieve this using a variable and count index as follows: variable "subnet_prefix" {

Az / AzureRM / Legacy Azure Powershell Conflicts

耗尽温柔 提交于 2019-12-22 07:58:52
问题 I'm trying to upgrade from AzureRM to the new Az module for powershell. We still have multiple usages of "legacy" service management API resources, such as classic Azure Cloud Services, and these (as far as I know) still require the use of the old Azure powershell module. I've uninstalled all AzureRM modules and then installed the new Az modules. But doing this appears to break the legacy Azure module. It seems that there is a dependency between the Azure module and AzureRM. Running any

Why can't I create Azure VMs with Terraform Smoothly

匆匆过客 提交于 2019-12-12 00:53:35
问题 I got below error message from command prompt after around 17 minutes. Also it seems too long for execution? or is it an expected duration? azurerm_virtual_machine.vm: Still creating... (17m30s elapsed) Releasing state lock. This may take a few moments... Error: Error applying plan: 1 error(s) occurred: azurerm_virtual_machine.vm: 1 error(s) occurred: azurerm_virtual_machine.vm: unexpected EOF Terraform does not automatically rollback in the face of errors. Instead, your Terraform state file