terraform-provider-azure

Multiple provider versions with Terraform

馋奶兔 提交于 2021-02-17 06:09:21
问题 Does anyone know if it is possible to have a Terraform script that uses multiple provider versions? For example azurerm version 2.0.0 to create one resource, and 1.4.0 for another? I tried specifying the providers, as documented here: https://www.terraform.io/docs/configuration/providers.html However it doesn't seem to work as it tries to resolve a single provider that fullfills both 1.4.0 and 2.0.0. It errors like: No provider "azurerm" plugins meet the constraint "=1.4.0,=2.0.0". I'm asking

Unable to fetch data using external data source

拜拜、爱过 提交于 2021-02-11 15:23:21
问题 I am trying to fetch values from azure using external data source in terraform. However, i dont understand what am i doing wrong when i try to export values using write-output, getting an error data.external.powershell_test: data.external.powershell_test: command "Powershell.exe" produced invalid JSON: invalid character 'l' looking for beginning of object key string" Below is my script $vm=(Get-AzureRmVM -ResourceGroupName MFA-RG -Name vm2).name | convertTo-json Write-Output "{""first"" : ""

Security rule has invalid Port range terraform

回眸只為那壹抹淺笑 提交于 2021-02-11 14:21:46
问题 Unable to provide destination_port_range for nsg security rule in azure using terraform. Terraform v0.12.28 provider.azurerm v2.18.0 security_rule { name = "databricks-control-plane-inbound-rule" priority = 110 direction = "Inbound" access = "Allow" protocol = "Tcp" source_port_range = "*" destination_port_range = 225557 } Error: Failure sending request: StatusCode=400 -- Original Error: Code="SecurityRuleInvalidPortRange" Message="Security rule has invalid Port range. Value provided: 225557.

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

How can I get active address space of tagged Azure VNets inside Terraform?

三世轮回 提交于 2021-02-08 11:15:27
问题 I would like to get with Terraform the active address space of VNets for Azure in Terraform that have a certain tag. For this I thought I could use Resource data source for virtual networks: data "azurerm_resources" "vnets"{ type = "Microsoft.Network/virtualNetworks" required_tags = { tag_name = "tag" } } Then I realized that required attribute "address_space" belongs actually to the Virtual Networks Data Source (https://www.terraform.io/docs/providers/azurerm/r/virtual_network.html). Still I

Terraform referencing output from another module with for_each

流过昼夜 提交于 2021-01-24 13:37:21
问题 I am having trouble referencing an output from a module in another module. The resources in the first module was deployed using for_each. The resources in the second module is trying to reference the resources from first module There are 2 modules created Security Group VM The intention is to assign the Security Group to the VM The following is the module for the Security Group variable "configserver" { type = map(object({ name = string location = string subnet = string availability_zone =

Terraform referencing output from another module with for_each

删除回忆录丶 提交于 2021-01-24 13:36:06
问题 I am having trouble referencing an output from a module in another module. The resources in the first module was deployed using for_each. The resources in the second module is trying to reference the resources from first module There are 2 modules created Security Group VM The intention is to assign the Security Group to the VM The following is the module for the Security Group variable "configserver" { type = map(object({ name = string location = string subnet = string availability_zone =

Service Principal from Terraform not recognized by Azure API

隐身守侯 提交于 2021-01-20 07:54:09
问题 What specific changes need to be made to the syntax below in order for the terraform azurerm provider to be able to authenticate the service principal that will be created using the following code? The Problem A Second Terraform module needs to authenticate to Azure through the azurerm provider with a client_id and client_secret that is created programatically during an earlier, separate process. The provider block in the Second Terraform module looks like: provider "azurerm" { subscription

Service Principal from Terraform not recognized by Azure API

浪尽此生 提交于 2021-01-20 07:53:58
问题 What specific changes need to be made to the syntax below in order for the terraform azurerm provider to be able to authenticate the service principal that will be created using the following code? The Problem A Second Terraform module needs to authenticate to Azure through the azurerm provider with a client_id and client_secret that is created programatically during an earlier, separate process. The provider block in the Second Terraform module looks like: provider "azurerm" { subscription