Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No property destination_port_ranges for rules declared in azurerm_network_security_group #881

Closed
sylr opened this issue Feb 23, 2018 · 3 comments

Comments

@sylr
Copy link

sylr commented Feb 23, 2018

Hi,

There is a disparity between what can be done regarding security rules management when you declare rules within a azurerm_network_security_group resource or if you do it by declaring network_security_rule resources rattached to a azurerm_network_security_group, e.g:

resource "azurerm_network_security_group" "xxxx-nsg" {
  name                = "xxxx-nsg"
  resource_group_name = "${azurerm_resource_group.xxxx-RG.name}"
  location            = "${azurerm_resource_group.xxxx-RG.location}"

  security_rule {
    name                        = "allow-ssh"
    description                 = "allow-ssh"
    priority                    = 500
    direction                   = "Inbound"
    access                      = "Allow"
    protocol                    = "TCP"
    source_address_prefix       = "10.101.0.0/28"
    source_port_range           = "*"
    destination_address_prefix  = "*"
    destination_port_range      = "22"
  }
}

Versus

resource "azurerm_network_security_group" "xxxx-nsg" {
  name                = "xxxx-nsg"
  resource_group_name = "${azurerm_resource_group.xxxx-RG.name}"
  location            = "${azurerm_resource_group.xxxx-RG.location}"
}

resource "azurerm_network_security_rule" "allow-ssh" {
  name                        = "allow-ssh"
  resource_group_name         = "${azurerm_resource_group.xxxx-RG.name}"
  network_security_group_name = "${azurerm_network_security_group.xxxx-nsg.name}"
  description                 = "allow-ssh"
  priority                    = 500
  direction                   = "Inbound"
  access                      = "Allow"
  protocol                    = "TCP"
  source_address_prefix       = "10.101.0.0/28"
  source_port_range           = "*"
  destination_address_prefix  = "*"
  destination_port_range      = "22"
}

In the latter the destination_port_range can be replaced by destination_port_range*s* (plural) with a list of port range.

This can't be done in the first exemple as it is not implemented.

Terraform Version

terraform v1.11.3
azurerm 1.1.1

Expected Behavior

Be able to declare the following properties when managing rules within a azurerm_network_security_group resource:

  • source_address_prefixe*s*
  • destination_address_prefixe*s*
  • source_port_ranges*s*
  • destination_port_range*s*
@sylr sylr changed the title No property destination_port_ranges for rules declared in No property destination_port_ranges for rules declared in azurerm_network_security_group Feb 23, 2018
@tombuildsstuff
Copy link
Contributor

Fixed via #781

@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants