Skip to content

Commit

Permalink
add crowdstrike_host_group resource
Browse files Browse the repository at this point in the history
  • Loading branch information
ffalor committed Apr 27, 2024
1 parent 6082409 commit eacc545
Show file tree
Hide file tree
Showing 11 changed files with 725 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
paths-ignore:
- 'README.md'
push:
branches:
- main
paths-ignore:
- 'README.md'

Expand Down Expand Up @@ -55,7 +57,7 @@ jobs:
if: |
(github.event_name == 'pull_request_target' &&
github.event.label.name == 'ok-to-test') ||
contains(fromJson('["push", "workflow_dispatch", "schedule"]'), github.event_name)
contains(fromJson('["push", "pull_request", "workflow_dispatch", "schedule"]'), github.event_name)
name: Terraform Provider Acceptance Tests
needs: build
runs-on: ubuntu-latest
Expand Down
66 changes: 66 additions & 0 deletions docs/resources/host_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "crowdstrike_host_group Resource - crowdstrike"
subcategory: ""
description: |-
---

# crowdstrike_host_group (Resource)



## Example Usage

```terraform
terraform {
required_providers {
crowdstrike = {
source = "registry.terraform.io/crowdstrike/crowdstrike"
}
}
}
provider "crowdstrike" {
cloud = "us-2"
}
resource "crowdstrike_host_group" "test" {
name = "example_host_group"
description = "made with terraform"
type = "dynamic"
assignment_rule = "tags:'SensorGroupingTags/cloud-lab'+os_version:'Amazon Linux 2'"
}
output "host_group" {
value = crowdstrike_host_group.test
}
```

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

### Required

- `name` (String) Host Group name
- `type` (String) The Host Group type, case sensitive (dynamic, static, staticByID)

### Optional

- `assignment_rule` (String) The assignment rule for dynamic host groups
- `description` (String) Host Group description

### Read-Only

- `id` (String) Host Group id
- `last_updated` (String)

## Import

Import is supported using the following syntax:

```shell
# Sensor update policies can be imported by specifying the policy id.
terraform import crowdstrike_host_group.example 7fb858a949034a0cbca175f660f1e769
```
3 changes: 3 additions & 0 deletions examples/resources/crowdstrike_host_group/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Sensor update policies can be imported by specifying the policy id.
terraform import crowdstrike_host_group.example 7fb858a949034a0cbca175f660f1e769

23 changes: 23 additions & 0 deletions examples/resources/crowdstrike_host_group/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
terraform {
required_providers {
crowdstrike = {
source = "registry.terraform.io/crowdstrike/crowdstrike"
}
}
}

provider "crowdstrike" {
cloud = "us-2"
}


resource "crowdstrike_host_group" "test" {
name = "example_host_group"
description = "made with terraform"
type = "dynamic"
assignment_rule = "tags:'SensorGroupingTags/cloud-lab'+os_version:'Amazon Linux 2'"
}

output "host_group" {
value = crowdstrike_host_group.test
}
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ module github.com/crowdstrike/terraform-provider-crowdstrike
go 1.21

require (
github.com/crowdstrike/gofalcon v0.6.0
github.com/hashicorp/go-version v1.6.0
github.com/crowdstrike/gofalcon v0.6.1-0.20240426204036-ac8ce2b4f2d7
github.com/hashicorp/terraform-plugin-docs v0.19.1
github.com/hashicorp/terraform-plugin-framework v1.8.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
Expand Down Expand Up @@ -53,6 +52,7 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/go-plugin v1.6.0 // indirect
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.6.0 // indirect
github.com/hashicorp/hc-install v0.6.4 // indirect
github.com/hashicorp/hcl/v2 v2.20.0 // indirect
github.com/hashicorp/logutils v1.0.0 // indirect
Expand Down Expand Up @@ -93,7 +93,7 @@ require (
go.opentelemetry.io/otel/metric v1.26.0 // indirect
go.opentelemetry.io/otel/trace v1.26.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 // indirect
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/oauth2 v0.19.0 // indirect
Expand Down
10 changes: 6 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZ
github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/crowdstrike/gofalcon v0.6.0 h1:89rfmPUb2ijghJlAdeck9bHyliRccMl/Vx+upOtSFpc=
github.com/crowdstrike/gofalcon v0.6.0/go.mod h1:JAHla2rOFWDvcynwcICRELOmdi47+5lH9a5rxvxIZ/M=
github.com/crowdstrike/gofalcon v0.6.1-0.20240426204036-ac8ce2b4f2d7 h1:NLcXFICTUakAvJFSH8z+Ht6SfJ52FbOasYdP8p7BcsQ=
github.com/crowdstrike/gofalcon v0.6.1-0.20240426204036-ac8ce2b4f2d7/go.mod h1:7KSolP3XCntqZiu7GfGd8uedAQ82dqBNpP0gqBksWB8=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -263,8 +263,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819 h1:EDuYyU/MkFXllv9QF9819VlI9a4tzGuCbhG0ExK9o1U=
golang.org/x/exp v0.0.0-20230809150735-7b3493d9a819/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df h1:UA2aFVmmsIlefxMk29Dp2juaUSth8Pyn3Tq5Y5mJGME=
golang.org/x/exp v0.0.0-20230626212559-97b1e661b5df/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
Expand Down Expand Up @@ -301,6 +301,8 @@ golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
Expand Down
Loading

0 comments on commit eacc545

Please sign in to comment.