resource "aws_default_security_group" "DIGSYS-D3-DEFAULT-SG" {
  vpc_id = aws_vpc.DIGSYS-D3.id
  tags = merge(var.tags, {
    Name     = "DIGSYS-D3-DEFAULT-SG"
    CLOPS_FW = "NO"
  })
}

resource "aws_security_group" "DIGSYS-D3-GSIRT-SG" {
  name        = "DIGSYS-D3-GSIRT-SG"
  description = "DIGSYS-D3-GSIRT-SG"
  egress = [
    {
      cidr_blocks      = ["10.250.242.0/24", "10.250.6.0/24", "10.249.10.48/28", "10.11.188.0/25"]
      description      = "VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.250.6.0/24", "10.249.10.48/28", "10.11.188.0/25"]
      description      = "VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    }
  ]
  ingress = [
    {
      cidr_blocks      = ["10.250.242.0/24", "10.250.6.0/24", "10.249.10.48/28", "10.11.188.0/25"]
      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.242.0/24", "10.250.6.0/24", "10.249.10.48/28", "10.11.188.0/25"]
      description      = "GSIRT-TCP-9998"
      from_port        = 9998
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9998
    },
  ]
  tags = merge(var.tags, {
    Name     = "DIGSYS-D3-GSIRT-SG"
    CLOPS_FW = "NO"
  })
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-DRA2APP01-SG" {
  description = "DIGSYS-D3-DRA2APP01-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      = "DNS-TCP"
      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      = "DNS-UDP"
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks = [
        "172.34.25.224/27",
      ]
      description      = "CLOUDOPS-12453"
      from_port        = 1521
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1521
    },
    {
      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.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.249.10.48/28", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.249.10.48/28", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["0.0.0.0/0", ]
      description      = "SENDGRID.NET"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "192.168.248.0/21",
      ]
      description      = "Atlas Mongo DB"
      from_port        = 27015
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks = [
        "54.228.39.88/32",
        "108.128.229.184/32",
        "18.197.194.208/32",
        "52.57.139.126/32",
      ]
      description      = "smtp.sendgrid.net"
      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      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.250.1.0/27",
      ]
      description      = "SSH from digsysd-tools01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
        "162.49.0.0/16",
        "192.168.0.0/16",
      ]
      description      = "Sony-vpn"
      from_port        = 9990
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9990
    },
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-DRA2APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-DRA2APP01-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-RDS-SG" {
  description = "DIGSYS-D3-RDS-SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "Open for SEND-GRID"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
      ]
      description      = "SME-VPN"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "172.34.25.0/24",
      ]
      description      = "DIGSYS-P-RDS"
      from_port        = 1521
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1521
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.11.50.66/32",
      ]
      description      = "degtluv0308.server.arvato-systems.de"
      from_port        = 8080
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8080
    },
    {
      cidr_blocks = [
        "172.34.25.0/24",
      ]
      description      = "DIGSYS-FF-AUDIT"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "172.34.25.0/24",
      ]
      description      = "DIGSYS-FF-AUDIT"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.11.33.17/32",
      ]
      description      = "gras.service"
      from_port        = 8080
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8080
    },
    {
      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 = [
        "10.0.0.0/8"
      ]
      description      = "SME-VPN"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.11.104.128/25",
        "10.11.109.64/26",
        "10.250.6.0/24",
        "10.249.5.96/28"
      ]
      description      = ""
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.104.128/25",
      ]
      description      = "AOMA-Stage"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
      ]
      description      = "SME-VPN"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.104.128/25", "10.11.109.64/26", "10.250.6.0/24", "10.249.5.96/28"]
      description      = "AOMA-Stage for Postgres"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.11.176.219/32"]
      description      = "cloudopsff-bastion02"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks      = ["10.0.0.0/8"]
      description      = "VPN"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks      = ["10.11.114.0/24", "10.250.42.128/25", "10.250.16.208/28"]
      description      = "AOMA-D2 for Oracle"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["172.34.24.128/25"]
      description      = "MAX-FF-D-VPC"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 1521
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1521
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.250.6.0/24",
        "10.0.0.0/8",
      ]
      description      = "EKS-CIDR"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.113.128/26",
      ]
      description      = "GRPS-P2-APP-Subnets"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.114.0/25",
      ]
      description      = "AOMA-D2-IAPP-Subnets"
      from_port        = 1521
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1521
    },
    {
      cidr_blocks = [
        "10.11.114.0/25",
      ]
      description      = "AOMA-D2-IAPP-Subnets"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.176.192/26",
      ]
      description      = "From cloudopsff-dbmonitor01"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.176.192/26",
      ]
      description      = "cloudopsff-bastion02"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.12.213.0/26",
      ]
      description      = "DMS-IMAX-D"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.110.240/28"
      ]
      description      = "EOM-FF-S-APP-1B"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.11.110.240/28"
      ]
      description      = "EOM-FF-S-APP-1B"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks      = ["10.11.96.134/32", "10.11.96.133/32", "10.11.96.165/32", "10.11.96.166/32", "10.11.113.39/32"]
      description      = "arvato"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.250.70.192/26"]
      description      = "digsyss3-util01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.11.114.0/27", "10.11.114.32/27"]
      description      = "AOMA-D3 mi-load-comparison-test lambda"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      description      = "Allow DRA ECS tasks to connect to existing Oracle RDS"
      security_groups  = [data.aws_security_group.dra_dispatcher_security_group.id]
      from_port        = 1521
      to_port          = 1521
      protocol         = "tcp"
      cidr_blocks      = []
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      self             = false
    }
  ]
  name = "DIGSYS-D3-RDS-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-RDS-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-MSK-SG" {
  description = "DIGSYS-D3-MSK-SG"
  egress = [
    {
      cidr_blocks      = ["10.11.187.176/28", "10.11.189.0/25"]
      description      = "DIGSYS-P3"
      from_port        = 2181
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "DNS-TCP"
      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      = "DNS-UDP"
      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",
        "10.250.6.0/24",
        "10.11.188.0/25",
        "10.249.10.48/28",
        "10.250.242.0/24",
        "10.250.242.202/32",
      ]
      description      = "AWS 9210042821"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      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 = [
        "0.0.0.0/0",
      ]
      description      = "MongodB- Test Only"
      from_port        = 27017
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks = [
        "10.11.107.0/25",
        "10.0.0.0/8",
      ]
      description      = "CLOUDOPS-9149"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "172.34.20.32/27",
      ]
      description      = "EKS"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = true
      to_port          = 9098
    },
    {
      cidr_blocks = [
        "10.250.242.161/32",
      ]
      description      = "MSK"
      from_port        = 2181
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 2181
    },
    {
      cidr_blocks = [
        "10.250.92.175/32",
      ]
      description      = "EKS"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = true
      to_port          = 9094
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
        "10.11.188.0/25",
        "10.249.10.48/28",
        "10.250.242.0/24",
        "10.250.242.202/32",
      ]
      description      = "AWS 9210042821"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = true
      to_port          = 9098
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 2182
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 2182
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
        "162.49.0.0/16",
        "192.168.0.0/16",
        "172.34.31.0/25",
        "172.34.20.32/27",
        "10.250.92.175/32",
      ]
      description      = "VPC CIDR"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
        "172.34.20.32/27",
      ]
      description      = "EKS"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = true
      to_port          = 9098
    },
    {
      cidr_blocks = [
        "10.250.242.161/32",
      ]
      description      = "MSK"
      from_port        = 2181
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 2181
    },
    {
      description      = "Allow ECS tasks to connect to MSK"
      security_groups  = [data.aws_security_group.dra_dispatcher_security_group.id]
      from_port        = 9098
      to_port          = 9098
      protocol         = "tcp"
      cidr_blocks      = []
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      self             = false
    }
  ]
  name = "DIGSYS-D3-MSK-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-MSK-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id

}


