---
title: Magic Network Monitoring
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/terraform)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Magic Network Monitoring

#### Magic Network MonitoringConfigs

#### resource cloudflare\_magic\_network\_monitoring\_configuration

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20account_id>)

name: String

The account name.

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20name>)

##### optional Expand Collapse

router\_ips?: List\[String]

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20router_ips>)

<details>

<summary>

warp\_devices?: List\[Attributes]

</summary>

id: String

Unique identifier for the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20warp_devices%20%3E%20(attribute)%20id">Link to this property</a>

name: String

Name of the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20warp_devices%20%3E%20(attribute)%20name">Link to this property</a>

router\_ip: String

IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20warp_devices%20%3E%20(attribute)%20router_ip">Link to this property</a>

</details>

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20warp_devices>)

default\_sampling?: Float64

Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20default_sampling>)

### cloudflare\_magic\_network\_monitoring\_configuration

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_magic_network_monitoring_configuration" "example_magic_network_monitoring_configuration" {
  account_id = "6f91088a406011ed95aed352566e8d4c"
  default_sampling = 1
  name = "cloudflare user\'s account"
  router_ips = ["203.0.113.1"]
  warp_devices = [{
    id = "5360368d-b351-4791-abe1-93550dabd351"
    name = "My warp device"
    router_ip = "203.0.113.1"
  }]
}
```

#### data cloudflare\_magic\_network\_monitoring\_configuration

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20account_id>)

##### computed Expand Collapse

default\_sampling: Float64

Fallback sampling rate of flow messages being sent in packets per second. This should match the packet sampling rate configured on the router.

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20default_sampling>)

name: String

The account name.

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20name>)

router\_ips: List\[String]

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20router_ips>)

<details>

<summary>

warp\_devices: List\[Attributes]

</summary>

id: String

Unique identifier for the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20warp_devices%20%3E%20(attribute)%20id">Link to this property</a>

name: String

Name of the warp device.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20warp_devices%20%3E%20(attribute)%20name">Link to this property</a>

router\_ip: String

IPv4 CIDR of the router sourcing flow data associated with this warp device. Only /32 addresses are currently supported.

<a href="#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20warp_devices%20%3E%20(attribute)%20router_ip">Link to this property</a>

</details>

[Link to this property](<#(resource)%20magic_network_monitoring.configs%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20warp_devices>)

### cloudflare\_magic\_network\_monitoring\_configuration

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_magic_network_monitoring_configuration" "example_magic_network_monitoring_configuration" {
  account_id = "6f91088a406011ed95aed352566e8d4c"
}
```

#### Magic Network MonitoringRules

#### resource cloudflare\_magic\_network\_monitoring\_rule

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20account_id>)

automatic\_advertisement: Bool

Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20automatic_advertisement>)

name: String

The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\_), dash (-), period (.), and tilde (\~). You can’t have a space in the rule name. Max 256 characters.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20name>)

type: String

MNM rule type.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20type>)

prefixes: List\[String]

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20prefixes>)

##### optional Expand Collapse

bandwidth\_threshold?: Float64

The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20bandwidth_threshold>)

packet\_threshold?: Float64

The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20packet_threshold>)

prefix\_match?: String

Prefix match type to be applied for a prefix auto advertisement when using an advanced\_ddos rule.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20prefix_match>)

zscore\_sensitivity?: String

Level of sensitivity set for zscore rules.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zscore_sensitivity>)

zscore\_target?: String

Target of the zscore rule analysis.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20zscore_target>)

duration?: String

The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values \[“1m”,“5m”,“10m”,“15m”,“20m”,“30m”,“45m”,“60m”].

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20duration>)

##### computed Expand Collapse

id: String

The id of the rule. Must be unique.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20resource)%20%3E%20(attribute)%20id>)

### cloudflare\_magic\_network\_monitoring\_rule

Terraform

HTTPTypeScriptPythonGoTerraform

```
resource "cloudflare_magic_network_monitoring_rule" "example_magic_network_monitoring_rule" {
  account_id = "6f91088a406011ed95aed352566e8d4c"
  automatic_advertisement = true
  name = "my_rule_1"
  prefixes = ["203.0.113.1/32"]
  type = "zscore"
  bandwidth_threshold = 1000
  duration = "1m"
  packet_threshold = 10000
  prefix_match = "exact"
  zscore_sensitivity = "high"
  zscore_target = "bits"
}
```

