#
# Anthony Vitale June 13, 2025 Altered Security Group DX3-D1-RDS-GL-S-SG (sg-05b90a84f4d579ce7) To Add Postgresql (5432) access to GRPS Aurora Clusters listed
#
#   lsd-rds-pgdbstbmg1-dev-01-cluster GRPS-D2-RDS-DEV-SG (sg-0056e392bda8eb44e)
#   lsd-rds-pgdbstbmg1-dev-global-cluster-1  GRPSNV-D3-RDS01-SG (sg-060720910610cd2e5)
#
#   lsd-rds-pgdbsibmg1-int-01-cluster    GRPS-D2-RDS-INT-SG sg-07bd5440ab68ccd4d 
#   lsd-rds-pgdbsibmg1-int-global-cluster-1 GRPSNV-D3-PGDBSIBMG1-SG sg-069667325c843fdb8 
#
#   Ec2 instance eu-central i-0c7958f020d7e3813 (grpsd2-utilities03) GRPS-D2-UTILITIES-SG sg-03d00384a05c6b8c6
#
#

#
# Anthony Vitale June 25, 2025 Altered Security Group DX3-D1-RDS-GL-S-SG (sg-05b90a84f4d579ce7) To Change the attempt at using Sec Groups to Cidr Blocks for GRPS access
#
#   Removed References to GRPS-D2-RDS-DEV-SG (sg-0056e392bda8eb44e) AND GRPSNV-D3-RDS01-SG (sg-060720910610cd2e5) AND GRPS-D2-RDS-INT-SG sg-07bd5440ab68ccd4d AND GRPSNV-D3-PGDBSIBMG1-SG sg-069667325c843fdb8 
#    To Be cidr_blocks = ["10.11.113.48/28", "10.11.113.32/28", "10.12.214.176/28", "10.12.214.160/28"]
#
#   Removed Reference to GRPS-D2-UTILITIES-SG (sg-03d00384a05c6b8c6) And Replaced with       cidr_blocks = ["10.11.119.16/28"]
#
#
# Anthony Vitale Drift Check
#

resource "aws_security_group" "sg-0ebf1254f7ccd5fbd" {
  description = "DX3-D1-ASPERA2-SG"
  egress = [
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "HTTP"
      from_port        = 80
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 80
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "HTTPS"
      from_port        = 443
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 443
    },
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = "VPC-CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = "VPC-CIDR-1"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.250.2.64/26",
        "10.250.47.224/27",
      ]
      description      = "SMTPS"
      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 = [
        "0.0.0.0/0",
      ]
      description      = "From the World"
      from_port        = 33001
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 33001
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "From the World"
      from_port        = 33001
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 33001
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "From the World"
      from_port        = 40001
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 40001
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "From the World"
      from_port        = 40001
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 40001
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "From the World"
      from_port        = 9092
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9092
    },
    {
      cidr_blocks = [
        "0.0.0.0/0",
      ]
      description      = "From the World"
      from_port        = 9092
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 9092
    },
    {
      cidr_blocks = [
        "10.11.176.219/32",
      ]
      description      = "cloudopsff-bastion02"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.12.246.75/32",
      ]
      description      = "clshrd-bastion01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "Ansible_Tower"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.11.186.192/28",
      ]
      description      = "ampaasp2-aspconsole"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DX3-D1-ASPERA2-SG"
  tags = {
    "Business-unit" = "SME DX3"
    "Environment"   = "DEV"
    "Owner"         = "Christian Seitz"
    "Patch Group"   = "General"
    "Project-code"  = "SME - 2000-0306K"
    "Project-name"  = "DX3"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-ASPERA2-SG"
  }
  tags_all = {
    "Business-unit" = "SME DX3"
    "Environment"   = "DEV"
    "Owner"         = "Christian Seitz"
    "Patch Group"   = "General"
    "Project-code"  = "SME - 2000-0306K"
    "Project-name"  = "DX3"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-ASPERA2-SG"
  }
  vpc_id = "vpc-06422c0b4efa7a80d"

}

