Skip to content

xcsh_site_registration (Data Source)

Resolves the runtime registration of a site’s Customer Edge (CE) node in F5 Distributed Cloud. This is a read-only data source.

A registration is named r-<uuid>, not after the site it belongs to, so it cannot be read by site name. This data source lists the registrations belonging to a site and returns the one that matches, giving you the name that xcsh_registration_approval requires.

The registration only exists once the CE has booted and registered with its token. Until then this data source reports found = false without raising an error, so an approval can safely be gated on it:

data "xcsh_site_registration" "ce" {
site_name = xcsh_securemesh_site_v2.ce.name
}
resource "xcsh_registration_approval" "ce" {
count = data.xcsh_site_registration.ce.found ? 1 : 0
name = data.xcsh_site_registration.ce.name
namespace = "system"
cluster_size = 1
}

Possible state values: NOTSET, NEW, APPROVED, ADMITTED, RETIRED, FAILED, DONE, PENDING, ONLINE, UPGRADING, MAINTENANCE, FAILED_INACTIVE.

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

# Example: Resolve a Customer Edge registration so it can be approved
#
# A registration is named "r-<uuid>", NOT after the site, so it cannot be read
# by site name. This data source finds the registration that belongs to a site.
#
# It returns found = false — with no error — until the CE has booted and
# registered, so an approval can safely be gated on it.
terraform {
required_version = ">= 1.0"
required_providers {
xcsh = {
source = "f5-sales-demo/xcsh"
version = ">= 0.1.0"
}
}
}
data "xcsh_site_registration" "ce" {
site_name = "my-ce-site"
namespace = "system"
}
# A multi-node site returns one registration per node; pick one by hostname.
data "xcsh_site_registration" "ha_ce_node_0" {
site_name = "my-ha-ce-site"
hostname = "master-0"
}
output "registration_name" {
description = "Registration name (r-<uuid>) to approve, null until the CE registers"
value = data.xcsh_site_registration.ce.name
}
output "registration_state" {
description = "Current registration state (PENDING, ONLINE, ...)"
value = data.xcsh_site_registration.ce.state
}
output "ha_node_0_registration_name" {
description = "Registration name of the master-0 node of the three-node site"
value = data.xcsh_site_registration.ha_ce_node_0.name
}
# Approve the registration only once it exists — on the first apply the CE has
# not registered yet, so nothing is planned; re-apply after the node boots.
resource "xcsh_registration_approval" "ce" {
count = data.xcsh_site_registration.ce.found ? 1 : 0
name = data.xcsh_site_registration.ce.name
namespace = data.xcsh_site_registration.ce.namespace
cluster_size = 1
}

-> 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.

• namespace - Optional String Defaults to “system, where site registrations live
Namespace holding the registrations

• hostname - Optional String
Node hostname used to pick one registration when a multi-node site has several. Optional for a single-node site; when omitted, the resolved node’s hostname is returned here. Hostnames are only unique within a site

• site_name - Required String
Name of the F5 XC site whose CE registration should be resolved. Matched against each registration’s get_spec.passport.cluster_name

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

• cluster_name - Optional String
Cluster name the CE registered with, as reported in its passport. Equals site_name for a correctly configured site

• cluster_size - Optional Number
Number of nodes the CE reported for its cluster (1 for a single-node site, 3 for a three-node site)

• found - Optional Bool
Whether a registration was resolved. false (with no error) while the CE has not registered yet — gate an approval’s count on this

• id - Optional String
Identifier of this lookup: the registration name when one is found, otherwise null

• instance_id - Optional String
Infrastructure instance identifier reported by the CE registration (get_spec.infra.instance_id). This distinguishes rebuilt nodes that reuse the same site and hostname

• name - Optional String
Registration name (r-“) to pass to xcsh_registration_approval. Null when found is false

• provider_type - Optional String
Infrastructure provider the CE reported, e.g. AZURE, AWS, GCP, VMWARE

• state - Optional String
Current registration state, e.g. PENDING (awaiting approval) or ONLINE (node admitted and healthy)

• uid - Optional String
Unique identifier of the registration (the <uuid> part of the name)


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