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

azurerm_firewall: support multiple ip_configuration blocks #4045

Closed
andrey-dubnik opened this issue Aug 9, 2019 · 11 comments · Fixed by #4639
Closed

azurerm_firewall: support multiple ip_configuration blocks #4045

andrey-dubnik opened this issue Aug 9, 2019 · 11 comments · Fixed by #4639

Comments

@andrey-dubnik
Copy link
Contributor

andrey-dubnik commented Aug 9, 2019

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently it is only possible to have one ip_configuration block per azurerm_firewall resource where Azure Firewall actually supports multiple IP configurations. Having multiple IP addresses associated with a Firewall is essential...

Is this possible to enhance the module and add a feature to enable the multiple ip_configuration blocks?

New or Affected Resource(s)

  • azurerm_firewall

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

References

  • #0000
@nexxai
Copy link
Contributor

nexxai commented Aug 10, 2019

Hi @adubnik , could you please update your post to use the "Feature Request" template, found here: https://github.com/terraform-providers/terraform-provider-azurerm/issues/new?template=Feature_Request.md as it helps the developers quickly understand how your suggested feature might be implemented? Thanks.

@andrey-dubnik
Copy link
Contributor Author

andrey-dubnik commented Aug 12, 2019

if we take a baseline https://www.terraform.io/docs/providers/azurerm/r/firewall.html

resource "azurerm_public_ip" "test-1" {
  name                = "testpip-1"
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"
  allocation_method   = "Static"
  sku                 = "Standard"
}

resource "azurerm_public_ip" "test-2" {
  name                = "testpip-2"
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"
  allocation_method   = "Static"
  sku                 = "Standard"
}

resource "azurerm_firewall" "test" {
  name                = "testfirewall"
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"

  ip_configuration {
    name                 = "ip-configuration"
    subnet_id            = "${azurerm_subnet.test.id}"
    public_ip_address_ids = [
      "${azurerm_public_ip.test-1.id}",
      "${azurerm_public_ip.test-2.id}"
    ]
  }
}

public_ip_address_id -> takes 1 IP address ID
public_ip_address_ids -> takes a list of IP addresses IDs

Alternatively support multiple configurations

resource "azurerm_firewall" "test" {
  name                = "testfirewall"
  location            = "${azurerm_resource_group.test.location}"
  resource_group_name = "${azurerm_resource_group.test.name}"

  ip_configuration {
    name                 = "ip-configuration-1"
    subnet_id            = "${azurerm_subnet.test.id}"
    public_ip_address_id = "${azurerm_public_ip.test-1.id}"
  }

  ip_configuration {
    name                 = "ip-configuration-2"
    # subnet_id            = "${azurerm_subnet.test.id}" # - I don't think this should be mandatory as IP configuration #2 will sit on the same subnet most likely...
    public_ip_address_id = "${azurerm_public_ip.test-2.id}"
  }
}

@ekarlso
Copy link
Contributor

ekarlso commented Aug 19, 2019

Any idea on this ? We need it :D

@ekarlso
Copy link
Contributor

ekarlso commented Aug 21, 2019

cc @nexxai ?

@lsmadja
Copy link

lsmadja commented Sep 13, 2019

hi,
i have the same request but i don't know if it's necessary to do something for its declaration ? Have you take this feature in your plans ?
If i put this secondary ip_configuration in azure plateforme, terraform script will not work after.
thanks

@naikajah
Copy link
Contributor

naikajah commented Nov 6, 2019

Hi

I have just got this issue of terraform not allowing multiple ip_configuration block.

But instead of allowing multiple ip_configuration blocks I would rather go with having a resource that would attach the ip configuration with azure firewall. e.g.

`
resource "azurerm_firewall_ip_attachment" "first" {
firewall_id = azurerm_firewall.test.id
subnet_id = "${azurerm_subnet.test.id}"
public_ip_address_id = "${azurerm_public_ip.test-1.id}"
}

resource "azurerm_firewall_ip_attachment" "second" {
firewall_id = azurerm_firewall.test.id
subnet_id = "${azurerm_subnet.test.id}"
public_ip_address_id = "${azurerm_public_ip.test-2.id}"
}
`

Considering the use case of many ip_configurations attached to a single firewall. The above makes it independent rather than having loads of ip_configuration blocks in the same azurerm_firewall resource.

@provProdctl
Copy link

For all whose use-case involves NAT IPs, use a load balancer with Multiple NAT IP support solution instead.

@timja
Copy link
Contributor

timja commented Nov 12, 2019

@houkms is updating the data resource in scope of this or another issue required?

@houkms
Copy link
Contributor

houkms commented Nov 12, 2019

@timja data source will also be updated here.

katbyte pushed a commit that referenced this issue Nov 15, 2019
Allow enable_ip_configuration to accept multiple ip_configurations.

(fixes #4045)
@katbyte katbyte added this to the v1.37.0 milestone Nov 15, 2019
jackbatzner pushed a commit to jackbatzner/terraform-provider-azurerm that referenced this issue Nov 15, 2019
…#4639)

Allow enable_ip_configuration to accept multiple ip_configurations.

(fixes hashicorp#4045)
@ghost
Copy link

ghost commented Nov 26, 2019

This has been released in version 1.37.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.37.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Mar 29, 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 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants