# 

# exoscale_security_group (Data Source)

Fetch [Exoscale Security Groups](https://community.exoscale.com/product/compute/instances/quick-start/#firewall-rules---security-groups).

Security Groups are firewall rules. Each Security Group may be attached to one or many compute instances.

Corresponding resource: [exoscale_security_group]({{< ref "../resources/security_group.md" >}}).

## Example Usage

```terraform
data "exoscale_security_group" "my_security_group" {
  name = "my-security-group"
}

output "my_security_group_id" {
  value = data.exoscale_security_group.my_security_group.id
}
```

Please refer to the [examples](https://github.com/exoscale/terraform-provider-exoscale/tree/master/examples/)
directory for complete configuration examples.

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `id` (String) The ID of the Security Group (required if `name` is not set).
- `name` (String) The name of the Security Group (required if `id` is not set).
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `description` (String) A free-form text describing the the Security Group.
- `external_sources` (Set of String) A list of external network sources, in [CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#CIDR_notation) notation.

<a id="nestedblock--timeouts"></a>
### Nested Schema for `timeouts`

Optional:

- `read` (String) A string that can be [parsed as a duration](https://pkg.go.dev/time#ParseDuration) consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Read operations occur during any refresh or planning operation when refresh is enabled.



