powerstore_hostgroup (Resource)

HostGroup resource

Note: Exactly one of host_ids and host_names is required.
Note: host_connectivity cannot be used while creating host group resource but it can be used while updating the host group resource.

Example Usage

# Commands to run this tf file : terraform init && terraform plan && terraform apply
# Create, Update, Delete is supported for this resource
# To import , check host_group_import.tf for more info
# name and host_ids are the required attributes to create and update
# description is the optional attribute
# Host datasource can be used to fetch host id/name.
# To check which attributes of the host resource can be updated, please refer Product Guide in the documentation

resource "powerstore_hostgroup" "test" {
  name        = "test_hostgroup"
  description = "Creating host group"
  host_ids    = ["42c60954-ea71-4b50-b172-63880cd48f99"]
}

Schema

Required

  • name (String) The host group name.

Optional

  • description (String) An optional description for the host group.
  • host_connectivity (String) Connectivity type for hosts and host groups.
  • host_ids (Set of String) The list of host IDs to include in the host group. Conflicts with host_names.
  • host_names (Set of String) The list of host names to include in the host group. Conflicts with host_ids.

Read-Only

  • id (String) Unique identifier of the host group.

Import

Import is supported using the following syntax:

# Below are the steps to import host group :
# Step 1 - To import a host group, we need the id of that host group
# Step 2 - To check the id of the host group we can make use of host group datasource to read required/all host group ids. Alternatively, we can make Get request to host group endpoint. eg. https://10.0.0.1/api/rest/host_group which will return list of all host group ids.
# Step 3 - Add empty resource block in tf file.
# eg.
# resource "powerstore_hostgroup" "resource_block_name" {
  # (resource arguments)
# }
# Step 4 - Execute the command: terraform import "powerstore_hostgroup.resource_block_name" "id_of_the_hostgroup" (resource_block_name must be taken from step 3 and id must be taken from step 2)
# Step 5 - After successful execution of the command , check the state file