# resource "aws_security_group" "web_elb_security_group" {
#   name        = "${var.client_name}_elb_web_public_security_group"
#   description = "Allowing Web Traffic"
#   vpc_id      = aws_vpc.vpc.id

# ingress {
#     from_port   = 80
#     to_port     = 80
#     protocol    = "tcp"
#     cidr_blocks = ["0.0.0.0/0"]
#     description = "Allowing All Traffic Outbound"
#   }

#   ingress {
#     from_port   = 443
#     to_port     = 443
#     protocol    = "tcp"
#     cidr_blocks = ["0.0.0.0/0"]
#     description = "Allowing All Traffic Outbound"
#   }

#   egress {
#     from_port   = 0
#     to_port     = 0
#     protocol    = -1
#     cidr_blocks = ["0.0.0.0/0"]
#     description = "Allowing All Traffic Outbound"
#   }

#   tags = {
#     Name = "${var.client_name}_elb_web_public_security_group"
#   }
# }

# resource "aws_security_group" "web_security_group" {
#   name        = "${var.client_name}_web_private_security_group"
#   description = "Allowing Web Traffic"
#   vpc_id      = aws_vpc.vpc.id

#   ingress {
#     from_port       = 80
#     to_port         = 80
#     protocol        = "tcp"
#     security_groups = ["${aws_security_group.web_elb_security_group.id}"]
#     description     = "Allowing All Traffic Outbound"
#   }

#   ingress {
#     from_port       = 443
#     to_port         = 443
#     protocol        = "tcp"
#     security_groups = ["${aws_security_group.web_elb_security_group.id}"]
#     description     = "Allowing All Traffic Outbound"
#   }

#   egress {
#     from_port   = 0
#     to_port     = 0
#     protocol    = -1
#     cidr_blocks = ["0.0.0.0/0"]
#     description = "Allowing All Traffic Outbound"
#   }

#   tags = {
#     Name = "${var.client_name}_web_private_security_group"
#   }
# }

resource "aws_security_group" "db_security_group" {
  name        = "${var.client_name}_db_private_security_group"
  description = "Allowing db access"
  vpc_id      = aws_vpc.vpc.id

  # ingress {
  #   from_port       = 3306
  #   to_port         = 3306
  #   protocol        = "tcp"
  #   security_groups = ["${aws_security_group.web_security_group.id}"]
  #   description     = "Allowing All Traffic Outbound"
  # }

  egress {
    from_port   = 0
    to_port     = 0
    protocol    = -1
    cidr_blocks = ["0.0.0.0/0"]
    description = "Allowing All Traffic Outbound"
  }

  tags = {
    Name = "${var.client_name}_db_private_security_group"
  }
}
