github.com/nicgrayson/terraform@v0.4.3-0.20150415203910-c4de50829380/website/source/docs/providers/openstack/r/compute_secgroup_v2.html.markdown (about) 1 --- 2 layout: "openstack" 3 page_title: "OpenStack: openstack_compute_secgroup_v2" 4 sidebar_current: "docs-openstack-resource-compute-secgroup-2" 5 description: |- 6 Manages a V2 security group resource within OpenStack. 7 --- 8 9 # openstack\_compute\_secgroup_v2 10 11 Manages a V2 security group resource within OpenStack. 12 13 ## Example Usage 14 15 ``` 16 resource "openstack_compute_secgroup_v2" "secgroup_1" { 17 name = "my_secgroup" 18 description = "my security group" 19 rule { 20 from_port = 22 21 to_port = 22 22 ip_protocol = "tcp" 23 cidr = "0.0.0.0/0" 24 } 25 } 26 ``` 27 28 ## Argument Reference 29 30 The following arguments are supported: 31 32 * `region` - (Required) The region in which to obtain the V2 Compute client. 33 A Compute client is needed to create a security group. If omitted, the 34 `OS_REGION_NAME` environment variable is used. Changing this creates a new 35 security group. 36 37 * `name` - (Required) A unique name for the security group. Changing this 38 updates the `name` of an existing security group. 39 40 * `description` - (Required) A description for the security group. Changing this 41 updates the `description` of an existing security group. 42 43 * `rule` - (Optional) A rule describing how the security group operates. The 44 rule object structure is documented below. Changing this updates the 45 security group rules. 46 47 The `rule` block supports: 48 49 * `from_port` - (Required) An integer representing the lower bound of the port 50 range to open. Changing this creates a new security group rule. 51 52 * `to_port` - (Required) An integer representing the upper bound of the port 53 range to open. Changing this creates a new security group rule. 54 55 * `ip_protocol` - (Required) The protocol type that will be allowed. Changing 56 this creates a new security group rule. 57 58 * `cidr` - (Optional) Required if `from_group_id` is empty. The IP range that 59 will be the source of network traffic to the security group. Use 0.0.0.0./0 60 to allow all IP addresses. Changing this creates a new security group rule. 61 62 * `from_group_id` - (Optional) Required if `cidr` is empty. The ID of a group 63 from which to forward traffic to the parent group. Changing 64 this creates a new security group rule. 65 66 * `self` - (Optional) Required if `cidr` and `from_group_id` is empty. If true, 67 the security group itself will be added as a source to this ingress rule. 68 69 ## Attributes Reference 70 71 The following attributes are exported: 72 73 * `region` - See Argument Reference above. 74 * `name` - See Argument Reference above. 75 * `description` - See Argument Reference above. 76 * `rule` - See Argument Reference above.