resource "aws_lb" "aas-dev-aspera1-nlb" {
  enable_cross_zone_load_balancing = true
  enable_deletion_protection       = true
  internal                         = false
  ip_address_type                  = "ipv4"
  load_balancer_type               = "network"
  name                             = "aas-dev-aspera1-nlb"
  security_groups                  = []
  subnets = [
    "subnet-0043268eaa73e9590",
    "subnet-0a15d2f0b76ab6617",
  ]
  tags     = {}
  tags_all = {}

   access_logs {
     bucket  = "sme-amp-dev-eu-central-1-elb-logs"
     enabled = true
     prefix  = "aas-dev-aspera1-nlb"
   }

  subnet_mapping {
    subnet_id = "subnet-0043268eaa73e9590"
  }
  subnet_mapping {
    subnet_id = "subnet-0a15d2f0b76ab6617"
  }
}

resource "aws_lb" "aas-stage-aspera1-nlb" {
  enable_cross_zone_load_balancing = true
  enable_deletion_protection       = true
  internal                         = false
  ip_address_type                  = "ipv4"
  load_balancer_type               = "network"
  name                             = "aas-stage-aspera1-nlb"
  security_groups                  = []
  subnets = [
    "subnet-0043268eaa73e9590",
    "subnet-0a15d2f0b76ab6617",
  ]
  tags     = {}
  tags_all = {}

   access_logs {
     bucket  = "sme-amp-dev-eu-central-1-elb-logs"
     enabled = true
     prefix  = "aas-stage-aspera1-nlb"
   }

  subnet_mapping {
    subnet_id = "subnet-0043268eaa73e9590"
  }
  subnet_mapping {
    subnet_id = "subnet-0a15d2f0b76ab6617"
  }
}


resource "aws_lb" "k8s-ampstage-ampservi-4c731d1259" {
  desync_mitigation_mode                      = "defensive"
  drop_invalid_header_fields                  = false
  enable_cross_zone_load_balancing            = true
  enable_deletion_protection                  = false
  enable_http2                                = true
  enable_tls_version_and_cipher_suite_headers = false
  enable_waf_fail_open                        = false
  enable_xff_client_port                      = false
  idle_timeout                                = 60
  internal                                    = true
  ip_address_type                             = "ipv4"
  load_balancer_type                          = "application"
  name                                        = "k8s-ampstage-ampservi-4c731d1259"
  preserve_host_header                        = false
  security_groups = [
    "sg-01283cf7d81c8673f",
    "sg-0332481580582ebb2",
  ]
  subnets = [
    "subnet-04464f4ff3365685f",
    "subnet-0f6e7949c62a787ff",
  ]
  tags = {
    "Name"                     = "amp-service-gateway-ingress-alb"
    "elbv2.k8s.aws/cluster"    = "amp-dev-as-eks"
    "ingress.k8s.aws/resource" = "LoadBalancer"
    "ingress.k8s.aws/stack"    = "amp-stage-as/amp-service-gateway-ingress"
  }
  tags_all = {
    "Name"                     = "amp-service-gateway-ingress-alb"
    "elbv2.k8s.aws/cluster"    = "amp-dev-as-eks"
    "ingress.k8s.aws/resource" = "LoadBalancer"
    "ingress.k8s.aws/stack"    = "amp-stage-as/amp-service-gateway-ingress"
  }
  xff_header_processing_mode = "append"

  access_logs {
    bucket  = "sme-amp-dev-eu-central-1-elb-logs"
    enabled = true
    prefix  = "amp-service-gateway"
  }

  subnet_mapping {
    subnet_id = "subnet-04464f4ff3365685f"
  }
  subnet_mapping {
    subnet_id = "subnet-0f6e7949c62a787ff"
  }
}

resource "aws_lb" "k8s-aminodev-ampexpor-0272cb65dc" {
  #checkov:skip=CKV2_AWS_28: Ensure public facing ALB are protected by WAF
  desync_mitigation_mode                      = "defensive"
  drop_invalid_header_fields                  = false
  enable_cross_zone_load_balancing            = true
  enable_deletion_protection                  = false
  enable_http2                                = true
  enable_tls_version_and_cipher_suite_headers = false
  enable_waf_fail_open                        = false
  enable_xff_client_port                      = false
  idle_timeout                                = 60
  internal                                    = false
  ip_address_type                             = "ipv4"
  load_balancer_type                          = "application"
  name                                        = "k8s-aminodev-ampexpor-0272cb65dc"
  preserve_host_header                        = false
  security_groups = [
    "sg-01283cf7d81c8673f",
    "sg-038cbcc3f277c726b",
  ]
  subnets = [
    "subnet-0043268eaa73e9590",
    "subnet-0a15d2f0b76ab6617",
  ]
  tags = {
    "Name"                     = "amp-export-service-ingress-alb"
    "elbv2.k8s.aws/cluster"    = "amp-dev-as-eks"
    "ingress.k8s.aws/resource" = "LoadBalancer"
    "ingress.k8s.aws/stack"    = "amino-dev-as/amp-export-service-ingress"
  }
  tags_all = {
    "Name"                     = "amp-export-service-ingress-alb"
    "elbv2.k8s.aws/cluster"    = "amp-dev-as-eks"
    "ingress.k8s.aws/resource" = "LoadBalancer"
    "ingress.k8s.aws/stack"    = "amino-dev-as/amp-export-service-ingress"
  }
  xff_header_processing_mode = "append"

  access_logs {
    bucket  = "sme-amp-dev-eu-central-1-elb-logs"
    enabled = true
    prefix  = "amp-export-service"
  }

  subnet_mapping {
    subnet_id = "subnet-0043268eaa73e9590"
  }
  subnet_mapping {
    subnet_id = "subnet-0a15d2f0b76ab6617"
  }
}

resource "aws_lb" "aas-dev-tusd-ext-lb" {
  #checkov:skip=CKV2_AWS_28: Ensure public facing ALB are protected by WAF
  name                                        = "aas-dev-tusd-ext-lb"
  internal                                    = false
  load_balancer_type                          = "application"
  security_groups                             = [aws_security_group.AMP-AAS-D2-TUSD-SG.id]
  subnets                                     = [aws_subnet.subnet-0043268eaa73e9590.id, aws_subnet.subnet-0a15d2f0b76ab6617.id]
  enable_cross_zone_load_balancing            = "false"
  enable_deletion_protection                  = "true"
  enable_http2                                = true
  enable_tls_version_and_cipher_suite_headers = false
  enable_waf_fail_open                        = false
  enable_xff_client_port                      = false
  idle_timeout                                = 600
  preserve_host_header                        = false
  xff_header_processing_mode                  = "append"
  access_logs {
    bucket  = "sme-core-cloud-compliance-centralized-lb-euc1-logs"
    enabled = true
    prefix  = "sme-asset-management-platform-dev"
  }
  tags = {
    Terraform     = "True"
    Business-Unit = "AMP"
    Environment   = "Dev"
    Name          = "aas-dev-tusd-ext-lb"
    Owner         = "Nathaniel Lovett"
    Project-Code  = "SME-AMP"
    Project-Name  = "AMP"
    POC           = "Nathaniel Lovett"
  }
}
