diff --git a/docs/data-sources/connector.md b/docs/data-sources/connector.md new file mode 100644 index 0000000..7ab2d8c --- /dev/null +++ b/docs/data-sources/connector.md @@ -0,0 +1,40 @@ +--- +# generated by https://github.com/hashicorp/terraform-plugin-docs +page_title: "cml2_connector Data Source - terraform-provider-cml2" +subcategory: "" +description: |- + A data source that retrieves external connectors information from the controller. +--- + +# cml2_connector (Data Source) + +A data source that retrieves external connectors information from the controller. + + + + +## Schema + +### Optional + +- `label` (String) A connector label to filter the connector list returned by the controller. Connector labels must be unique, so it's either one group or no group at all if a name filter is provided. +- `tag` (String) A tag name to filter the groups list returned by the controller. Connector tags can be defined on multiple connectors, a list can be returned. + +### Read-Only + +- `connectors` (Attributes List) A list of all permission groups available on the controller. (see [below for nested schema](#nestedatt--connectors)) +- `id` (String) A UUID. The presence of the ID attribute is mandated by the framework. The attribute is a random UUID and has no actual significance. + + +### Nested Schema for `connectors` + +Read-Only: + +- `device_name` (String) the actual (Linux network) device name of the external connector. +- `id` (String) External connector identifier, a UUID. +- `label` (String) The label of the external connector, like "NAT" or "System Bridge". +- `protected` (Boolean) Whether the connector is protected, e.g. BPDUs are filtered or not. +- `snooped` (Boolean) True if the IP address snooper listens on this connector. +- `tags` (Set of String) The external connector tag set. + + diff --git a/docs/data-sources/node.md b/docs/data-sources/node.md index e0b37dd..f3b6d85 100644 --- a/docs/data-sources/node.md +++ b/docs/data-sources/node.md @@ -48,6 +48,7 @@ Read-Only: - `cpu_limit` (Number) CPU limit in %, 20-100. Can be changed until the node is started once. Will require a replace in that case. - `cpus` (Number) Number of CPUs. Can be changed until the node is started once. Will require a replace in that case. - `data_volume` (Number) Size of data volume, in GB. Can be changed until the node is started once. Will require a replace in that case. +- `hide_links` (Boolean) If true, links are not shown in the topology. This is a visual cue and does not influence any simulation function. - `id` (String) Node ID (UUID). - `imagedefinition` (String) Image definition, must match the node type. Can be changed until the node is started once. Will require a replace in that case. - `interfaces` (Attributes List) List of interfaces on the node. (see [below for nested schema](#nestedatt--node--interfaces)) diff --git a/docs/resources/lifecycle.md b/docs/resources/lifecycle.md index 56692f5..f60632a 100644 --- a/docs/resources/lifecycle.md +++ b/docs/resources/lifecycle.md @@ -198,6 +198,7 @@ Optional: - `cpu_limit` (Number) CPU limit in %, 20-100. Can be changed until the node is started once. Will require a replace in that case. - `cpus` (Number) Number of CPUs. Can be changed until the node is started once. Will require a replace in that case. - `data_volume` (Number) Size of data volume, in GB. Can be changed until the node is started once. Will require a replace in that case. +- `hide_links` (Boolean) If true, links are not shown in the topology. This is a visual cue and does not influence any simulation function. - `imagedefinition` (String) Image definition, must match the node type. Can be changed until the node is started once. Will require a replace in that case. - `ram` (Number) Amount of RAM, megabytes. Can be changed until the node is started once. Will require a replace in that case. - `tags` (Set of String) Set of tags of the node. diff --git a/docs/resources/node.md b/docs/resources/node.md index 263b879..7a14fe3 100644 --- a/docs/resources/node.md +++ b/docs/resources/node.md @@ -28,6 +28,7 @@ A node resource represents a CML node. At create time, the lab ID, a node defini - `cpu_limit` (Number) CPU limit in %, 20-100. Can be changed until the node is started once. Will require a replace in that case. - `cpus` (Number) Number of CPUs. Can be changed until the node is started once. Will require a replace in that case. - `data_volume` (Number) Size of data volume, in GB. Can be changed until the node is started once. Will require a replace in that case. +- `hide_links` (Boolean) If true, links are not shown in the topology. This is a visual cue and does not influence any simulation function. - `imagedefinition` (String) Image definition, must match the node type. Can be changed until the node is started once. Will require a replace in that case. - `ram` (Number) Amount of RAM, megabytes. Can be changed until the node is started once. Will require a replace in that case. - `tags` (Set of String) Set of tags of the node. diff --git a/examples/data-sources/cml2_connector/data_source.tf b/examples/data-sources/cml2_connector/data_source.tf new file mode 100644 index 0000000..6ecb290 --- /dev/null +++ b/examples/data-sources/cml2_connector/data_source.tf @@ -0,0 +1,15 @@ +# Get a list of all connectors on the system with either the provided tag (the +# result can have multiple elements) or with a specific name/label (the result +# has exactly one or zero elements if the label does not exist). + +data "cml2_connector" "nat" { + tag = "NAT" + # Alternatively (or in combination, logical AND): + # label = "System Bridge" +} + +output "nat_connector" { + # The label can be used as the configuration of an external connector node + # The ID is mostly for internal use. + value = data.cml2_connector.nat.connectors[0].label +}