#### data cloudflare\_magic\_network\_monitoring\_rule

##### required Expand Collapse

rule\_id: String

The id of the rule. Must be unique.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20rule_id>)

account\_id: String

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20account_id>)

##### computed Expand Collapse

id: String

The id of the rule. Must be unique.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20id>)

automatic\_advertisement: Bool

Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20automatic_advertisement>)

bandwidth\_threshold: Float64

The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20bandwidth_threshold>)

duration: String

The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values \[“1m”,“5m”,“10m”,“15m”,“20m”,“30m”,“45m”,“60m”].

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20duration>)

name: String

The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\_), dash (-), period (.), and tilde (\~). You can’t have a space in the rule name. Max 256 characters.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20name>)

packet\_threshold: Float64

The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20packet_threshold>)

prefix\_match: String

Prefix match type to be applied for a prefix auto advertisement when using an advanced\_ddos rule.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20prefix_match>)

type: String

MNM rule type.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20type>)

zscore\_sensitivity: String

Level of sensitivity set for zscore rules.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zscore_sensitivity>)

zscore\_target: String

Target of the zscore rule analysis.

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20zscore_target>)

prefixes: List\[String]

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-single)%20%3E%20(attribute)%20prefixes>)

### cloudflare\_magic\_network\_monitoring\_rule

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_magic_network_monitoring_rule" "example_magic_network_monitoring_rule" {
  account_id = "6f91088a406011ed95aed352566e8d4c"
  rule_id = "2890e6fa406311ed9b5a23f70f6fb8cf"
}
```

#### data cloudflare\_magic\_network\_monitoring\_rules

##### required Expand Collapse

account\_id: String

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20account_id>)

##### optional Expand Collapse

max\_items?: Int64

Max items to fetch, default: 1000

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20max_items>)

##### computed Expand Collapse

<details>

<summary>

result: List\[Attributes]

The items returned by the data source

</summary>

id: String

The id of the rule. Must be unique.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20id">Link to this property</a>

automatic\_advertisement: Bool

Toggle on if you would like Cloudflare to automatically advertise the IP Prefixes within the rule via Magic Transit when the rule is triggered. Only available for users of Magic Transit.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20automatic_advertisement">Link to this property</a>

name: String

The name of the rule. Must be unique. Supports characters A-Z, a-z, 0-9, underscore (\_), dash (-), period (.), and tilde (\~). You can’t have a space in the rule name. Max 256 characters.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20name">Link to this property</a>

prefixes: List\[String]

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20prefixes">Link to this property</a>

type: String

MNM rule type.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20type">Link to this property</a>

bandwidth\_threshold: Float64

The number of bits per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20bandwidth_threshold">Link to this property</a>

duration: String

The amount of time that the rule threshold must be exceeded to send an alert notification. The final value must be equivalent to one of the following 8 values \[“1m”,“5m”,“10m”,“15m”,“20m”,“30m”,“45m”,“60m”].

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20duration">Link to this property</a>

packet\_threshold: Float64

The number of packets per second for the rule. When this value is exceeded for the set duration, an alert notification is sent. Minimum of 1 and no maximum.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20packet_threshold">Link to this property</a>

prefix\_match: String

Prefix match type to be applied for a prefix auto advertisement when using an advanced\_ddos rule.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20prefix_match">Link to this property</a>

zscore\_sensitivity: String

Level of sensitivity set for zscore rules.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20zscore_sensitivity">Link to this property</a>

zscore\_target: String

Target of the zscore rule analysis.

<a href="#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result%20%3E%20(attribute)%20zscore_target">Link to this property</a>

</details>

[Link to this property](<#(resource)%20magic_network_monitoring.rules%20%3E%20(terraform%20datasource-plural)%20%3E%20(attribute)%20result>)

### cloudflare\_magic\_network\_monitoring\_rules

Terraform

HTTPTypeScriptPythonGoTerraform

```
data "cloudflare_magic_network_monitoring_rules" "example_magic_network_monitoring_rules" {
  account_id = "6f91088a406011ed95aed352566e8d4c"
}
```