Data Sources
zsphere_clusters
Fetches a list of clusters and their associated attributes.
zsphere_clusters (Data Source)
Fetches a list of clusters and their associated attributes.
Example Usage
data "zsphere_clusters" "test" {
}
output "zstack_secs" {
value = data.zsphere_clusters.test
}
# example output:
# zstack_secs = {
# "clusters" = tolist([
# {
# "hypervisor_type" = "KVM"
# "name" = "Cluster-1"
# "state" = "Enabled"
# "type" = "zstack"
# "uuid" = "5568b28dbaed465daf768b533b1fe72d"
# "zone_uuid" = "86643f5442164890b8b71de5b582dc9f"
# }
# ])
# "filter" = tolist([])
# "name" = tostring(null)
# "name_pattern" = tostring(null)
# }Schema
Optional
filter(Block List) Filter resources based on any field in the schema. For example, to filter by status, usename = "status"andvalues = ["Ready"]. (see below for nested schema)name(String) Exact name for searching Clustername_pattern(String) Pattern for fuzzy name search, similar to MySQL LIKE. Use % for multiple characters and _ for exactly one character.
Read-Only
clusters(Attributes List) List of clusters matching the specified filters (see below for nested schema)
Nested Schema for filter
Required:
name(String) Name of the field to filter by (e.g., status, state).values(Set of String) Values to filter by. Multiple values will be treated as an OR condition.
Nested Schema for clusters
Read-Only:
hypervisor_type(String) Type of hypervisor used by the cluster (e.g., KVM, ESXi)name(String) Name of the clusterstate(String) State of the cluster (e.g., Enabled, Disabled)type(String) ype of the clusteruuid(String) UUID identifier of the clusterzone_uuid(String) UUID of the zone to which the cluster belongs