data "aws_security_group" "dra_dispatcher_security_group" {
  name = "dev-dra-dispatcher-service-task-security-group"
}

resource "aws_security_group" "DIGSYS-D3-GITRUNWIN-SG" {
  description = "DIGSYS-D3-GITRUNWIN-SG"
  egress = [
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.219/32",
      ]
      description      = "cloudopsff-bastion02"
      from_port        = 3389
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 3389
    },
  ]
  name = "DIGSYS-D3-GITRUNWIN-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-GITRUNWIN-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id

}

resource "aws_security_group" "DIGSYS-D3-EOM2APP01-SG" {
  description = "DIGSYS-D3-EOM2APP01-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      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      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 7090
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 7090
    },
    {
      cidr_blocks = [
        "10.250.1.0/27",
      ]
      description      = "SSH from digsysd-tools01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DIGSYS-D3-EOM2APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-EOM2APP01-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-EAI2APP01-SG" {
  description = "DIGSYS-D3-EAI2APP01-SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      from_port        = 27017
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTP"
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks = [
        "10.11.108.12/32",
        "10.11.177.241/32",
        "10.11.177.207/32"
      ]
      description      = "HTTP"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      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.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "192.168.248.0/21",
      ]
      description      = "Atlas Mongo DB"
      from_port        = 27015
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.219/32",
        "10.12.246.75/32",
        "10.250.2.64/27",
        "10.250.242.161/32"
      ]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.250.1.0/27",
      ]
      description      = "SSH from digsysd-tools01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "172.34.20.44/32",
      ]
      description      = "maxohs-etlapp01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.12.246.0/25",
        "10.250.227.0/24"
      ]
      description      = "github-runner"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DIGSYS-D3-EAI2APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-EAI2APP01-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-LAMBDA-SG" {
  description = "DIGSYS-D3-LAMBDA-SG"
  egress = [
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "DNS-TCP"
      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      = "DNS-UDP"
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      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.33.17/32"]
      description      = "HTTPS"
      from_port        = 8080
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8080
    },
    {
      cidr_blocks = [
        "192.168.248.0/21",
      ]
      description      = "Atlas Mongo DB"
      from_port        = 27015
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks = [
        "192.168.248.0/21",
      ]
      description      = "MongoDB"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.11.110.240/28"
      ]
      description      = "EOM-FF-S-APP-1B"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.11.96.134/32", "10.11.96.133/32", "10.11.96.165/32", "10.11.96.166/32", "10.11.113.39/32"]
      description      = "arvato"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "192.168.248.0/21",
      ]
      description      = "Atlas Mongo DB"
      from_port        = 27015
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks = [
        "192.168.248.0/21",
      ]
      description      = "MongoDB"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-LAMBDA-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-LAMBDA-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-DSMSAPP01A-SG" {
  description = "DIGSYS-D3-DSMSAPP01A-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks      = ["172.34.25.0/24", ]
      description      = "DIGSYS-FF-AUDIT VPC"
      from_port        = 1024
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 10240
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "192.168.248.0/21",
      ]
      description      = "Atlas Mongo DB"
      from_port        = 27015
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks = [
        "10.11.187.0/26",
        "10.11.187.64/26"
      ]
      description      = "dbmistg"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.219/32",
        "10.12.246.75/32",
        "10.250.2.64/27",
        "10.250.242.161/32"
      ]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.176.219/32"]
      description      = "cloudopsff-bastion02"
      from_port        = 9090
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9090
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-DSMSAPP01A-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-DSMSAPP01A-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-INTERNAL-SG" {
  description = "DIGSYS-D3-INTERNAL-SG"
  egress = [
    {
      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        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.0.0.0/8", "162.49.0.0/16", "192.168.0.0/16", "172.34.20.0/25"]
      description      = "SME-Internal"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
  ]
  name = "DIGSYS-D3-INTERNAL-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-INTERNAL-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-EKS-Control-Plane-SG" {
  description = "DIGSYS-D3-EKS-Control-Plane-SG"
  egress = [
    {
      cidr_blocks      = ["10.12.210.0/26", "10.250.18.0/24"]
      description      = "PROMO-S2-VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.12.210.0/26", "10.250.18.0/24"]
      description      = "PROMO-S2-VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
        "172.34.16.224/27",
        "172.34.16.192/27",
      ]
      description      = "MSK"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      cidr_blocks = [
        "10.11.187.53/32"
      ]
      description      = "digsyss3-eai2app01"
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    }
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.113.240/28",
      ]
      description      = "MAX"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
      ]
      description      = "SME-VPN-1"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks = [
        "10.12.198.0/25",
        "10.250.37.0/26",
      ]
      description      = "Jenkins and ArgoCD"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "VPC-CIDRs"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.0/24",
        "10.250.2.0/24",
      ]
      description      = "From EKS-Mngr-Utils"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks = [
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
        "172.34.16.224/27",
        "172.34.16.192/27",
      ]
      description      = "MSK"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
  ]
  name = "DIGSYS-D3-EKS-Control-Plane-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-EKS-Control-Plane-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-CSA2APP01-SG" {
  description = "DIGSYS-D3-CSA2APP01-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      = "DNS-TCP"
      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      = "DNS-UDP"
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks = [
        "10.11.110.192/27",
        "10.11.187.64/26",
        "10.11.187.0/26",
      ]
      description      = "pg-tst.medigitalapps.com"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["172.34.25.0/24", ]
      description      = "AUDIT-VPC"
      from_port        = 1024
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 10240
    },
    {
      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.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "162.49.251.209/32",
      ]
      description      = "tsmegrps.arvato-systems.de"
      from_port        = 17800
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 17800
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 8080
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8080
    },
  ]
  name = "DIGSYS-D3-CSA2APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-CSA2APP01-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-EKS-Worker-Node-SG" {
  description = "DIGSYS-D3-EKS-Worker-Node-SG"
  egress = [
    {
      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      = "DNS-TCP"
      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      = "DNS-UDP"
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks = [
        "172.34.16.128/25",
        "10.0.0.0/8",
      ]
      description      = "Stage-Kafka"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "172.34.16.128/25",
        "10.0.0.0/8",
      ]
      description      = "Prod-RDS"
      from_port        = 1521
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1521
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
      ]
      description      = "RDS-Oracle"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
      ]
      description      = "RDS"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.250.70.0/24", "10.11.187.0/25"]
      description      = "DIGSYS-S3"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
        "172.34.16.192/27",
        "172.34.16.224/27",
      ]
      description      = "Kafka-Endpoints"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      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 = [
        "0.0.0.0/0",
      ]
      description      = "Datadog-logs"
      from_port        = 10514
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 10516
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      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          = 65535
    },
    {
      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          = 65535
    },
    {
      cidr_blocks = [
        "172.34.25.0/24",
      ]
      description      = "DIGSYS-FF-AUDIT VPC"
      from_port        = 1521
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1521
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks      = ["10.11.104.192/26"]
      description      = "AOMA-S1-VPC"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.0/24",
      ]
      description      = "INTERNAL ELB SG"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = []
      description      = "elbv2.k8s.aws/targetGroupBinding=shared"
      from_port        = 7090
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = ["sg-0c4765a1e7c03ec80"]
      self             = false
      to_port          = 7090
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
        "172.34.16.192/27",
        "172.34.16.224/27",
      ]
      description      = "Kafka-Endpoints"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      cidr_blocks = [
        "10.0.0.0/8",
      ]
      description      = "Kafka-Endpoints"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "10.11.176.0/24",
      ]
      description      = "INTERNAL ELB SG"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.198.0/25",
      ]
      description      = "STUDIOC-D VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.198.0/25",
      ]
      description      = "STUDIOC-D VPC-CIDR"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-EKS-Worker-Node-SG"

  tags = {
    "Business-Unit"                        = "SME Digital Systems"
    "Environment"                          = "Dev"
    "Owner"                                = "Steve Leeds"
    "Project-Code"                         = "SME - 2000-0590E"
    "Project-Name"                         = "Digital Systems"
    CLOPS_FW                               = "NO"
    Name                                   = "DIGSYS-D3-EKS-Worker-Node-SG"
    "kubernetes.io/cluster/eomffd-drd-eks" = "owned"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-DS2APP01-SG" {
  description = "DIGSYS-D3-DS2APP01-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["172.34.25.0/24"]
      description      = "DIGSYS-FF-AUDIT-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["172.34.25.0/24"]
      description      = "DIGSYS-FF-AUDIT-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      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      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-DS2APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-DS2APP01-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-SFTP-SG" {
  description = "DIGSYS-D3-SFTP-SG"
  egress = [
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "109.235.141.224/32",
      ]
      description      = "gtunxlvn04226 & gtunxlvp04228"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["162.49.194.10/32", "84.17.180.232/32"]
      description      = "sme-out-proxy.server.arvato-systems.de"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["18.158.55.7/32"]
      description      = "eomffs-util01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["18.185.32.107/32"]
      description      = "CARMA-D-NAT"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["18.195.171.103/32"]
      description      = "EOM-FF-S-NAT"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["52.57.156.171/32"]
      description      = "AOMA-D2"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DIGSYS-D3-SFTP-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-SFTP-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-EOM1APP01-SG" {
  description = "DIGSYS-D3-EOM1APP01-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      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      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-EOM1APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-EOM1APP01-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-INT-LB-SG" {
  description = "DIGSYS-D3-INT-LB-SG"
  egress = [
    {
      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        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.0.0.0/8", "162.49.0.0/16", "192.168.0.0/16"]
      description      = "VPN-CIDRs"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DIGSYS-D3-INT-LB-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-INT-LB-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-GITRUN01-SG" {
  description = "DIGSYS-D3-GITRUN01-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DIGSYS-D3-GITRUN01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-GITRUN01-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-TOOLS-SG" {
  description = "DIGSYS-D3-TOOLS-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.249.10.48/28"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.249.10.48/28"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.11.114.0/25",
      ]
      description      = "AOMA-D-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "192.30.252.0/22",
        "185.199.108.0/22",
        "140.82.112.0/20",
        "13.230.158.120/32",
        "18.179.245.253/32",
        "52.69.239.207/32",
        "13.209.163.61/32",
        "54.180.75.25/32",
        "13.233.76.15/32",
        "13.234.168.60/32",
        "13.250.168.23/32",
        "13.250.94.254/32",
        "54.169.195.247/32",
        "13.236.14.80/32",
        "13.238.54.232/32",
        "52.63.231.178/32",
        "18.229.199.252/32",
        "54.207.47.76/32",
      ]
      description      = "Github"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
      ]
      description      = "MSK"
      from_port        = 2181
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 2181
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
      ]
      description      = "MSK"
      from_port        = 2181
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 2181
    },
  ]
  name = "DIGSYS-D3-TOOLS-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-TOOLS-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "sg-069511a6fb348eecc" {
  description = "EKS created security group applied to ENI that is attached to EKS Control Plane master nodes, as well as any managed workloads."
  egress = [{
    cidr_blocks      = ["0.0.0.0/0"]
    description      = ""
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "-1"
    security_groups  = []
    self             = false
    to_port          = 0
  }]
  ingress = [{
    cidr_blocks      = []
    description      = ""
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = true
    to_port          = 65535
    }, {
    cidr_blocks      = []
    description      = ""
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = true
    to_port          = 65535
  }]
  name                   = "eks-cluster-sg-digsysd3-eks-2115999526"
  name_prefix            = null
  revoke_rules_on_delete = null
  tags = {
    Name                                 = "eks-cluster-sg-digsysd3-eks-2115999526"
    eiso-exception                       = "aws.08.30"
    "kubernetes.io/cluster/digsysd3-eks" = "owned"
    "Business-Unit"                      = "SME Digital Systems"
    "Environment"                        = "Dev"
    "Owner"                              = "Steve Leeds"
    "Project-Code"                       = "SME - 2000-0590E"
    "Project-Name"                       = "Digital Systems"
    CLOPS_FW                             = "NO"
  }
  tags_all = {
    Name                                 = "eks-cluster-sg-digsysd3-eks-2115999526"
    eiso-exception                       = "aws.08.30"
    "kubernetes.io/cluster/digsysd3-eks" = "owned"
    "Business-Unit"                      = "SME Digital Systems"
    "Environment"                        = "Dev"
    "Owner"                              = "Steve Leeds"
    "Project-Code"                       = "SME - 2000-0590E"
    "Project-Name"                       = "Digital Systems"
    CLOPS_FW                             = "NO"
  }
  vpc_id = "vpc-081a4216f852f621b"
}

# __generated__ by Terraform from "sg-08f4479951df944d0"
resource "aws_security_group" "sg-08f4479951df944d0" {
  description = "DIGSYS-D3-EKS-Worker-Node-SG"
  egress = [{
    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        = 80
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 80
    }, {
    cidr_blocks      = ["0.0.0.0/0"]
    description      = "Datadog-logs"
    from_port        = 10514
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 10516
    }, {
    cidr_blocks      = ["0.0.0.0/0"]
    description      = "NTP"
    from_port        = 123
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 123
    }, {
    cidr_blocks      = ["0.0.0.0/0"]
    description      = "NTP"
    from_port        = 123
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = false
    to_port          = 123
    }, {
    cidr_blocks      = ["10.0.0.0/8", "10.250.242.128/26", "10.250.242.96/27", "10.250.242.192/26", "172.34.16.224/27", "172.34.16.192/27"]
    description      = "Kafka-Endpoints"
    from_port        = 9098
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 9098
    }, {
    cidr_blocks      = ["10.0.0.0/8", "172.34.16.128/25"]
    description      = "Prod-RDS"
    from_port        = 1521
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 1521
    }, {
    cidr_blocks      = ["10.0.0.0/8"]
    description      = "RDS"
    from_port        = 5432
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 5432
    }, {
    cidr_blocks      = ["10.0.0.0/8"]
    description      = "RDS-Oracle"
    from_port        = 1480
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 1480
    }, {
    cidr_blocks      = ["10.11.104.192/26"]
    description      = "AOMA-S1-VPC"
    from_port        = 9098
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 9098
    }, {
    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          = 65535
    }, {
    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          = 65535
    }, {
    cidr_blocks      = ["10.12.246.64/26", "10.12.237.160/27"]
    description      = "CLOPS-SMTP-EP"
    from_port        = 587
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 587
    }, {
    cidr_blocks      = ["10.250.1.0/25", "10.250.35.160/28", "10.11.107.0/25", "10.250.203.64/26"]
    description      = "EOM-FF-D-VPC"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
    description      = "DIGSYS-D3-VPC"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
    description      = "DIGSYS-D3-VPC"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.250.35.160/28", "10.250.203.64/26", "10.250.1.0/25", "10.11.107.0/25"]
    description      = "EOM-FF-D-VPC"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.250.70.0/24", "10.11.187.0/25"]
    description      = "DIGSYS-S3"
    from_port        = 9094
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 9094
    }, {
    cidr_blocks      = ["172.34.16.128/25", "10.0.0.0/8"]
    description      = "Stage-Kafka"
    from_port        = 9094
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 9094
    }, {
    cidr_blocks      = ["172.34.25.0/24"]
    description      = "DIGSYS-FF-AUDIT VPC"
    from_port        = 1521
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 1521
    }, {
    cidr_blocks      = ["0.0.0.0/0"]
    description      = "DNS-TCP"
    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      = "DNS-UDP"
    from_port        = 53
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = false
    to_port          = 53
  }]
  ingress = [{
    cidr_blocks      = ["10.0.0.0/8", "10.250.242.128/26", "10.250.242.96/27", "10.250.242.192/26", "172.34.16.224/27", "172.34.16.192/27"]
    description      = "Kafka-Endpoints"
    from_port        = 9098
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 9098
    }, {
    cidr_blocks      = ["10.0.0.0/8"]
    description      = "Kafka-Endpoints"
    from_port        = 9094
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 9094
    }, {
    cidr_blocks      = ["10.11.176.0/24"]
    description      = "INTERNAL ELB SG"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.11.176.0/24"]
    description      = "INTERNAL ELB SG"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.12.198.0/25"]
    description      = "STUDIOC-D VPC-CIDR"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.12.198.0/25"]
    description      = "STUDIOC-D VPC-CIDR"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.250.2.64/27", "10.11.176.219/32", "10.12.246.75/32", "10.250.242.161/32"]
    description      = "CloudOPS Bastions"
    from_port        = 22
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 22
    }, {
    cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
    description      = "DIGSYS-D3-VPC"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
    description      = "DIGSYS-D3-VPC"
    from_port        = 0
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "udp"
    security_groups  = []
    self             = false
    to_port          = 65535
    }, {
    cidr_blocks      = []
    description      = "elbv2.k8s.aws/targetGroupBinding=shared"
    from_port        = 7090
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = ["sg-0c4765a1e7c03ec80"]
    self             = false
    to_port          = 7090
  }]
  name                   = "DIGSYS-D3-EKS-Worker-Node-SG"
  name_prefix            = null
  revoke_rules_on_delete = null
  tags = {
    Business-Unit                          = "SME Digital Systems"
    Environment                            = "Dev"
    Owner                                  = "Steve Leeds"
    Project-Code                           = "SME - 2000-0590E"
    Project-Name                           = "Digital Systems"
    Name                                   = "DIGSYS-D3-EKS-Worker-Node-SG"
    CLOPS_FW                               = "NO"
    "kubernetes.io/cluster/eomffd-drd-eks" = "owned"
  }
  tags_all = {
    Business-Unit                          = "SME Digital Systems"
    Environment                            = "Dev"
    Owner                                  = "Steve Leeds"
    Project-Code                           = "SME - 2000-0590E"
    Project-Name                           = "Digital Systems"
    Name                                   = "DIGSYS-D3-EKS-Worker-Node-SG"
    CLOPS_FW                               = "NO"
    "kubernetes.io/cluster/eomffd-drd-eks" = "owned"
  }
  vpc_id = "vpc-081a4216f852f621b"
}

resource "aws_security_group" "DIGSYS-D3-OCM-SG" {
  description = "DIGSYS-D3-OCM-SG"
  egress = [
    {
      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      = "DNS-TCP"
      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      = "DNS-UDP"
      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        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["0.0.0.0/0"]
      description      = "SMTP.SENDGRID.NET"
      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      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.11.176.219/32"]
      description      = "cloudopsff-bastion02"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.114.0/25",
      ]
      description      = "AOMA-D2"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.50.70/32",
      ]
      description      = "degtluv0312-TxMgr-D"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.50.71/32",
      ]
      description      = "degtluv0313-TxMgr-D"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.96.133/32",
      ]
      description      = "gtunxlvz06526.server.arvato-systems.de"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.96.134/32",
      ]
      description      = "gtunxlvs07013.server.arvato-systems.de"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.96.165/32",
      ]
      description      = "gtunxlvv07016.server.arvato-systems.de"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "10.11.96.166/32",
      ]
      description      = "gtunxlvw07017.server.arvato-systems.de"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "162.49.169.132/32",
      ]
      description      = "degtlun5843.server.arvato-systems.de"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks = [
        "162.49.169.228/32",
      ]
      description      = "degtlun5844.server.arvato-systems.de"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.12.214.128/25", "10.250.25.0/26", "10.249.3.32/28", "10.250.6.0/24"]
      description      = "GRPSNV-D3"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.11.113.0/26", "10.11.119.0/25", "10.11.177.64/26", "10.250.47.32/27", "10.249.4.192/28"]
      description      = "GRPS-D2"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.11.178.176/28", "10.11.178.160/28"]
      description      = "GRPS-P2"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.11.178.176/28", "10.11.178.160/28"]
      description      = "GRPS-P2"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks      = ["10.12.215.224/27"]
      description      = "GRPS-P1"
      from_port        = 1482
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1482
    },
    {
      cidr_blocks      = ["10.12.215.224/27"]
      description      = "GRPS-P1"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks = ["10.250.11.128/28",
        "10.11.176.0/24",
        "10.250.20.0/24",
        "10.11.179.192/26",
        "10.249.1.240/28",
      "10.11.108.96/28", ]
      description      = "Cloudopsff-bastion"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = ["10.250.11.128/28",
        "10.11.176.0/24",
        "10.250.20.0/24",
        "10.11.179.192/26",
        "10.249.1.240/28",
        "10.11.108.96/28",
      ]
      description      = "Cloudopsff-bastion"
      from_port        = 3306
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 3306
    },
  ]
  name = "DIGSYS-D3-OCM-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    CLOPS_FW        = "NO"
    Name            = "DIGSYS-D3-OCM-SG"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-DRD2APP01-SG" {
  description = "DIGSYS-D3-DRD2APP01-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 = [
        "0.0.0.0/0",
      ]
      description      = "DNS-TCP"
      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      = "DNS-UDP"
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S VPC"
      from_port        = 1480
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1480
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "172.34.25.240/28",
        "172.34.25.224/28"
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 1521
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 1521
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-DRD2APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-DRD2APP01-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-AKHQ01-SG" {
  description = "DIGSYS-D3-AKHQ01-SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = ""
      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      = "DNS-TCP"
      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      = "DNS-UDP"
      from_port        = 53
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 53
    },
    {
      cidr_blocks      = ["172.34.16.192/26"]
      description      = "DIGSYS-STAGE-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks      = ["10.0.0.0/8"]
      description      = "DIGSYS-STAGE-MSK"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      cidr_blocks      = ["10.11.107.192/26", "172.34.29.0/26", "10.250.19.128/28"]
      description      = "DIGSYS-PROD-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks      = ["10.250.53.128/25"]
      description      = "CARMA-T-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks      = ["10.11.179.0/26"]
      description      = "CARMA-U-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      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.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.11.107.128/25",
      ]
      description      = "Prod-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "10.250.53.128/25",
      ]
      description      = "CARMA-T-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "10.11.179.0/25",
      ]
      description      = "CARMA-U-MSK"
      from_port        = 9094
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "172.34.16.192/27",
        "172.34.16.224/27",
        "172.34.29.0/25",
      ]
      description      = "z-3.digsyss-dra-01.gum0p5.c4.kafka.eu-central-1.amazonaws.com"
      from_port        = 2181
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9094
    },
    {
      cidr_blocks = [
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
      ]
      description      = "MSK"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks      = ["10.251.11.0/24", "10.11.189.0/25", "10.249.6.208/28", "10.251.12.0/22", "10.11.187.176/28"]
      description      = "DIGSYS-P3 VPC-CIDR"
      from_port        = 2181
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 8080
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8080
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 8080
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 8080
    },
    {
      cidr_blocks = [
        "10.250.242.128/26",
        "10.250.242.96/27",
        "10.250.242.192/26",
      ]
      description      = "MSK"
      from_port        = 9098
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9098
    },
  ]
  name = "DIGSYS-D3-AKHQ01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-AKHQ01-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-O3APP01-SG" {
  description = "DIGSYS-D3-O3APP01-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.110.128/25", "172.34.16.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
    {
      cidr_blocks = [
        "162.49.192.141/32",
      ]
      description      = "gtlsmeads0101.me.sonymusic.com"
      from_port        = 636
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 636
    },
    {
      cidr_blocks = [
        "162.49.192.144/32",
      ]
      description      = "gtlsmeads0102.me.sonymusic.com"
      from_port        = 636
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 636
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  name = "DIGSYS-D3-O3APP01-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-O3APP01-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-GITRUN-SG" {
  description = "DIGSYS-D3-GITRUN-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      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      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.250.242.161/32",
      ]
      description      = "SSH from digsysd3-tools01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.11.176.219/32",
        "10.12.246.75/32",
        "10.250.2.64/27",
      ]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DIGSYS-D3-GITRUN-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-GITRUN-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-EXT-LB-SG" {
  description = "DIGSYS-D3-EXT-LB-SG"
  egress = [
    {
      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        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["202.32.161.130/32", "202.32.161.13/32"]
      description      = "SME-Japan"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
  ]
  name = "DIGSYS-D3-EXT-LB-SG"
  tags = {
    "Business-Unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-Code"  = "SME - 2000-0590E"
    "Project-Name"  = "Digital Systems"
    Name            = "DIGSYS-D3-EXT-LB-SG"
    CLOPS_FW        = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-MIDICT-SG" {
  description = "DIGSYS-D3-MIDICT-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      = "DNS-TCP"
      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      = "DNS-UDP"
      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      = "HTTPS"
      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      = "NTP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
      }, {
      cidr_blocks      = ["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.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24", "10.249.10.48/28"]
      description      = "DIGSYS-D3"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
      }, {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24", "10.249.10.48/28"]
      description      = "DIGSYS-D3"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
      }, {
      cidr_blocks      = ["10.250.70.0/24"]
      description      = "DIGSYS-S3"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
      }, {
      cidr_blocks      = ["10.250.70.0/24"]
      description      = "DIGSYS-S3"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
      }, {
      cidr_blocks      = ["172.34.16.128/25", "10.11.110.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
      }, {
      cidr_blocks      = ["172.34.16.128/25", "10.11.110.128/25", "10.250.19.192/26"]
      description      = "EOM-FF-S"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
      }, {
      cidr_blocks      = ["172.34.25.0/24"]
      description      = "DIGSYS-FF-AUDIT"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
      }, {
      cidr_blocks      = ["172.34.25.0/24"]
      description      = "DIGSYS-FF-AUDIT"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
  }]
  ingress = [{
    cidr_blocks      = ["10.11.176.219/32", "10.12.246.64/27", "10.250.2.64/27", "10.250.70.150/32"]
    description      = "CloudOPS Bastions"
    from_port        = 22
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 22
    }, {
    cidr_blocks      = ["10.11.188.0/25"]
    description      = "DIGSYS-D3 APP Subnets"
    from_port        = 8080
    ipv6_cidr_blocks = []
    prefix_list_ids  = []
    protocol         = "tcp"
    security_groups  = []
    self             = false
    to_port          = 8080
  }]
  name                   = "DIGSYS-D3-MIDICT-SG"
  name_prefix            = null
  revoke_rules_on_delete = null
  tags = {
    "Business-unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-code"  = "SME - 2000-0590E"
    "Project-name"  = "Digital Systems"
    Name            = "DIGSYS-D3-MIDICT-SG"
    CLOPS_FW        = "NO"
  }
  tags_all = {}
  vpc_id   = "vpc-081a4216f852f621b"
}

resource "aws_security_group" "DIGSYS-D3-OS-SG" {
  description = "DIGSYS-D3-OS-SG"
  egress = [
    {
      cidr_blocks      = ["10.0.0.0/8", "162.49.0.0/16", "192.168.0.0/16"]
      description      = "VPN CIDRS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.0.0.0/8", "162.49.0.0/16", "192.168.0.0/16"]
      description      = "VPN CIDRS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
  ]
  name = "DIGSYS-D3-OS-SG"
  tags = {
    "Business-unit" = "SME Digital Systems"
    "Environment"   = "Dev"
    "Owner"         = "Steve Leeds"
    "Project-code"  = "SME-2000-0590E"
    "Project-name"  = "Digital Systems"
    "Name"          = "DIGSYS-D3-OS-SG"
    "CLOPS_FW"      = "NO"

  }
  tags_all = {}
  vpc_id   = "vpc-081a4216f852f621b"
}

resource "aws_security_group" "DIGSYS-D3-PGBOUNCER-SG" {
  description = "DIGSYS-D3-PGBOUNCER-SG"
  egress = [
    {
      cidr_blocks      = ["10.12.246.64/26", "10.12.237.160/27"]
      description      = "For clops-smtp-ep.smecloudops.com"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.0.0.0/8"]
      description      = "HTTP"
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.250.6.0/24", "10.249.10.48/28", "10.11.188.0/25"]
      description      = "VPC CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.250.6.0/24", "10.249.10.48/28", "10.11.188.0/25"]
      description      = "VPC CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["0.0.0.0/0"]
      description      = "NTP-TCP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
    {
      cidr_blocks      = ["0.0.0.0/0"]
      description      = "NTP-UDP"
      from_port        = 123
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 123
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.64/27", "10.250.2.64/27"]
      description      = "CloudOPS Bastions"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.189.94/32", "10.251.11.235/32"]
      description      = "digsysp3 util01 & tools01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = ["10.11.107.204/32", "10.250.70.180/32"]
      description      = "digsysp-util01 & digsyss3-lti01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.250.6.0/24", "10.249.10.48/28", "10.11.188.0/25"]
      description      = "DIGSYS-D3-VPC-CIDR"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.11.176.192/27", ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.11.119.22/32"]
      description      = "grpsd2-utilities03"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.11.119.96/27", "10.11.119.64/27"]
      description      = "sme-label-copy-schedule-dev-euc1-cluster-01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = ["10.12.214.192/27", "10.12.214.224/27"]
      description      = "sme-label-copy-schedule-dev-use1-cluster-01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
  ]
  name = "DIGSYS-D3-PGBOUNCER-SG"
  tags = {
    Name             = "DIGSYS-D3-PGBOUNCER-SG"
    "Business-Unit"  = "SME-DIGTAL-SYSTEMS",
    "Project-Code"   = "SME-2000-0512C"
    "Project-Name"   = "DIGITAL-SYSTEMS"
    "Environment"    = "Prod",
    "CLOPS_APPROVED" = "YES",
    "OWNER"          = "steve.leeds@sonymusic.com",
    "Terraform"      = "True",
    CLOPS_FW         = "NO"
  }
  vpc_id = aws_vpc.DIGSYS-D3.id
}

resource "aws_security_group" "DIGSYS-D3-DSMS-SCIM-SG" {
  name        = "DIGSYS-D3-DSMS-SCIM-SG"
  description = "DIGSYS-D3-DSMS-SCIM-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8103
    to_port         = 8103
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8103"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-ADMIN-SG" {
  name        = "DIGSYS-D3-DSMS-ADMIN-SG"
  description = "DIGSYS-D3-DSMS-ADMIN-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 9090
    to_port         = 9090
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 9090"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-AUTH-SG" {
  name        = "DIGSYS-D3-DSMS-AUTH-SG"
  description = "DIGSYS-D3-DSMS-AUTH-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 9100
    to_port         = 9100
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 9100"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-RS-CLEARANCES-SG" {
  name        = "DIGSYS-D3-DSMS-RS-CLEARANCES-SG"
  description = "DIGSYS-D3-DSMS-RS-CLEARANCES-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress = [
    {
      cidr_blocks      = ["192.168.248.0/21"]
      description      = "MongoDB"
      from_port        = 27017
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks      = []
      description      = "Allow DSMS App and Internal LB to communicate on port 8102"
      from_port        = 8102
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id]
      self             = false
      to_port          = 8102
    }
  ]

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-MONITOR-SG" {
  name        = "DIGSYS-D3-DSMS-MONITOR-SG"
  description = "DIGSYS-D3-DSMS-MONITOR-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress = [
    {
      cidr_blocks      = ["192.168.248.0/21"]
      description      = "MongoDB"
      from_port        = 27017
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 27017
    },
    {
      cidr_blocks      = []
      description      = "Allow DSMS App and Internal LB to communicate on port 8015"
      from_port        = 8015
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id]
      self             = false
      to_port          = 8015
    }
  ]

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-NOTES-SG" {
  name        = "DIGSYS-D3-DSMS-NOTES-SG"
  description = "DIGSYS-D3-DSMS-NOTES-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8750
    to_port         = 8750
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8750"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-MI-SG" {
  name        = "DIGSYS-D3-DSMS-MI-SG"
  description = "DIGSYS-D3-DSMS-MI-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8550
    to_port         = 8550
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id, aws_security_group.DIGSYS-D3-DSMS-CONTRACTS-SG.id, aws_security_group.DIGSYS-D3-DSMS-RS-CLEARANCES-SG.id, aws_security_group.DIGSYS-D3-DSMS-NOTES-SG.id, aws_security_group.DIGSYS-D3-DSMS-CLEARANCES-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8550"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-CLEARANCES-SG" {
  name        = "DIGSYS-D3-DSMS-CLEARANCES-SG"
  description = "DIGSYS-D3-DSMS-CLEARANCES-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8100
    to_port         = 8100
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8100"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-CONTRACTS-SG" {
  name        = "DIGSYS-D3-DSMS-CONTRACTS-SG"
  description = "DIGSYS-D3-DSMS-CONTRACTS-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8000
    to_port         = 8000
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8000"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-USER-SG" {
  name        = "DIGSYS-D3-DSMS-USER-SG"
  description = "DIGSYS-D3-DSMS-USER-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8104
    to_port         = 8104
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id, aws_security_group.DIGSYS-D3-DSMS-GATEWAY-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8104"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-GATEWAY-SG" {
  name        = "DIGSYS-D3-DSMS-GATEWAY-SG"
  description = "DIGSYS-D3-DSMS-GATEWAY-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8762
    to_port         = 8762
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8762"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-D3-DSMS-EUREKA-SG" {
  name        = "DIGSYS-D3-DSMS-EUREKA-SG"
  description = "DIGSYS-D3-DSMS-EUREKA-SG"
  vpc_id      = aws_vpc.DIGSYS-D3.id

  ingress {
    from_port       = 8761
    to_port         = 8761
    protocol        = "tcp"
    security_groups = [aws_security_group.DIGSYS-D3-DSMSAPP01A-SG.id, aws_security_group.DIGSYS-D3-INT-LB-SG.id, aws_security_group.DIGSYS-D3-DSMS-ADMIN-SG.id]
    description     = "Allow DSMS App and Internal LB to communicate on port 8761"
  }

  egress {
    from_port   = 0
    to_port     = 65535
    protocol    = "tcp"
    cidr_blocks = ["0.0.0.0/0"]
  }
}

resource "aws_security_group" "DIGSYS-UAT-EXT-LB-SG" {
  description = "DIGSYS-UAT-EXT-LB-SG"
  egress = [
    {
      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        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.11.107.0/25", "10.250.1.0/25", "10.250.35.160/28", "10.250.203.64/26"]
      description      = "EOM-FF-D-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks      = ["10.250.242.0/24", "10.11.188.0/25", "10.250.6.0/24"]
      description      = "DIGSYS-D3-VPC"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65535
    },
    {
      cidr_blocks = [
        "10.12.246.64/26",
        "10.12.237.160/27",
      ]
      description      = "CLOPS-SMTP-EP"
      from_port        = 587
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 587
    },
  ]
  ingress = [
    {
      cidr_blocks      = ["10.0.0.0/8", "162.49.0.0/16", "192.168.0.0/16"]
      description      = "VPN-CIDRs"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks      = ["10.11.176.219/32", "10.12.246.75/32", "10.250.2.64/27", "10.250.242.161/32"]
      description      = "CloudOPS Bastions"
      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      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
  ]
  name = "DIGSYS-UAT-EXT-LB-SG"
  tags = merge(var.tags, {
    Name     = "DIGSYS-UAT-EXT-LB-SG"
    CLOPS_FW = "NO"
  })
  vpc_id = aws_vpc.DIGSYS-D3.id
}