resource "aws_security_group" "sg-030c9131b70f0583a" {
  description = "CLOUDOPS-9394"
  egress = [
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.59.9/32",
      ]
      description      = "degtlun5191.server.arvato-systems.de"
      from_port        = 5445
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5445
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.116.42/32",
      ]
      description      = "DX3D1-BASTION01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
        "10.12.246.0/24",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
        "10.12.246.0/24",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.200/32",
      ]
      description      = "From cloudopsff-dbmonitor01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.11.32.160/27",
      ]
      description      = "Arvato Graslite Dev App Subnet"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.11.36.15/32",
      ]
      description      = "degtluv0334.server.arvato-systems.de."
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.11.59.9/32",
      ]
      description      = "degtlun5191.server.arvato-systems.de"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.12.246.64/27",
        "10.250.2.64/27",
      ]
      description      = "From awxd-dbutils01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.12.246.64/27",
      ]
      description      = "ANSIBLE-TOWER"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "AnsibleTower"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks      = []
      description      = "RDS Instance"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups = [
        "sg-069f62a82f695a8cb",
      ]
      self    = false
      to_port = 5432
    },
  ]
  name = "GRASLITE-D-RDSPROXY-SG"
  tags = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-GRASLITE-D-RDSPROXY-SG"
  }
  tags_all = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-GRASLITE-D-RDSPROXY-SG"
  }
  vpc_id = "vpc-06422c0b4efa7a80d"

}

resource "aws_security_group" "sg-069f62a82f695a8cb" {
  description = "DX3-D1-RDS-GL-D-SG"
  egress = [
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.200/32",
      ]
      description      = "From cloudopsff-dbmonitor01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.12.236.190/32",
      ]
      description      = "From awxd-dbutils01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.12.246.64/27",
      ]
      description      = "SSH from clshrd-bastion01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "SSH from clshrd-tower01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = []
      description      = "GRASLITE-D-RDSPROXY-SG"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups = [
        "sg-030c9131b70f0583a",
      ]
      self    = false
      to_port = 5432
    },
  ]
  name = "DX3-D1-RDS-GL-D-SG"
  tags = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Name"          = "DX3-D1-RDS-GL-D-SG"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
  }
  tags_all = {
    "Business-Unit" = "Digital-Exchange"
    "Business-unit" = "Digital Exchange"
    "Environment"   = "Dev"
    "Name"          = "DX3-D1-RDS-GL-D-SG"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
  }
  vpc_id = "vpc-06422c0b4efa7a80d"

}

resource "aws_security_group" "sg-0fa782ae5ca4c807d" {
  description = "DX3-D1-GSIRT-SG"
  egress = [
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.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.11.116.0/26", "10.250.243.0/25"
      ]
      description      = "GSIRT TCP-9998"
      from_port        = 9998
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 9998
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.12.246.64/27",
      ]
      description      = "SSH from clshrd-bastion01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "SSH from clshrd-tower01"
      from_port        = 22
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 22
    },
  ]
  name = "DX3-D1-GSIRT-SG"
  tags = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-GSIRT-SG"
  }
  tags_all = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-GSIRT-SG"
  }
  vpc_id = "vpc-06422c0b4efa7a80d"

}

resource "aws_security_group" "sg-02e154ffd599e6a70" {
  description = "DX3-S1-GRASLITE-RDSPROXY-SG"
  egress = [
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.59.8/32",
      ]
      description      = "degtlun5190.server.arvato-systems.de"
      from_port        = 2444
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 2444
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.192/27",
        "10.12.246.0/24",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
        "10.12.246.0/24",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.36.15/32",
      ]
      description      = "degtluv0334.server.arvato-systems.de"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.11.58.96/27",
      ]
      description      = "Arvato  Graslite Stage App Subnet"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.11.59.8/32",
      ]
      description      = "degtlun5190.server.arvato-systems.de"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "From awxd-dbutils01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = []
      description      = "RDS Instance"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups = [
        "sg-05b90a84f4d579ce7",
      ]
      self    = false
      to_port = 5432
    },
  ]
  name = "DX3-S1-GRASLITE-RDSPROXY-SG"
  tags = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-S1-GRASLITE-RDSPROXY-SG"
  }
  tags_all = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-S1-GRASLITE-RDSPROXY-SG"
  }
  vpc_id = "vpc-06422c0b4efa7a80d"

}

