Skip to content

xcsh_nat_policy (Data Source)

Retrieves information about a NAT Policy resource in F5 Distributed Cloud for nat policy create specification configures nat policy with multiple rules,. configuration. This is a read-only data source.

~> Note: For more information, see the F5 Distributed Cloud API documentation.

# NATPolicy Data Source Example
terraform {
required_version = ">= 1.0"
required_providers {
xcsh = {
source = "f5-sales-demo/xcsh"
version = ">= 0.1.0"
}
}
}
# Look up an existing NATPolicy by name
data "xcsh_nat_policy" "example" {
name = "example-nat-policy"
namespace = "staging"
}
output "nat_policy_id" {
value = data.xcsh_nat_policy.example.id
}

-> Syntax Rule: This provider uses OneOf groups for mutually exclusive options. Fields documented as “Optional Block” use block syntax field_name { ... }. Empty OneOf object attributes use field_name = {}; conditional selection uses condition ? {} : null. Boolean attributes (such as add_hsts and http_redirect) use = true or = false.

🔶 High Risk Operations — Some operations on this resource have high danger level. Destructive operations may require confirmation.

• name - Required String
Name of the NATPolicy

• namespace - Required String
Namespace where the NATPolicy exists

In addition to all arguments above, the following attributes are exported:

• annotations - Optional Map
Annotations applied to this resource

• description - Optional String
Description of the NATPolicy

• id - Optional String
Unique identifier for the resource

• labels - Optional Map
Labels applied to this resource

• rules - Optional List
List of rules to apply under the NAT Policy. Rule that matches first would be applied

• site - Optional String
Site Reference Type. Reference to Site Object


A rules block supports the following:

• action - Optional String
Action to apply on the packet if the NAT rule is applied

• cloud_connect - Optional String
Configuration parameter for cloud connect

• criteria - Optional String
Match criteria of the packet to apply the NAT Rule

• disable_spec - Optional Object
Enable this option

• enable - Optional Object
Enable this option

• name - Optional String
Name. Name of the Rule

• node_interface - Optional String
On multinode site, this type holds the information about per node interfaces

• segment - Optional String
Segment Reference Type. Reference to Segment Object

• virtual_network - Optional String
Carries the reference to virtual network

An action block (within rules) supports the following:

• dynamic - Optional String
Dynamic Pool. Dynamic Pool Configuration

