Usage:
module "security_groups" {
source = "git::https://github.com/petercort/terraform-aws-security-group"
name = "Web-SG"
description = "Security group for web servers."
vpc_name = "my-workload-vpc"
ingress_rules = [
{
description = "Allow 443",
from_port = "443",
to_port = "443",
protocol = "TCP",
security_group_name = "igw-sg"
},
{
description = "Allow 8443",
from_port = "8443",
to_port = "8443",
protocol = "TCP",
security_group_name = "igw-sg"
}
]
egress_rules = [
{
description = "Allow App Traffic",
from_port = "8080",
to_port = "8080",
protocol = "TCP",
security_group_name = "app_sg"
}
]
}
This module is specifically designed to handle security group to security group based rules, where none of the security groups exist.
The module will deploy the security groups, and then deploy the rules and attach them to the security group.
No requirements.
Name | Version |
---|---|
aws | n/a |
No modules.
Name | Type |
---|---|
aws_security_group.create_security_groups | resource |
aws_security_group_rule.create_sg_egress_rules | resource |
aws_security_group_rule.create_sg_ingress_rules | resource |
aws_security_group.security_group | data source |
aws_vpcs.sg_vpc | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
description | n/a | string |
n/a | yes |
egress_rules | n/a | list(object({ |
[] |
no |
ingress_rules | n/a | list(object({ |
[] |
no |
name | n/a | string |
n/a | yes |
vpc_name | n/a | string |
n/a | yes |
Name | Description |
---|---|
security_group_id | n/a |