host_group
This resource allows you to manage host groups in the CrowdStrike Falcon Platform.
API Scopes
Section titled “API Scopes”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
Example Usage
Section titled “Example Usage”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}Schema
Section titled “Schema”Required
Section titled “Required”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.
Optional
Section titled “Optional”assignment_rule(String) The assignment rule used for dynamic host groups. Required iftypeisdynamic.host_ids(Set of String) A set of host IDs to include in a staticByID host group. Required iftypeisstaticByID.hostnames(Set of String) A set of hostnames to include in a static host group. Required iftypeisstatic.
Read-Only
Section titled “Read-Only”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
Section titled “Import”Import is supported using the following syntax:
# host group can be imported by specifying the policy id.terraform import crowdstrike_host_group.example 7fb858a949034a0cbca175f660f1e769