github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/website/source/docs/providers/openstack/r/compute_servergroup_v2.html.markdown (about) 1 --- 2 layout: "openstack" 3 page_title: "OpenStack: openstack_compute_servergroup_v2" 4 sidebar_current: "docs-openstack-resource-compute-servergroup-v2" 5 description: |- 6 Manages a V2 Server Group resource within OpenStack. 7 --- 8 9 # openstack\_compute\_servergroup_v2 10 11 Manages a V2 Server Group resource within OpenStack. 12 13 ## Example Usage 14 15 ```hcl 16 resource "openstack_compute_servergroup_v2" "test-sg" { 17 name = "my-sg" 18 policies = ["anti-affinity"] 19 } 20 ``` 21 22 ## Argument Reference 23 24 The following arguments are supported: 25 26 * `region` - (Required) The region in which to obtain the V2 Compute client. 27 If omitted, the `OS_REGION_NAME` environment variable is used. Changing 28 this creates a new server group. 29 30 * `name` - (Required) A unique name for the server group. Changing this creates 31 a new server group. 32 33 * `policies` - (Required) The set of policies for the server group. Only two 34 two policies are available right now, and both are mutually exclusive. See 35 the Policies section for more information. Changing this creates a new 36 server group. 37 38 * `value_specs` - (Optional) Map of additional options. 39 40 ## Policies 41 42 * `affinity` - All instances/servers launched in this group will be hosted on 43 the same compute node. 44 45 * `anti-affinity` - All instances/servers launched in this group will be 46 hosted on different compute nodes. 47 48 ## Attributes Reference 49 50 The following attributes are exported: 51 52 * `region` - See Argument Reference above. 53 * `name` - See Argument Reference above. 54 * `policies` - See Argument Reference above. 55 * `members` - The instances that are part of this server group. 56 57 ## Import 58 59 Server Groups can be imported using the `id`, e.g. 60 61 ``` 62 $ terraform import openstack_compute_servergroup_v2.test-sg 1bc30ee9-9d5b-4c30-bdd5-7f1e663f5edf 63 ```