egress_rules

Type list(object({ from_port = number to_port = number protocol = string cidr_blocks = optional(list(string), []) description = optional(string, "") }))
Default [ { from_port = 0 to_port = 0 protocol = "-1" cidr_blocks = ["0.0.0.0/0"]

List of egress rules

Egress Rule Structure

egress_rules = [
  {
    from_port   = 0
    to_port     = 0
    protocol    = "-1"
    cidr_blocks = ["0.0.0.0/0"]
  }
]

Best Practices

  • Default allows all outbound traffic
  • Restrict for compliance requirements
  • Consider VPC endpoints for AWS services

Full Module Example

module "security_group" {
  source  = "registry.patterneddesigns.ca/patterneddesigns/security-group/aws"
  version = "0.1.0"

  # egress_rules
  egress_rules = "..."

  # Other required inputs
  name = "..."
  vpc_id = "..."
}