github.com/ezbercih/terraform@v0.1.1-0.20140729011846-3c33865e0839/website/source/docs/providers/aws/r/security_group.html.markdown (about) 1 --- 2 layout: "aws" 3 page_title: "AWS: aws_security_group" 4 sidebar_current: "docs-aws-resource-security-group" 5 --- 6 7 # aws\_security\_group 8 9 Provides an security group resource. 10 11 ## Example Usage 12 13 ``` 14 resource "aws_security_group" "allow_all" { 15 name = "allow_all" 16 ingress { 17 from_port = 0 18 to_port = 65535 19 protocol = "tcp" 20 cidr_blocks = ["0.0.0.0/0"] 21 } 22 } 23 ``` 24 25 ## Argument Reference 26 27 The following arguments are supported: 28 29 * `name` - (Required) The name of the security group 30 * `ingress` - (Required) Can be specified multiple times for each 31 ingress rule. Each ingress block supports fields documented below. 32 * `description` - (Optional) The security group description. 33 * `vpc_id` - (Optional) The VPC ID. 34 * `owner_id` - (Optional) The AWS Owner ID. 35 36 The `ingress` block supports: 37 38 * `cidr_blocks` - (Optional) List of CIDR blocks. Cannot be used with `security_groups`. 39 * `from_port` - (Required) The start port. 40 * `protocol` - (Required) The protocol. 41 * `security_groups` - (Optional) List of security group IDs. Cannot be used with `cidr_blocks`. 42 * `to_port` - (Required) The end range port. 43 44 ## Attributes Reference 45 46 The following attributes are exported: 47 48 * `id` - The ID of the security group 49 * `vpc_id` - The VPC ID. 50 * `owner_id` - The owner ID. 51 * `name` - The name of the security group 52 * `description` - The description of the security group 53 * `ingress` - The ingress rules. See above for more. 54