Skip to content

bootstrap: fetch spored from the regional S3 name so an S3 interface endpoint serves a private-only instance #1436

Closed

Description

@scttfrdmn

Found while building --no-public-ip (#1433).

The bootstrap downloads spored from the global-style S3 name:

  • pkg/launcher/bootstrap.go:735 (the stub): https://spawn-binaries-${SPAWN_BS_REGION:-us-east-1}.s3.amazonaws.com, falling back to https://spawn-binaries-us-east-1.s3.amazonaws.com
  • pkg/launcher/bootstrap.go:935-936: the same pair for the body.

Two consequences for an instance with no public IP (no NAT):

  1. An S3 interface endpoint does not serve it. Private DNS on an S3 interface endpoint covers the regional names (s3.<region>.amazonaws.com, *.s3.<region>.amazonaws.com), not *.s3.amazonaws.com. So in a VPC whose only S3 path is an interface endpoint, the bootstrap cannot fetch spored, and the instance runs with no TTL or cost-limit enforcement. The Multi-card --efa always takes an Elastic IP although spawn is SSM-first: allow private-only launches (EIP quota caps EFA fleet size) #1433 pre-flight therefore counts only an S3 gateway endpoint (or NAT) for s3, and says why in the refusal.
  2. The us-east-1 fallback is cross-region. A gateway endpoint routes only its own region's S3 prefix list, so from any other region the fallback fetch cannot work without NAT. It matters only when the regional bucket fetch fails, but then it fails silently on a private instance.

Not verified against AWS: the claim in 1 is from the S3 PrivateLink documentation, not a live test; the owner's us-east-1 default VPC has a gateway endpoint, so the #1433 live test will not exercise it.

Proposed fix: use the regional virtual-hosted name, https://spawn-binaries-${REGION}.s3.${REGION}.amazonaws.com, in both places (and keep the fallback, now knowingly cross-region). Then the pre-flight could accept an S3 interface endpoint with private DNS (drop GatewayOnly on the s3 entry in pkg/aws/private_network.go). The user-data budget tests (TestBareBootstrapFitsItsBudget) apply, since the URL is in the stub.

Activity

  1. added
    enhancement
    area:launch
    area:networking
    on Oct 30, 2026
  2. scttfrdmn commented on Oct 31, 2026

    @scttfrdmn
    ContributorAuthor

    Live verification on v0.153.0 (2026-10-31)

    Owner-authorized, in account 942542972736, us-east-1, using the released v0.153.0 CLI.

    Setup: an isolated VPC 10.199.0.0/16 with one subnet in us-east-1a. The route table had only the local route: no IGW, no NAT, no gateway endpoints. Five interface endpoints with private DNS: s3 (PrivateDnsOnlyForInboundResolverEndpoint=false), ec2, ssm, ssmmessages, ec2messages.

    Results (all PASS):

    • Pre-flight: the --no-public-ip pre-flight accepted the S3 interface endpoint (✓ --no-public-ip: s3: interface endpoint vpce-…), which is new in fix(bootstrap): fetch spored from the regional S3 name; pre-flight counts an S3 interface endpoint (#1436) #1466.
    • Launch: spawn launch --no-public-ip --subnet-id … t4g.small gave instance i-0467e145136b78366. spored was verified in 28.6 s, with Public IP none (private only).
    • On the instance, over SSM:
      • spawn-binaries-us-east-1.s3.us-east-1.amazonaws.com resolves to 10.199.1.144 (the endpoint) and returns HTTP 200 in 0.06 s.
      • The global name spawn-binaries-us-east-1.s3.amazonaws.com resolves to public S3 IPs and times out. So the pre-bootstrap: fetch spored from the regional S3 name so an S3 interface endpoint serves a private-only instance #1436 URLs could not have worked here; the regional rename is what makes interface endpoints work.
      • No internet: https://example.com times out.
      • The bootstrap fetched from https://spawn-binaries-us-east-1.s3.us-east-1.amazonaws.com/spawn/versions/0.153.0.
      • spored is active, version 0.153.0.
      • spawn:last-heartbeat was written (21:57:30Z) through the ec2 interface endpoint.
    • Connect: spawn connect -- hostname worked over SSM RunCommand, with the private-only note.

    Teardown and leak check:

    • The instance was terminated. All 5 endpoints were deleted (confirmed NotFound), then the SG, route table, subnet and VPC.
    • VPCs, endpoints, EIPs and SGs are back to the baseline. No instance of ours remains.
    • Cost was well under $1.
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

    area:launcharea:networkingcomponent:spawnenhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions