resource "aws_security_group" "sg-02e4e50fae9a3ced3" {
  description = "MCON-S2-WIP-SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "10.12.246.0/24",
      ]
      description      = "Whitelisting Bastion IP range"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "To CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "To CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.177.0/24",
        "10.11.108.0/24",
        "10.11.180.0/24"
      ]
      description      = "batch to reach msk"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.177.0/24",
        "10.11.108.0/24",
        "10.11.180.0/24"
      ]
      description      = "batch to reach msk"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.182.128/25",
      ]
      description      = "QMS"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.182.128/25",
      ]
      description      = "QMS"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "To CLSHRD-P CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "To CLSHRD-P CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.0/24",
      ]
      description      = "To CLSHRD-P CIDR-2"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.0/24",
      ]
      description      = "To CLSHRD-P CIDR-2"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "172.29.7.0/24",
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "172.29.7.0/24",
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.106.20/32",
      ]
      description      = "dels2-bastion01"
      from_port        = 3389
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 3389
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "BASTION"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "BASTION"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "AnsibleTower"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "AnsibleTower"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
  ]
  name = "MCON-S2-WIP-SG"
  tags = {
    "Environment"  = "Stage",
    "Name"         = "MCON-S2-WIP-SG",
    "CLOPS_FW"     = "NO",
    "Owner"        = "Mandar Padsalgikar",
    "Project-Code" = "SME-2000-0306C",
    "Project-Name" = "MCON"
  }
  vpc_id = "vpc-0318d4f6303f76d2a"
}

resource "aws_security_group" "sg-0173c097cc9f21cff" {
  description = "MCDEL-S2-GSIRT-SG"
  egress = [
    {
      cidr_blocks = [
        "10.250.67.0/24",
        "10.249.9.0/28",
        "10.11.104.32/27",
      ]
      description      = "GSIRT TCP-8089"
      from_port        = 8089
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8089
    },
    {
      cidr_blocks = [
        "10.250.67.0/24",
        "10.249.9.0/28",
        "10.11.104.32/27",
      ]
      description      = "GSIRT TCP-9998"
      from_port        = 9998
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9998
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.250.67.0/24",
        "10.249.9.0/28",
        "10.11.104.32/27",
      ]
      description      = "GSIRT TCP-8089"
      from_port        = 8089
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8089
    },
    {
      cidr_blocks = [
        "10.250.67.0/24",
        "10.249.9.0/28",
        "10.11.104.32/27",
      ]
      description      = "GSIRT TCP-9998"
      from_port        = 9998
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9998
    },
  ]
  name = "MCDEL-S2-GSIRT-SG"
  tags = {
    "Business-Unit" = "Media Conversion",
    "Environment"   = "Stage",
    "Name"          = "MCDEL-S2-GSIRT-SG",
    "CLOPS_FW"      = "NO",
    "Owner"         = "Sang Han",
    "Project-Code"  = "SME-2000-0306C",
    "Project-Name"  = "MCON-DEL"
  }
  vpc_id = "vpc-0318d4f6303f76d2a"
}

resource "aws_security_group" "sg-003175f06c71997a2" {
  description = "default VPC security group"
  egress      = []
  ingress     = []
  name        = "default"
  tags = {
    "Environment"  = "Stage",
    "Name"         = "default",
    "CLOPS_FW"     = "NO",
    "Owner"        = "Mandar Padsalgikar",
    "Project-Code" = "SME-2000-0306C",
    "Project-Name" = "MCON"
  }
  vpc_id = "vpc-0318d4f6303f76d2a"
}


resource "aws_security_group" "MCON-UAT2-BATCH-WIP-SG" {
  description = "MCON-UAT2-BATCH-WIP-SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "10.11.177.0/24",
        "10.11.108.0/24",
        "10.11.180.0/24"
      ]
      description      = "batch to reach msk"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.177.0/24",
        "10.11.108.0/24",
        "10.11.180.0/24"
      ]
      description      = "batch to reach msk"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/24",
      ]
      description      = "Whitelisting Bastion IP range"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "To CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "To CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.182.128/25",
      ]
      description      = "QMS"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.182.128/25",
      ]
      description      = "QMS"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "To CLSHRD-P CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "To CLSHRD-P CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.0/24",
      ]
      description      = "To CLSHRD-P CIDR-2"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.0/24",
      ]
      description      = "To CLSHRD-P CIDR-2"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "172.29.7.0/24",
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "172.29.7.0/24",
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.228.0/22",
        "10.250.232.0/21",
      ]
      description      = "Connection to Logstash FileShare"
      from_port        = 139
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 445
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.106.20/32",
      ]
      description      = "dels2-bastion01"
      from_port        = 3389
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 3389
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "BASTION"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
      ]
      description      = "BASTION"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "AnsibleTower"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "AnsibleTower"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
  ]
  name = "MCON-UAT2-BATCH-WIP-SG"
  tags = {
    "Environment"  = "Stage",
    "Name"         = "MCON-UAT2-BATCH-WIP-SG",
    "CLOPS_FW"     = "NO",
    "Owner"        = "Mandar Padsalgikar",
    "Project-Code" = "SME-2000-0306C",
    "Project-Name" = "MCON"
  }
  vpc_id = "vpc-0318d4f6303f76d2a"
}

#resource "aws_security_group" "MC-UAT-SG-RDS-01" {
#  description = "MC-UAT-SG-RDS-01"
#  egress = [
#    {
#      cidr_blocks = [
#        "0.0.0.0/0",
#      ]
#      description      = ""
#      from_port        = 123
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 123
#    },
#    {
#      cidr_blocks = [
#        "0.0.0.0/0",
#      ]
#      description      = ""
#      from_port        = 443
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 443
#    },
#    {
#      cidr_blocks = [
#        "0.0.0.0/0",
#      ]
#      description      = ""
#      from_port        = 53
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 53
#    },
#    {
#      cidr_blocks = [
#        "0.0.0.0/0",
#      ]
#      description      = ""
#      from_port        = 53
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 53
#    },
#    {
#      cidr_blocks = [
#        "0.0.0.0/0",
#      ]
#      description      = ""
#      from_port        = 587
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 587
#    },
#    {
#      cidr_blocks = [
#        "0.0.0.0/0",
#      ]
#      description      = ""
#      from_port        = 80
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 80
#    },
#    {
#      cidr_blocks = [
#        "10.11.176.192/27",
#      ]
#      description      = "To CCSHARE-FF-APP-1A"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.11.176.192/27",
#      ]
#      description      = "To CCSHARE-FF-APP-1A"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.11.176.192/27",
#      ]
#      description      = "To CCSHARE-FF-APP-1A"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.11.176.192/27",
#      ]
#      description      = "To CCSHARE-FF-APP-1A"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.12.246.0/25",
#      ]
#      description      = "To CLSHRD-P CIDR-1"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.12.246.0/25",
#      ]
#      description      = "To CLSHRD-P CIDR-1"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.250.2.0/24",
#      ]
#      description      = "To CLSHRD-P CIDR-2"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.250.2.0/24",
#      ]
#      description      = "To CLSHRD-P CIDR-2"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "172.29.7.0/24",
#      ]
#      description      = ""
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "172.29.7.0/24",
#      ]
#      description      = ""
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#  ]
#  ingress = [
#    {
#      cidr_blocks = [
#        "10.11.106.20/32",
#      ]
#      description      = "dels2-bastion01"
#      from_port        = 5444
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 5444
#    },
#    {
#      cidr_blocks = [
#        "10.11.176.192/27",
#      ]
#      description      = "From CCSHARE-FF-APP-1A"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.11.176.192/27",
#      ]
#      description      = "From CCSHARE-FF-APP-1A"
#      from_port        = 0
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "udp"
#      security_groups  = []
#      self             = false
#      to_port          = 65534
#    },
#    {
#      cidr_blocks = [
#        "10.11.176.200/32",
#      ]
#      description      = "From cloudopsff-dbmonitor01"
#      from_port        = 5444
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 5444
#    },
#    {
#      cidr_blocks = [
#        "10.12.246.64/27",
#      ]
#      description      = "SSH from clshrd-bastion01"
#      from_port        = 5444
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 5444
#    },
#    {
#      cidr_blocks = [
#        "10.250.2.64/27",
#      ]
#      description      = "SSH from clshrd-tower01"
#      from_port        = 5444
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 5444
#    },
#    {
#      cidr_blocks = [
#        "10.250.230.0/23",
#      ]
#      description      = "VPC CIDR"
#      from_port        = 5444
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups = [
#        "sg-c9d336a1",
#        "sg-fad33692",
#      ]
#      self    = false
#      to_port = 5444
#    },
#    {
#      cidr_blocks = [
#        "10.250.228.0/23",
#      ]
#      description      = "VPC CIDR"
#      from_port        = 5444
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 5444
#    },
#    {
#      cidr_blocks = [
#        "192.168.0.0/16",
#      ]
#      description      = "EKSCTL-VPC"
#      from_port        = 5444
#      ipv6_cidr_blocks = []
#      prefix_list_ids  = []
#      protocol         = "tcp"
#      security_groups  = []
#      self             = false
#      to_port          = 5444
#    },
#  ]
#  name = "MC-UAT-SG-RDS-01"
#  tags = {
#    "Business-unit" = "Media Conversion"
#    "Environment"   = "STAGE2"
#    "Owner"         = "Sang Han"
#    "Project-code"  = "MCON"
#    "Project-name"  = "MCON-DEL"
#  }
#  tags_all = {
#    "Business-unit" = "Media Conversion"
#    "Environment"   = "STAGE2"
#    "Owner"         = "Sang Han"
#    "Project-code"  = "MCON"
#    "Project-name"  = "MCON-DEL"
#  }
#  vpc_id = "vpc-0318d4f6303f76d2a"
#}#

resource "aws_security_group" "MCDEL-S2-LOGSTASH-SG" {
  description = "MCDEL-S2-LOGSTASH-SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "HTTP"
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.104.32/27", "10.250.67.0/24", "10.249.9.0/28", "10.250.228.0/22", "10.250.232.0/21"]
      description      = "MCDEL-S2-VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks      = ["10.11.104.32/27", "10.250.67.0/24", "10.249.9.0/28", "10.250.228.0/22", "10.250.232.0/21"]
      description      = "MCDEL-S2-VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "SMTPS"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.219/32",
      ]
      description      = "cloudopsff-bastion02"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.12.246.75/32",
      ]
      description      = "clshrd-bastion01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "Ansible_Tower"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.104.32/27", "10.250.67.0/24", "10.249.9.0/28", "10.250.228.0/22", "10.250.232.0/21"]
      description      = "MCDEL-S2-VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks      = ["10.11.104.32/27", "10.250.67.0/24", "10.249.9.0/28", "10.250.228.0/22", "10.250.232.0/21"]
      description      = "MCDEL-S2-VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    }
  ]
  name = "MCDEL-S2-LOGSTASH-SG"
  tags = merge(var.ec2_tags, {
    "Environment"  = "Stage",
    "Name"         = "MCDEL-S2-LOGSTASH-SG",
    "CLOPS_FW"     = "NO",
    "Owner"        = "Mandar Padsalgikar",
    "Project-Code" = "SME-2000-0306C",
    "Project-Name" = "MCON"
    }
  )
  vpc_id = aws_vpc.vpc-0318d4f6303f76d2a.id
}

