Skip to content

[Feature]: Support VM-less AWS gateways backed by native load balancers #4443

Open

Description

@sachintandon

Problem

With the AWS gateway backend, creating a dstack gateway provisions one or more gateway EC2 instances. Setting load_balancer: { type: alb } adds an AWS Application Load Balancer in front of those instances; it does not remove them. This leaves a long-running gateway compute layer to pay for and operate even when AWS can provide the ingress, TLS, health-check, and traffic-distribution primitives.

We would like an opt-in gateway mode that uses AWS-native infrastructure for the data plane without requiring a dstack-managed gateway EC2 instance, while keeping gateway and service lifecycle, routing intent, and scaling policy under dstack control-plane management.

Proposed outcome

Allow a project to create a VM-less AWS gateway backed by AWS-native load-balancing resources (for example, ALB and ACM). dstack remains responsible for the gateway resource model and desired state; AWS handles TLS termination and forwarding to healthy service targets.

The existing EC2-backed gateway mode should remain available and backward compatible.

Suggested implementation areas

  • Add an explicit, opt-in gateway implementation mode/capability for a native AWS data plane. Keep the public configuration declarative; final field names and resource topology should be determined during design.
  • Reconcile AWS resources from dstack desired state: ALB/listeners, ACM certificate attachment, target groups or an equivalent scalable routing mechanism, health checks, security groups, and DNS-facing hostname.
  • Integrate service lifecycle with target registration: register service replicas when ready, remove/drain targets on scale-in or termination, and recover/reconcile after control-plane restarts or partial AWS API failures.
  • Keep scaling decisions in dstack. Define how run/service metrics or AWS metrics feed the existing scaling policy, and make target capacity converge with the desired replica count.
  • Preserve gateway-facing service behavior where supported: stable service URLs, project isolation/export, HTTPS, WebSockets, authentication, rate limiting, and health semantics. Document any capability that cannot be provided by the native mode.
  • Use least-privilege AWS permissions and support private targets/subnets. Surface AWS quotas, provisioning failures, and resource ownership in events/logs.
  • Decide whether ALBs and certificates are per gateway, shared across eligible gateways/projects, or configurable by policy. Account for ALB listener-rule and target-group quotas when many services/projects share a domain.

Acceptance criteria

  • A gateway can be provisioned on AWS without creating a gateway EC2 instance.
  • A service can be reached through a stable custom-domain endpoint with ACM-backed HTTPS and traffic reaches only healthy, active run replicas.
  • Run start, scale-out, scale-in, stop, and failure events update the native data plane safely, including connection draining and cleanup/reconciliation.
  • dstack remains the source of truth for service/gateway lifecycle and autoscaling decisions; no manual target registration is required.
  • Existing EC2-backed gateways and their configuration continue to work unchanged.
  • The supported feature set, IAM permissions, resource/quotas model, and multi-project sharing behavior are documented.

Related issues

Activity

  1. peterschmidt85 commented on Oct 30, 2026

    @peterschmidt85
    Contributor
  2. jvstme commented on Nov 3, 2026

    @jvstme
    Collaborator

    Hi @sachintandon. Such a VM-less mode should technically be possible, although it would require vendor-specific implementations for several things:

    • replica (de)registration
    • stats collection for scaling
    • rate limits

    Some service functionality might not be possible to support:

    • authorization using dstack user tokens
    • multi-cloud deployments with gateway-to-service connectivity over SSH
    • potentially, LLM-specific features exposed through dstack's OpenAI-compatible endpoint

    Could you please elaborate on the motivation behind the VM-less mode? In the description, I see this rationale:

    This leaves a long-running gateway compute layer to pay for and operate.

    Regarding costs, we believe they are typically insignificant compared to the rest of the infrastructure, especially in the AI/ML use cases that dstack targets.

    As for operational overhead, the gateway compute layer is managed by dstack, and ideally, operating it shouldn't require much effort from dstack users. If you've encountered any pain points in operating it, could you please describe them? We'd be happy to consider addressing them separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions