Skip to content

host_group

This resource allows you to manage host groups in the CrowdStrike Falcon Platform.

The following API scopes are required:

  • Host groups: READ
  • Host groups: WRITE
  • Firewall management: READ
  • Firewall management: WRITE
  • Prevention policies: READ
  • Prevention policies: WRITE
  • Response policies: READ
  • Response policies: WRITE
  • Sensor update policies: READ
  • Sensor update policies: WRITE
terraform {
required_providers {
crowdstrike = {
source = "registry.terraform.io/crowdstrike/crowdstrike"
}
}
}
provider "crowdstrike" {
cloud = "us-2"
}
resource "crowdstrike_host_group" "dynamic" {
assignment_rule = "tags:'SensorGroupingTags/molecule'+os_version:'Debian GNU 11'"
description = "Made with terraform"
name = "Dyanmic Host Group"
type = "dynamic"
}
resource "crowdstrike_host_group" "static" {
description = "Made with terraform"
name = "Static Host Group rename"
type = "static"
hostnames = ["host1", "host2"]
}
resource "crowdstrike_host_group" "staticByID" {
description = "Made with terraform"
name = "staticByID Host Group"
type = "staticByID"
host_ids = ["123123", "124124"]
}
output "host_group" {
value = crowdstrike_host_group.dynamic
}
  • description (String) A description for the host group.
  • name (String) The display name for the host group.
  • type (String) The type of host group. Valid values: dynamic, static, staticByID. This value is case sensitive.
  • assignment_rule (String) The assignment rule used for dynamic host groups. Required if type is dynamic.
  • host_ids (Set of String) A set of host IDs to include in a staticByID host group. Required if type is staticByID.
  • hostnames (Set of String) A set of hostnames to include in a static host group. Required if type is static.
  • id (String) The unique identifier for the host group.
  • last_updated (String) The RFC850 timestamp of the last update to this resource by Terraform.

Import is supported using the following syntax:

Terminal window
# host group can be imported by specifying the policy id.
terraform import crowdstrike_host_group.example 7fb858a949034a0cbca175f660f1e769