---
title: "openstack_networking_secgroup_v2"
description: ""
sidebar_position: 12
---

# openstack\_networking\_secgroup\_v2

:::info

This instruction is a copy of the official OpenStack Terraform provider documentation in the [Terraform Registry](https://registry.terraform.io/providers/terraform-provider-openstack/openstack/latest/docs).

:::

Use this data source to get the ID of an available OpenStack security group.

## Example Usage

```hcl
data "openstack_networking_secgroup_v2" "secgroup" {
  name = "tf_test_secgroup"
}
```

## Argument Reference

* `region` — (Optional) the region from which to obtain the V2 Neutron client. A Neutron client is required to retrieve security group IDs. If omitted, the `region` argument of the provider is used.

* `secgroup_id` — (Optional) The ID of the security group.

* `name` — (Optional) The name of the security group.

* `description` — (Optional) Human-readable description of the subnet.

* `tags` — (Optional) The list of security group tags to filter.

* `tenant_id` — (Optional) The owner of the security group.

* `stateful` — (Optional) Whether the security group is stateful or not.

## Attributes Reference

`id` is set to the ID of the found security group. In addition, the following attributes are exported:

* `name` — See Argument Reference above.
* `description` — See Argument Reference above.
* `all_tags` — The set of string tags applied on the security group.
* `region` — See Argument Reference above.
* `stateful` — See Argument Reference above.