resource "aws_security_group" "sg-05b90a84f4d579ce7" {
  description = "DX3-D1-RDS-GL-S-SG"
  egress = [
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.116.0/26", "10.250.243.0/25"
      ]
      description      = ""
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.113.48/28", "10.11.113.32/28", "10.12.214.176/28", "10.12.214.160/28"
      ]
      description      = "lsd-rds-pgdbstbmg1-dev-global.global-ggijpbwejtbu.global.rds.amazonaws.com AND lsd-rds-pgdbsibmg1-int-global.global-ggijpbwejtbu.global.rds.amazonaws.com"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self    = false
      to_port = 5432
    },
   {
      cidr_blocks = ["10.11.113.0/26","10.11.119.0/25","10.11.177.64/26","10.250.47.32/27"]
      description      = "lsd-rds-pgdbstbmg1-dev-01-cluster"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self    = false
      to_port = 5432
    },
  ]
  ingress = [
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.192/27",
      ]
      description      = "From CCSHARE-FF-APP-1A"
      from_port        = 0
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "udp"
      security_groups  = []
      self             = false
      to_port          = 65534
    },
    {
      cidr_blocks = [
        "10.11.176.200/32",
      ]
      description      = "From cloudopsff-dbmonitor01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.12.246.64/27",
      ]
      description      = "SSH from clshrd-bastion01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks = [
        "10.250.2.64/27",
      ]
      description      = "SSH from clshrd-tower01"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 5432
    },
    {
      cidr_blocks      = []
      description      = "DX3-S1-GRASLITE-RDSPROXY-SG"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups = [
        "sg-02e154ffd599e6a70",
      ]
      self    = false
      to_port = 5432
    },

    {
      cidr_blocks = [
        "10.11.113.48/28", "10.11.113.32/28", "10.12.214.128/25", "10.250.25.0/26"
      ]
      description      = "lsd-rds-pgdbstbmg1-dev-global.global-ggijpbwejtbu.global.rds.amazonaws.com AND lsd-rds-pgdbsibmg1-int-global.global-ggijpbwejtbu.global.rds.amazonaws.com"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self    = false
      to_port = 5432
    },
    {
      cidr_blocks      = [
         "10.11.119.16/28"
      ]
      description      = "GRPS-D2-APP-1B"
      from_port        = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self    = false
      to_port = 5432
    },
    {
      cidr_blocks = ["10.11.116.0/26", "10.250.243.0/25"]
      description = "DX3-D1-VPC-CIDR"
      from_port = 5432
      ipv6_cidr_blocks = []
      prefix_list_ids = []
      protocol = "tcp"
      security_groups = []
      self = false
      to_port = 5432
    },
  ]
  name = "DX3-D1-RDS-GL-S-SG"
  tags = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-RDS-GL-S-SG"
  }
  tags_all = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-RDS-GL-S-SG"
  }
  vpc_id = "vpc-06422c0b4efa7a80d"

}

resource "aws_security_group" "sg-08c8ffe9720295044" {
  description = "default VPC security group"
  egress      = []
  ingress     = []
  name        = "default"
  tags = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-DEFAULT-SG"
  }
  tags_all = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-DEFAULT-SG"
  }
  vpc_id = "vpc-06422c0b4efa7a80d"

}

resource "aws_security_group" "DX3-D1-PGBOUNCER-SG" {
  description = "DX3-D1-PGBOUNCER-SG"
  egress = [
    {
      cidr_blocks = ["0.0.0.0/0"]
      description = "HTTP"
      from_port = 80
      ipv6_cidr_blocks = []
      prefix_list_ids = []
      protocol = "tcp"
      security_groups = []
      self = false
      to_port = 80
    },
    {
      cidr_blocks = ["0.0.0.0/0"]
      description = "HTTPS"
      from_port = 443
      ipv6_cidr_blocks = []
      prefix_list_ids = []
      protocol = "tcp"
      security_groups = []
      self = false
      to_port = 443
    },
    {
      cidr_blocks = ["10.12.246.64/26", "10.12.237.160/27"]
      description = "SMTPS"
      from_port = 587
      ipv6_cidr_blocks = []
      prefix_list_ids = []
      protocol = "tcp"
      security_groups = []
      self = false
      to_port = 587
    },
    {
      cidr_blocks = ["10.11.116.0/26", "10.250.243.0/25"]
      description = "DX3-D1-VPC-CIDR"
      from_port = 0
      ipv6_cidr_blocks = []
      prefix_list_ids = []
      protocol = "tcp"
      security_groups = []
      self = false
      to_port = 65535
    },
    {
      cidr_blocks = ["10.11.116.0/26", "10.250.243.0/25"]
      description = "DX3-D1-VPC-CIDR"
      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.0.0.0/8", "162.49.0.0/16", "192.168.0.0/16"]
      description = "SME Intranet"
      from_port = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids = []
      protocol = "tcp"
      security_groups = []
      self = false
      to_port = 6432
    },
    {
      cidr_blocks = ["10.11.119.0/25"]
      description      = "grpsd2-utilities03"
      from_port        = 6432
      ipv6_cidr_blocks = []
      prefix_list_ids  = []
      protocol         = "tcp"
      security_groups  = []
      self             = false
      to_port          = 6432
    },
  ]
  name = "DX3-D1-PGBOUNCER-SG"
  tags = {
    "Business-Unit" = "Digital-Exchange"
    "Environment"   = "Dev"
    "Owner"         = "Christian seitz"
    "Project-Code"  = "2000306K"
    "Project-Name"  = "SME-DX3-Dev"
    "CLOPS_FW"      = "YES"
    "Name"          = "DX3-D1-PGBOUNCER-SG"
  }
  vpc_id = aws_vpc.vpc-06422c0b4efa7a80d.id
}
