Skip to content

This module creates mutual AWS security group rules where matching ingress and egress to allow traffic between two security groups. This makes it easier to create security network configuration in your AWS environments.

License

Notifications You must be signed in to change notification settings

skwashd/terraform-aws-mutual-security-groups

Repository files navigation

Terraform Mutual Security Groups Rules Module

This module creates mutual AWS security group rules where matching ingress and egress to allow traffic between two security groups. This makes it easier to create security network configuration in your AWS environments.


Requirements

Name Version
terraform >= 1.0.0
aws >= 3.67.0

Providers

Name Version
aws >= 3.67.0

Inputs

Name Description Type Default Required
rules Rules for which traffic is permitted between two security groups
list(object({
source_sg_id = string
target_sg_id = string
destination_port = string
description = string
to_port = optional(string)
protocol = optional(string)
}))
n/a yes

Outputs

Name Description
egress_rules The List of the Security Group Egress Rules IDs
ingress_rules The List of the Security Group Ingress Rules IDs

Modules

No modules.

Resources

Name Type
aws_security_group_rule.egress resource
aws_security_group_rule.ingress resource

Samples

 rules= [
     {
         source_sg_id = "sg-903004f8"
         target_sg_id = "sg-33bb22aa"
         destination_port = "443"
         protocol = "udp" # Optional, defaults to tcp
         description = "Allow QUIC/HTTP3 from NLB" # optional, but recommended
     },
     {
         source_sg_id = "sg-1a2b3c4d"
         target_sg_id = "sg-33bb22aa"
         destination_port = "8080"
         to_port   = "8088" # Optional, only required for port ranges. Specifies the upper end of the range.
     }
 ]

About

This module creates mutual AWS security group rules where matching ingress and egress to allow traffic between two security groups. This makes it easier to create security network configuration in your AWS environments.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages