Skip to main content

dtcloud_security_groups (Data Source)

Lists the security groups visible to the caller.

The list endpoint reports an id, a name and a description, and nothing else. Rules would be one more call per group, so read a group with dtcloud_security_group when you need them.

Example Usage​

data "dtcloud_security_groups" "all" {}

data "dtcloud_security_groups" "named_web" {
name = "web-tier"
}

Schema​

Optional​

  • name (String) Only return security groups with this exact name. Names are not unique, so this can still match several.

Read-Only​

  • id (String) The ID of this resource.
  • ids (List of String) Just the ids, for the common case of filling a VM interface's security_groups, which takes ids.
  • security_groups (List of Object) The security groups that matched. (see below for nested schema)

Nested Schema for security_groups​

Read-Only:

  • description (String)
  • id (String)
  • name (String)

Behaviour worth knowing​

  • name is applied by the provider, since the list route takes no query parameters, and it can still match several groups.
  • ids follows the order of security_groups. For one specific group, look it up with the dtcloud_security_group data source rather than indexing into the list.