azurerm_network_function_collector_policy

Manages a Network Function Collector Policy.

Example Usage

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

resource "azurerm_express_route_port" "example" {
  name                = "example-erp"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location
  peering_location    = "Equinix-Seattle-SE2"
  bandwidth_in_gbps   = 10
  encapsulation       = "Dot1Q"
}

resource "azurerm_express_route_circuit" "example" {
  name                  = "example-erc"
  location              = azurerm_resource_group.example.location
  resource_group_name   = azurerm_resource_group.example.name
  express_route_port_id = azurerm_express_route_port.example.id
  bandwidth_in_gbps     = 1

  sku {
    tier   = "Standard"
    family = "MeteredData"
  }
}

resource "azurerm_express_route_circuit_peering" "example" {
  peering_type                  = "MicrosoftPeering"
  express_route_circuit_name    = azurerm_express_route_circuit.example.name
  resource_group_name           = azurerm_resource_group.example.name
  peer_asn                      = 100
  primary_peer_address_prefix   = "192.168.199.0/30"
  secondary_peer_address_prefix = "192.168.200.0/30"
  vlan_id                       = 300

  microsoft_peering_config {
    advertised_public_prefixes = ["123.6.0.0/24"]
  }
}

resource "azurerm_network_function_azure_traffic_collector" "example" {
  name                = "example-nfatc"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name

  depends_on = [
    azurerm_express_route_circuit_peering.example
  ]
}

resource "azurerm_network_function_collector_policy" "example" {
  name                 = "example-nfcp"
  traffic_collector_id = azurerm_network_function_azure_traffic_collector.example.id
  location             = azurerm_resource_group.example.location

  ipfx_emission {
    destination_types = ["AzureMonitor"]
  }

  ipfx_ingestion {
    source_resource_ids = [azurerm_express_route_circuit.example.id]
  }

  tags = {
    key = "value"
  }
}

Arguments Reference

The following arguments are supported:


An ipfx_emission block supports the following:


An ipfx_ingestion block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

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

Import

Network Function Collector Policy can be imported using the resource id, e.g.

terraform import azurerm_network_function_collector_policy.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroup1/providers/Microsoft.NetworkFunction/azureTrafficCollectors/azureTrafficCollector1/collectorPolicies/collectorPolicy1