Skip to content

Commit 3eeccbf

Browse files
authored
add the ability to assign hosts for static and staticByID host groups (#34)
1 parent 1420c31 commit 3eeccbf

File tree

5 files changed

+541
-59
lines changed

5 files changed

+541
-59
lines changed

docs/resources/host_group.md

+21-5
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,29 @@ provider "crowdstrike" {
3939
}
4040
4141
42-
resource "crowdstrike_host_group" "example" {
43-
name = "example_host_group"
44-
description = "made with terraform"
42+
resource "crowdstrike_host_group" "dynamic" {
43+
assignment_rule = "tags:'SensorGroupingTags/molecule'+os_version:'Debian GNU 11'"
44+
description = "Made with terraform"
45+
name = "Dyanmic Host Group"
4546
type = "dynamic"
46-
assignment_rule = "tags:'SensorGroupingTags/cloud-lab'+os_version:'Amazon Linux 2'"
47+
}
48+
49+
resource "crowdstrike_host_group" "static" {
50+
description = "Made with terraform"
51+
name = "Dyanmic Host Group"
52+
type = "static"
53+
hostnames = ["host1", "host2"]
54+
}
55+
56+
resource "crowdstrike_host_group" "staticByID" {
57+
description = "Made with terraform"
58+
name = "Dyanmic Host Group"
59+
type = "staticByID"
60+
host_ids = ["123123", "124124"]
4761
}
4862
4963
output "host_group" {
50-
value = crowdstrike_host_group.example
64+
value = crowdstrike_host_group.dynamic
5165
}
5266
```
5367

@@ -63,6 +77,8 @@ output "host_group" {
6377
### Optional
6478

6579
- `assignment_rule` (String) The assignment rule for dynamic host groups.
80+
- `host_ids` (Set of String) List of host ids to add to a staticByID host group.
81+
- `hostnames` (Set of String) List of hostnames to add to a static host group.
6682

6783
### Read-Only
6884

examples/resources/crowdstrike_host_group/resource.tf

+19-5
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,27 @@ provider "crowdstrike" {
1111
}
1212

1313

14-
resource "crowdstrike_host_group" "example" {
15-
name = "example_host_group"
16-
description = "made with terraform"
14+
resource "crowdstrike_host_group" "dynamic" {
15+
assignment_rule = "tags:'SensorGroupingTags/molecule'+os_version:'Debian GNU 11'"
16+
description = "Made with terraform"
17+
name = "Dyanmic Host Group"
1718
type = "dynamic"
18-
assignment_rule = "tags:'SensorGroupingTags/cloud-lab'+os_version:'Amazon Linux 2'"
19+
}
20+
21+
resource "crowdstrike_host_group" "static" {
22+
description = "Made with terraform"
23+
name = "Dyanmic Host Group"
24+
type = "static"
25+
hostnames = ["host1", "host2"]
26+
}
27+
28+
resource "crowdstrike_host_group" "staticByID" {
29+
description = "Made with terraform"
30+
name = "Dyanmic Host Group"
31+
type = "staticByID"
32+
host_ids = ["123123", "124124"]
1933
}
2034

2135
output "host_group" {
22-
value = crowdstrike_host_group.example
36+
value = crowdstrike_host_group.dynamic
2337
}

0 commit comments

Comments
 (0)