1.4 KiB
1.4 KiB
layout | page_title | sidebar_current |
---|---|---|
aws | AWS: aws_security_group | docs-aws-resource-security-group |
aws_security_group
Provides an security group resource.
Example Usage
resource "aws_security_group" "allow_all" {
name = "allow_all"
ingress {
from_port = 0
to_port = 65535
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
}
}
Argument Reference
The following arguments are supported:
name
- (Required) The name of the security groupingress
- (Required) Can be specified multiple times for each ingress rule. Each ingress block supports fields documented below.description
- (Optional) The security group description.vpc_id
- (Optional) The VPC ID.owner_id
- (Optional) The AWS Owner ID.
The ingress
block supports:
cidr_blocks
- (Optional) List of CIDR blocks. Cannot be used withsecurity_groups
.from_port
- (Required) The start port.protocol
- (Required) The protocol.security_groups
- (Optional) List of security group IDs. Cannot be used withcidr_blocks
.to_port
- (Required) The end range port.
Attributes Reference
The following attributes are exported:
id
- The ID of the security groupvpc_id
- The VPC ID.owner_id
- The owner ID.name
- The name of the security groupdescription
- The description of the security groupingress
- The ingress rules. See above for more.