• virtual_cidr - Optional String
Virtual Subnet NAT is static NAT that does a one-to-one translation between the real source IP CIDR in the policy and the virtual CIDR in a bidirectional fashion. The range of the real CIDR and virtual CIDRs should be the same (e.g. If the real CIDR has the CIDR

A dynamic block (within rules.action) supports the following:

• elastic_ips - Optional String
List of references to Cloud Elastic IP Object

• pools - Optional String
List of IPv4 prefixes that represent an endpoint

An elastic_ips block (within rules.action.dynamic) supports the following:

• refs - Optional List
Reference to one or more cloud elastic IP objects

A refs block (within rules.action.dynamic.elastic_ips) supports the following:

• kind - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then kind will hold the referred object’s kind (e.g. ‘route’)

• name - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then name will hold the referred object’s(e.g. Route’s) name

• namespace - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then namespace will hold the referred object’s(e.g. Route’s) namespace

• tenant - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then tenant will hold the referred object’s(e.g. Route’s) tenant

• uid - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then uid will hold the referred object’s(e.g. Route’s) uid

A pools block (within rules.action.dynamic) supports the following:

• prefixes - Optional List
List of IPv4 prefixes that represent an endpoint

A cloud_connect block (within rules) supports the following:

• refs - Optional List
Cloud Connect. Reference to Cloud Connect Object

A refs block (within rules.cloud_connect) supports the following:

• kind - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then kind will hold the referred object’s kind (e.g. ‘route’)

• name - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then name will hold the referred object’s(e.g. Route’s) name

• namespace - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then namespace will hold the referred object’s(e.g. Route’s) namespace

• tenant - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then tenant will hold the referred object’s(e.g. Route’s) tenant

• uid - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then uid will hold the referred object’s(e.g. Route’s) uid

A criteria block (within rules) supports the following:

• any - Optional Object
Enable this option

• destination_cidr - Optional List
Destination IP. Destination IP of the packet to match

• icmp - Optional Object
Enable this option

• site_local_inside_network - Optional Object
Enable this option

• site_local_network - Optional Object
Enable this option

• source_cidr - Optional List
Source IP. Source IP of the packet to match

• tcp - Optional String
Action to apply on the packet if the NAT rule is applied

• udp - Optional String
Action to apply on the packet if the NAT rule is applied

A tcp block (within rules.criteria) supports the following:

• destination_port - Optional String
Port match of the request can be a range or a specific port

• source_port - Optional String
Port match of the request can be a range or a specific port

A destination_port block (within rules.criteria.tcp) supports the following:

• no_port_match - Optional Object
Enable this option

• port - Optional Number
Exact Port to match

• port_ranges - Optional String
Port range to match

Rules Criteria TCP Destination Port No Port Match

Section titled “Rules Criteria TCP Destination Port No Port Match”

Deeply nested Match block collapsed for readability.

A source_port block (within rules.criteria.tcp) supports the following:

• no_port_match - Optional Object
Enable this option

• port - Optional Number
Exact Port to match

• port_ranges - Optional String
Port range to match

Rules Criteria TCP Source Port No Port Match

Section titled “Rules Criteria TCP Source Port No Port Match”

Deeply nested Match block collapsed for readability.

An udp block (within rules.criteria) supports the following:

• destination_port - Optional String
Port match of the request can be a range or a specific port

• source_port - Optional String
Port match of the request can be a range or a specific port

A destination_port block (within rules.criteria.udp) supports the following:

• no_port_match - Optional Object
Enable this option

• port - Optional Number
Exact Port to match

• port_ranges - Optional String
Port range to match

Rules Criteria UDP Destination Port No Port Match

Section titled “Rules Criteria UDP Destination Port No Port Match”

Deeply nested Match block collapsed for readability.

A source_port block (within rules.criteria.udp) supports the following:

• no_port_match - Optional Object
Enable this option

• port - Optional Number
Exact Port to match

• port_ranges - Optional String
Port range to match

Rules Criteria UDP Source Port No Port Match

Section titled “Rules Criteria UDP Source Port No Port Match”

Deeply nested Match block collapsed for readability.

A disable_spec block (within rules) supports the following:

An enable block (within rules) supports the following:

A node_interface block (within rules) supports the following:

• list - Optional List
On a multinode site, this list holds the nodes and corresponding networking_interface

A list block (within rules.node_interface) supports the following:

• interface - Optional List
Interface. Interface reference on this node

• node - Optional String
Node. Node name on this site

An interface block (within rules.node_interface.list) supports the following:

• kind - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then kind will hold the referred object’s kind (e.g. ‘route’)

• name - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then name will hold the referred object’s(e.g. Route’s) name

• namespace - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then namespace will hold the referred object’s(e.g. Route’s) namespace

• tenant - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then tenant will hold the referred object’s(e.g. Route’s) tenant

• uid - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then uid will hold the referred object’s(e.g. Route’s) uid

A segment block (within rules) supports the following:

• refs - Optional List
Segment. Reference to Segment Object

A refs block (within rules.segment) supports the following:

• kind - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then kind will hold the referred object’s kind (e.g. ‘route’)

• name - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then name will hold the referred object’s(e.g. Route’s) name

• namespace - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then namespace will hold the referred object’s(e.g. Route’s) namespace

• tenant - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then tenant will hold the referred object’s(e.g. Route’s) tenant

• uid - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then uid will hold the referred object’s(e.g. Route’s) uid

A virtual_network block (within rules) supports the following:

• refs - Optional List
Virtual Network Reference. Reference to virtual network

A refs block (within rules.virtual_network) supports the following:

• kind - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then kind will hold the referred object’s kind (e.g. ‘route’)

• name - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then name will hold the referred object’s(e.g. Route’s) name

• namespace - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then namespace will hold the referred object’s(e.g. Route’s) namespace

• tenant - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then tenant will hold the referred object’s(e.g. Route’s) tenant

• uid - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then uid will hold the referred object’s(e.g. Route’s) uid

A site block supports the following:

• refs - Optional List
Site. Reference to Site Object

A refs block (within site) supports the following:

• kind - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then kind will hold the referred object’s kind (e.g. ‘route’)

• name - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then name will hold the referred object’s(e.g. Route’s) name

• namespace - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then namespace will hold the referred object’s(e.g. Route’s) namespace

• tenant - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then tenant will hold the referred object’s(e.g. Route’s) tenant

• uid - Optional String
When a configuration object(e.g. Virtual_host) refers to another(e.g route) then uid will hold the referred object’s(e.g. Route’s) uid


The following type definitions are used throughout this resource. See the full definition here rather than repeated inline.

Object Reference {#common-object-reference}

Section titled “Object Reference {#common-object-reference}”

Object references establish a direct reference from one configuration object to another in F5 Distributed Cloud. References use the format tenant/namespace/name.

FieldTypeDescription
nameStringName of the referenced object
namespaceStringNamespace containing the referenced object
tenantStringTenant of the referenced object (system-managed)

Transformers apply transformations to input values before matching. Multiple transformers can be applied in order.

ValueDescription
LOWER_CASEConvert to lowercase
UPPER_CASEConvert to uppercase
BASE64_DECODEDecodebase64 content
NORMALIZE_PATHNormalize URL path
REMOVE_WHITESPACERemove whitespace characters
URL_DECODEDecode URL-encoded characters
TRIM_LEFTTrim leading whitespace
TRIM_RIGHTTrim trailing whitespace
TRIMTrim both leading and trailing whitespace

HTTP methods used for request matching.

ValueDescription
ANYMatch any HTTP method
GETHTTP GET request
HEADHTTP HEAD request
POSTHTTP POST request
PUTHTTP PUT request
DELETEHTTP DELETE request
CONNECTHTTP CONNECT request
OPTIONSHTTP OPTIONS request
TRACEHTTP TRACE request
PATCHHTTP PATCH request
COPYHTTP COPY request (WebDAV)

TLS Fingerprints {#common-tls-fingerprints}

Section titled “TLS Fingerprints {#common-tls-fingerprints}”

TLS fingerprint categories for malicious client detection.

ValueDescription
TLS_FINGERPRINT_NONENo fingerprint matching
ANY_MALICIOUS_FINGERPRINTMatch any known malicious fingerprint
ADWAREAdware-associated fingerprints
DRIDEXDridex malware fingerprints
GOOTKITGootkit malware fingerprints
RANSOMWARERansomware-associated fingerprints
TRICKBOTTrickbot malware fingerprints

IP Threat Categories {#common-ip-threat-categories}

Section titled “IP Threat Categories {#common-ip-threat-categories}”

IP address threat categories for security filtering.

ValueDescription
SPAM_SOURCESKnown spam sources
WINDOWS_EXPLOITSWindows exploit sources
WEB_ATTACKSWeb attack sources
BOTNETSKnown botnet IPs
SCANNERSNetwork scanner IPs
REPUTATIONPoor reputation IPs
PHISHINGPhishing-related IPs
PROXYAnonymous proxy IPs
MOBILE_THREATSMobile threat sources
TOR_PROXYTor exit nodes
DENIAL_OF_SERVICEDoS attack sources
NETWORKKnown bad network ranges