You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(security-group):ZSTAC-76758. add data source and resource for security group attachment
- Added `data_source_zstack_networking_secgroup` to support querying ZStack security groups via Terraform
- Implemented `resource_zstack_networking_secgroup_attachment` to allow attaching VM NICs to security groups
page_title: "zstack_networking_secgroups Data Source - terraform-provider-zstack"
3
+
subcategory: ""
4
+
description: |-
5
+
Query ZStack Security Groups by name, name pattern, or additional filters.
6
+
---
7
+
8
+
# zstack_networking_secgroups (Data Source)
9
+
10
+
Query ZStack Security Groups by name, name pattern, or additional filters.
11
+
12
+
## Example Usage
13
+
14
+
```terraform
15
+
data "zstack_networking_secgroups" "test" {
16
+
#name = "p1"
17
+
name_pattern = "p%"
18
+
filter {
19
+
name = "state"
20
+
values = ["Enabled"]
21
+
}
22
+
}
23
+
24
+
output "zstack_secs" {
25
+
value = data.zstack_networking_secgroups.test
26
+
}
27
+
```
28
+
29
+
<!-- schema generated by tfplugindocs -->
30
+
## Schema
31
+
32
+
### Optional
33
+
34
+
-`filter` (Block List) Filter results by fields in the security group, such as state or IP version. (see [below for nested schema](#nestedblock--filter))
35
+
-`name` (String) Exact name for querying a security group.
36
+
-`name_pattern` (String) Pattern for fuzzy matching security group names. Use % or _ like SQL.
37
+
38
+
### Read-Only
39
+
40
+
-`networking_secgroups` (Attributes List) List of matched security groups. (see [below for nested schema](#nestedatt--networking_secgroups))
41
+
42
+
<aid="nestedblock--filter"></a>
43
+
### Nested Schema for `filter`
44
+
45
+
Required:
46
+
47
+
-`name` (String) Name of the field to filter by.
48
+
-`values` (Set of String) List of values to match. Treated as OR conditions.
49
+
50
+
51
+
<aid="nestedatt--networking_secgroups"></a>
52
+
### Nested Schema for `networking_secgroups`
53
+
54
+
Read-Only:
55
+
56
+
-`attached_l3network_uuids` (Set of String) Set of L3 network UUIDs attached to the security group.
57
+
-`description` (String) Description of the security group.
58
+
-`name` (String) Name of the security group.
59
+
-`rules` (Attributes Set) List of security group rules. (see [below for nested schema](#nestedatt--networking_secgroups--rules))
60
+
-`state` (String) State of the security group (Enabled, Disabled).
0 commit comments