# 

# exoscale_security_group (Resource)

Manage Exoscale [Security Groups](https://community.exoscale.com/product/networking/security-group/).

Corresponding data source: [exoscale_security_group]({{< ref "../data-sources/security_group.md" >}}).

## Example Usage

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

Next step is to attach [exoscale_security_group_rule]({{< ref "./security_group_rule.md" >}})(s) to the group.

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

### Required

- `name` (String) ❗ The name of the Security Group.

### Optional

- `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.
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))

### Read-Only

- `id` (String) The ID of the Security Group.

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

Optional:

- `create` (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).
- `delete` (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). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
- `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.
- `update` (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).

-> The symbol ❗ in an attribute indicates that modifying it, will force the creation of a new resource.

## Import

An existing security group may be imported by `<ID>`:

```shell
terraform import \
  exoscale_security_group.my_security_group \
  f81d4fae-7dec-11d0-a765-00a0c91e6bf6
```