resource "aws_security_group" "MCDEL-S2-PGBOUNCER-SG" {
  description = "Media Conversion STAGE2 PGBOUNCER SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "HTTP"
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.12.246.64/26", "10.12.237.160/27"]
      description      = "SMTPS"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks      = ["10.11.104.32/27", "10.250.67.0/24", "10.250.228.0/22", "10.250.232.0/21"]
      description      = "VPC-CIDRs"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks      = ["10.11.104.32/27", "10.250.67.0/24", "10.250.228.0/22", "10.250.232.0/21"]
      description      = "VPC-CIDRs"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks      = ["172.29.7.0/26"]
      description      = "MCON-S-VPC-CIDR"
      from_port        = 5444
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5444
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.200/32",
      ]
      description      = "cloudopsff-dbmonitor01"
      from_port        = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 6432
    },
    {
      cidr_blocks = [
        "10.11.182.128/25",
      ]
      description      = "VPC CIDR"
      from_port        = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 6432
    },
    {
      cidr_blocks = [
        "10.12.246.75/32",
      ]
      description      = "Bastion"
      from_port        = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 6432
    },
    {
      cidr_blocks = [
        "10.11.176.201/32",
      ]
      description      = "cloudopsff-dbutils02"
      from_port        = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 6432
    },
    {
      cidr_blocks = [
        "10.11.176.219/32",
      ]
      description      = "cloudopsff-bastion02"
      from_port        = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 6432
    },
    {
      cidr_blocks = [
        "10.12.246.75/32",
        "10.250.2.64/27",
        "10.11.176.219/32",
      ]
      description      = "Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.104.32/27", "10.250.67.0/24", "10.250.228.0/22", "10.250.232.0/21"]
      description      = "MCON-S VPC"
      from_port        = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 6432
    },
  ]
  name = "MCDEL-S2-PGBOUNCER-SG"
  tags = {
    "Business-Unit"  = "AOMA-Conversion",
    "Patch Group"    = "General",
    "CLOPS_APPROVED" = "YES",
    "ME_JOINED"      = "YES",
    "SERVER_TYPE"    = "EC2",
    "OS"             = "AL2",
    "Environment"    = "Stage",
    "Name"           = "MCDEL-S2-PGBOUNCER-SG",
    "CLOPS_FW"       = "NO",
    "Owner"          = "Mandar Padsalgikar",
    "Project-Code"   = "SME-2000-0306C",
    "Project-Name"   = "MCON"
  }
  vpc_id = "vpc-0318d4f6303f76d2a"
}
