ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept · Builds on SAA-C03

Isolating ML systems with VPCs

Run ML in private subnets, reach AWS services through endpoints, and turn on network isolation where code must not call out.

You know from Solutions Architect Associate

  • Security groups are stateful allow rules at the instance. Network ACLs are stateless rules at the subnet.
  • VPC Flow Logs record accepted and rejected traffic.
  • Reference a security group as a source instead of an IP range.
Read the Solutions Architect Associate lesson
VPC
ML jobs and endpoints
Interface endpoints
S3 gateway endpoint
NAT gateway
AWS services
S3
Internet
Endpoints keep AWS traffic private. NAT is the optional path to the internet.
  • Private subnet

    Effect
    No public IP
    Use when
    Always for ML resources
  • VPC-only Studio

    Effect
    No direct internet
    Use when
    Strict notebook control
  • VPC endpoints

    Effect
    Private path to AWS services
    Use when
    Reach S3, ECR, Bedrock
  • NAT gateway

    Effect
    Outbound internet
    Use when
    Packages or public APIs
  • Network isolation

    Effect
    No container network at all
    Use when
    Untrusted code, sensitive data
Each setting and when to use it.

1 / 2

  • Private subnet

    Effect
    No public IP
    Use when
    Always for ML resources
  • VPC-only Studio

    Effect
    No direct internet
    Use when
    Strict notebook control
  • VPC endpoints

    Effect
    Private path to AWS services
    Use when
    Reach S3, ECR, Bedrock

2 / 2

  • NAT gateway

    Effect
    Outbound internet
    Use when
    Packages or public APIs
  • Network isolation

    Effect
    No container network at all
    Use when
    Untrusted code, sensitive data
Each setting and when to use it.

What it is

Put notebooks, training jobs, processing jobs and endpoints in private subnets, and give them security groups that allow only what they need. Studio can run in VPC-only mode: all traffic goes through your VPC, with no direct internet access. You then provide the paths yourself: interface endpoints for the SageMaker API and runtime and other services, and a gateway endpoint for S3. Jobs that you start from Studio do not inherit those VPC settings, so set the subnets and security groups on each job, or enforce them with the IAM condition keys.

What it is

There are two ways out of a private subnet. A NAT gateway gives internet access, for example to install packages or call a public API, but it is billed by the hour and by data, and it is a path for data to leave. VPC endpoints keep traffic on the AWS network: a gateway endpoint for S3, and interface endpoints (AWS PrivateLink) for services such as Bedrock (bedrock-runtime and others), ECR and CloudWatch Logs. An endpoint policy narrows what may pass. Prefer endpoints for AWS services, and use NAT only when you need the internet.

What it is

Network isolation goes further. A training job or model with EnableNetworkIsolation blocks all inbound and outbound network access from the container. SageMaker copies the data in and the output out, so the code cannot send anything to the internet. Use it with untrusted code or sensitive data, and package dependencies in the image beforehand. Turn on VPC Flow Logs to see accepted and rejected connections, which helps to confirm that isolation works.

Remember

  • Private subnets and tight security groups for notebooks, jobs and endpoints.
  • Studio VPC-only mode: no internet, you add the endpoints.
  • Jobs from Studio need their own VPC settings. Enforce with condition keys.
  • Endpoints for AWS services. NAT only for the internet.
  • PrivateLink for Bedrock, ECR and Logs. Gateway endpoint for S3.

Remember

  • Network isolation: no network calls at all from the container.

On the exam

  • “Notebooks must have no internet access” points to Studio VPC-only mode.
  • “Training code must not send data out” points to network isolation.
  • “Call Bedrock without using the internet” points to a PrivateLink interface endpoint.
  • “Private subnet needs S3 without NAT” points to an S3 gateway endpoint.