Azure/terraform-azurerm-network-security-group

Allow multiple entries for new azurerm_network_security_rule module

wadejd opened this issue · 4 comments

Several of the properties under azurerm_network_security_rule are supposed to support a list of strings. When properties like source_application_security_group_ids contain a list of strings, the following error message is generated:
Error: source_application_security_group_ids: attribute supports 1 item maximum, config has 2 declared

Further information, the real issue is the properties should be singular, not a list of strings but only a single string. So should be a source_application_security_groups_id and destination_application_security_groups_id as security rules can only have one ASG in the source and destination fields.

@wadejd Could you provide more information to reproduce the problem?

I am seeing the following error:

Error: source_application_security_group_ids: attribute supports 1 item maximum, config has 2 declared

  on main.tf line 508, in resource "azurerm_network_security_rule" "master-etcd":
 508: resource "azurerm_network_security_rule" "master-etcd" {

based on the following definition:

resource "azurerm_network_security_rule" "master-etcd" {
  name = "openshift-${var.ocp_cluster_name}-master-etcd"
  resource_group_name = data.azurerm_resource_group.main.name
  network_security_group_name = azurerm_network_security_group.master.name
  description = "Etcd traffic from bootstrap/master hosts"
  protocol = "Tcp"
  source_port_range = "2379-2380"
  destination_port_range = "2379-2380"
  source_application_security_group_ids = [
    azurerm_network_security_group.bootstrap.id,
    azurerm_network_security_group.master.id
  ]
  access = "Allow"
  priority = "101"
  direction = "Inbound"
}

I submitted an issue for this here:
hashicorp/terraform-provider-azurerm#5126

@nccurry Thanks for opening this issue, I'll reply you at hashicorp/terraform-provider-azurerm#5126