--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/f235b7ca-a08a-4d4d-9ab3-406870924cb4%40googlegroups.com.
flatten works on lists, not on sets.What does var.vnet_subnet_idlook like?--Lowe Schmidt | +46 723 867 157
On Tue, 21 Jan 2020 at 17:06, Harri <harr...@gmail.com> wrote:
I'm creating a subnet resource based on a map:--#from module subnet variable subnet_block { type = map default = { subnet01 = "10.0.0.0/24" #subnet02 = "10.0.2.0/24" #subnet03 = "10.0.3.0/24" } } resource "azurerm_subnet" "subnet_block" { for_each = var.subnet_block resource_group_name = var.vnet_rg_name virtual_network_name = var.vnet_name name = each.key address_prefix = each.value } output "vnet_subnet_block" { description = "The ids of subnets created outside of vnet via subnet_block" value = [for i in azurerm_subnet.subnet_block: flatten(i.*.id)] depends_on = [ # azurerm_subnet subnets must be created before these ids could # actually be used azurerm_subnet.subnet_block ] } #module aks variable vnet_subnet_id { default = flatten([module.subnet.vnet_subnet_block]) } resource "azurerm_kubernetes_cluster" "k8s" { name = var.aks_cluster_name location = var.location resource_group_name = var.aks_rg_name dns_prefix = var.aks_dns_prefix default_node_pool { name = "default" type = "VirtualMachineScaleSets" node_count = var.aks_agent_count vm_size = "Standard_B2s" vnet_subnet_id = var.vnet_subnet_id #this is line 39 }getting the error:Error: Incorrect attribute value type on ..\modules\aks\aks.tf line 39, in resource "azurerm_kubernetes_cluster" "k8s": 39: vnet_subnet_id = var.vnet_subnet_id |---------------- | var.vnet_subnet_id is tuple with 1 element Inappropriate value for attribute "vnet_subnet_id": string required.tf output is:vnet_subnet_block = [[ "/subscriptions/<redacted>/providers/Microsoft.Network/subnet01",] ]I tried to flatten vnet_subnet_block but that doesn't seem to do the trick.any ideas?
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terrafo...@googlegroups.com.