SageMaker 노트북의 직접 인터넷 접근

통제된 VPC 경로가 필요한 SageMaker 노트북의 직접 인터넷 접근을 끄세요.

설명

VPC에서 SageMaker 노트북의 외부 통신을 제어하려면 SageMaker가 제공하는 직접 인터넷 경로를 끄세요.

잠재적 영향

직접 경로가 열려 있으면 데이터 전송이나 파일 다운로드에 VPC의 외부 통신 제한이 적용되지 않을 수 있습니다.

해결 방법

SubnetId와 DirectInternetAccess: Disabled를 지정하세요. 필요한 서비스에 연결되도록 VPC 엔드포인트 또는 NAT 경로를 마련하고 외부 통신을 시험하세요. 루트 권한은 별도로 관리하세요.

예시

두 예제는 같은 서브넷과 실행 역할을 사용합니다. 기존 노트북의 DirectInternetAccess를 변경하면 CloudFormation이 인스턴스를 교체하므로 먼저 로컬 파일을 백업하세요.

변경 전

yaml
Resources:
  Notebook:
    Type: AWS::SageMaker::NotebookInstance
    Properties:
      DirectInternetAccess: Enabled
      InstanceType: ml.c4.2xlarge
      RoleArn: arn:aws:iam::111122223333:role/SageMakerNotebookRole
      SubnetId: !Ref NotebookSubnet

변경 후

yaml
Resources:
  Notebook:
    Type: AWS::SageMaker::NotebookInstance
    Properties:
      DirectInternetAccess: Disabled
      InstanceType: ml.c4.2xlarge
      RoleArn: arn:aws:iam::111122223333:role/SageMakerNotebookRole
      SubnetId: !Ref NotebookSubnet

참조