resource "aws_vpc_endpoint" "S3" {
  vpc_id          = aws_vpc.DIGSYS-P3.id
  service_name    = "com.amazonaws.eu-central-1.s3"
  route_table_ids = [aws_route_table.DIGSYS-P3-PUB-RT.id, aws_route_table.DIGSYS-P3-APP-RT.id, aws_route_table.DIGSYS-P3-RDS-RT.id]

  tags = {
    Name = "DIGSYS-P3-S3-EP"
    aws-migration-project-id = "MPE22602"
    map-migrated = "d-server-02sa4nzuab143a"
  }
}

resource "aws_vpc_endpoint" "GSIRT" {
  vpc_id            = aws_vpc.DIGSYS-P3.id
  service_name      = "com.amazonaws.vpce.eu-central-1.vpce-svc-01bb9105aa792cfff"
  vpc_endpoint_type = "Interface"

  security_group_ids = [
    aws_security_group.DIGSYS-P3-GSIRT-SG.id,
  ]

  subnet_ids          = [aws_subnet.DIGSYS-P3-XAPP-1A.id, aws_subnet.DIGSYS-P3-XAPP-1B.id, aws_subnet.DIGSYS-P3-XAPP-1C.id]
  private_dns_enabled = false
  tags = {
    Name = "DIGSYS-P3-GSIRT-EP"
    aws-migration-project-id = "MPE22602"
    map-migrated = "d-server-02sa4nzuab143a"
  }
}

resource "aws_vpc_endpoint" "API" {
  vpc_id            = aws_vpc.DIGSYS-P3.id
  service_name      = "com.amazonaws.eu-central-1.execute-api"
  vpc_endpoint_type = "Interface"

  security_group_ids = [
    aws_security_group.DIGSYS-P3-RDS-SG.id,
  ]

  subnet_ids          = [aws_subnet.DIGSYS-P3-IAPP-1A.id, aws_subnet.DIGSYS-P3-IAPP-1B.id]
  private_dns_enabled = false
  tags = {
    Name = "DIGSYS-P3-API-EP"
    aws-migration-project-id = "MPE22602"
    map-migrated = "d-server-02sa4nzuab143a"
  }
}
