azurerm_custom_ip_prefix

Manages a custom IPv4 prefix or custom IPv6 prefix.

Example Usage

IPv4 custom prefix

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_custom_ip_prefix" "example" {
  name                = "example-CustomIPPrefix"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  cidr  = "1.2.3.4/22"
  zones = ["1", "2", "3"]

  commissioning_enabled = true

  roa_validity_end_date         = "2099-12-12"
  wan_validation_signed_message = "signed message for WAN validation"

  tags = {
    env = "test"
  }
}

IPv6 custom prefix

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_custom_ip_prefix" "global" {
  name                = "example-Global-CustomIPPrefix"
  location            = azurerm_resource_group.test.location
  resource_group_name = azurerm_resource_group.test.name

  cidr = "2001:db8:1::/48"

  roa_validity_end_date         = "2199-12-12"
  wan_validation_signed_message = "signed message for WAN validation"
}

resource "azurerm_custom_ip_prefix" "regional" {
  name                       = "example-Regional-CustomIPPrefix"
  location                   = azurerm_resource_group.test.location
  resource_group_name        = azurerm_resource_group.test.name
  parent_custom_ip_prefix_id = azurerm_custom_ip_prefix.global.id

  cidr  = cidrsubnet(azurerm_custom_ip_prefix.global.cidr, 16, 1)
  zones = ["1"]
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

A Custom IP Prefix can be imported using the resource id, e.g.

terraform import azurerm_custom_ip_prefix.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Network/customIPPrefixes/customIPPrefix1