選取您的 Cookie 偏好設定

我們使用提供自身網站和服務所需的基本 Cookie 和類似工具。我們使用效能 Cookie 收集匿名統計資料,以便了解客戶如何使用我們的網站並進行改進。基本 Cookie 無法停用,但可以按一下「自訂」或「拒絕」以拒絕效能 Cookie。

如果您同意,AWS 與經核准的第三方也會使用 Cookie 提供實用的網站功能、記住您的偏好設定,並顯示相關內容,包括相關廣告。若要接受或拒絕所有非必要 Cookie,請按一下「接受」或「拒絕」。若要進行更詳細的選擇,請按一下「自訂」。

透過界面 VPC 端點連線至 Amazon SageMaker Studio 和 Studio Classic

焦點模式
透過界面 VPC 端點連線至 Amazon SageMaker Studio 和 Studio Classic - Amazon SageMaker AI

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

您可以透過 VPC 中的界面端點,從 Amazon Amazon Virtual Private Cloud(Amazon VPC) 連線至 Amazon SageMaker Studio 和 Amazon SageMaker Studio Classic,而不是透過網際網路連線。當您使用介面 VPC 端點 (介面端點) 時,VPC 與 Studio 或 Studio Classic 之間的通訊會在 AWS 網路內完全安全地進行。

Studio 和 Studio Classic 支援由 提供支援的介面端點AWS PrivateLink。每個介面端點皆會由一個或多個具私有 IP 地址彈性網路介面來表示,而該介面位於您的 VPC 子網路中。

Studio 和 Studio Classic 支援所有可用 Amazon SageMaker AIAmazon VPC AWS 的區域介面端點。

建立 VPC 端點

您可以使用 AWS 主控台或 AWS Command Line Interface () 建立介面端點以連線至 Studio 或 Studio Classic AWS CLI。如需指示,請參閱建立介面端點。請務必為 VPC 中要從中連線到 Studio 和 Studio Classic 的所有子網路建立介面端點。

當您建立介面端點時,請確定端點上的安全群組允許來自與 Studio 和 Studio Classic 相關聯之安全群組的 HTTPS 流量傳入存取。如需詳細資訊,請參閱使用 VPC 端點控制服務的存取

注意

除了建立介面端點以連線至 Studio 和 Studio Classic 之外,也請建立介面端點以連線至 Amazon SageMaker API。當使用者呼叫 CreatePresignedDomainUrl以取得 URL 以連線至 Studio 和 Studio Classic 時,該呼叫會經過用來連線至 SageMaker API 的介面端點。

當您建立介面端點時,請指定 aws.sagemaker.Region.studio做為 Studio 或 Studio Classic 的服務名稱。在您建立介面端點後,請為您的端點啟用私有 DNS。當您使用 SageMaker API AWS CLI、 或 主控台從 VPC 內連線至 Studio 或 Studio Classic 時,您可以透過介面端點而非公有網際網路進行連線。您還需要為 Amazon VPC 端點設定具有私有託管區域的自訂 DNS,以便 Studio 或 Studio Classic 可以使用api.sagemaker.$region.amazonaws.com端點存取 SageMaker API,而不是使用 VPC 端點 URL。有關設置專用託管區域的指示,請參閱使用私有託管區域

您可以將 Amazon VPC 端點政策連接至用來連線至 Studio 或 Studio Classic 的介面 VPC 端點。端點政策控制對 Studio 或 Studio Classic 的存取。您可以指定下列選項:

  • 可執行動作的主體。

  • 可執行的動作。

  • 可供執行動作的資源。

若要搭配 Studio 或 Studio Classic 使用 VPC 端點,您的端點政策必須允許 KernelGateway 應用程式類型的 CreateApp操作。此設定可讓透過 VPC 端點路由傳送的流量呼叫 CreateApp API。下列範例 VPC 端點政策顯示如何允許 CreateApp 操作。

{ "Statement": [ { "Action": "sagemaker:CreateApp", "Effect": "Allow", "Resource": "arn:aws:sagemaker:us-west-2:acct-id:app/domain-id/*", "Principal": "*" } ] }

如需詳細資訊,請參閱使用 VPC 端點控制服務的存取

下列 VPC 端點政策範例指定,所有可存取端點的使用者都可以使用指定的網域 ID 存取 SageMaker AI 網域中的使用者設定檔。其他網域的存取會遭拒。

{ "Statement": [ { "Action": "sagemaker:CreatePresignedDomainUrl", "Effect": "Allow", "Resource": "arn:aws:sagemaker:us-west-2:acct-id:user-profile/domain-id/*", "Principal": "*" } ] }

即使您在 VPC 中設定界面端點,VPC 外部的使用者也可以透過網際網路連線至 Studio 或 Studio Classic。

若要僅允許從您的 VPC 內建立的連線存取,請建立 AWS Identity and Access Management (IAM) 政策。將該政策新增至用於存取 Studio 或 Studio Classic 的每個使用者、群組或角色。只有在使用 IAM 模式進行身分驗證時才支援此功能,IAM Identity Center 模式不支援此功能。下列範例示範如何建立此類政策。

重要

如果您套用類似下列其中一個範例的 IAM 政策,則使用者無法透過 SageMaker AI 主控台存取 Studio 或 Studio Classic 或指定的 SageMaker APIs。若要存取 Studio 或 Studio Classic,使用者必須使用預先簽章的 URL 或直接呼叫 SageMaker APIs。

範例 1:僅允許介面端點子網路內的連線

下列政策僅允許向建立介面端點之子網路中的呼叫者建立連線。

{ "Id": "sagemaker-studio-example-1", "Version": "2012-10-17", "Statement": [ { "Sid": "Enable SageMaker Studio Access", "Effect": "Allow", "Action": [ "sagemaker:CreatePresignedDomainUrl", "sagemaker:DescribeUserProfile" ], "Resource": "*", "Condition": { "StringEquals": { "aws:SourceVpc": "vpc-111bbaaa" } } } ] }

範例 2:僅允許透過介面端點使用 aws:sourceVpce 的連線

下列策略僅允許連線至透過 aws:sourceVpce 條件金鑰指定的介面端點建立的連線。例如,第一個界面端點可以允許透過 SageMaker AI 主控台存取 。第二個介面端點可允許透過 SageMaker API 進行存取。

{ "Id": "sagemaker-studio-example-2", "Version": "2012-10-17", "Statement": [ { "Sid": "Enable SageMaker Studio Access", "Effect": "Allow", "Action": [ "sagemaker:CreatePresignedDomainUrl", "sagemaker:DescribeUserProfile" ], "Resource": "*", "Condition": { "ForAnyValue:StringEquals": { "aws:sourceVpce": [ "vpce-111bbccc", "vpce-111bbddd" ] } } } ] }

此政策也包含 DescribeUserProfile 動作。通常您會在嘗試連線到網域之前呼叫 DescribeUserProfile 來確定使用者設定檔的狀態為 InService。例如:

aws sagemaker describe-user-profile \ --domain-id domain-id \ --user-profile-name profile-name

回應:

{ "DomainId": "domain-id", "UserProfileArn": "arn:aws:sagemaker:us-west-2:acct-id:user-profile/domain-id/profile-name", "UserProfileName": "profile-name", "HomeEfsFileSystemUid": "200001", "Status": "InService", "LastModifiedTime": 1605418785.555, "CreationTime": 1605418477.297 }
aws sagemaker create-presigned-domain-url --domain-id domain-id \ --user-profile-name profile-name

回應:

{ "AuthorizedUrl": "https://domain-id.studio.us-west-2.sagemaker.aws/auth?token=AuthToken" }

對於這兩個呼叫,如果您使用的是 2018 年 8 月 13 日之前發行的 AWS SDK 版本,您必須在呼叫中指定端點 URL。例如,下列範例示範呼叫 create-presigned-domain-url

aws sagemaker create-presigned-domain-url --domain-id domain-id \ --user-profile-name profile-name \ --endpoint-url vpc-endpoint-id.api.sagemaker.Region.vpce.amazonaws.com

範例 3:允許來自使用 aws:SourceIp IP 地址的連線

下列政策只允許使用 aws:SourceIp 條件金鑰來自指定 IP 地址範圍的連線。

{ "Id": "sagemaker-studio-example-3", "Version": "2012-10-17", "Statement": [ { "Sid": "Enable SageMaker Studio Access", "Effect": "Allow", "Action": [ "sagemaker:CreatePresignedDomainUrl", "sagemaker:DescribeUserProfile" ], "Resource": "*", "Condition": { "IpAddress": { "aws:SourceIp": [ "192.0.2.0/24", "203.0.113.0/24" ] } } } ] }

範例 4:允許透過使用介面端點從 IP 地址進行連線 aws:VpcSourceIp

如果您透過介面端點存取 Studio 或 Studio Classic,您可以使用 aws:VpcSourceIp條件金鑰,僅允許從建立介面端點的子網路內指定 IP 地址範圍進行連線,如下列政策所示:

{ "Id": "sagemaker-studio-example-4", "Version": "2012-10-17", "Statement": [ { "Sid": "Enable SageMaker Studio Access", "Effect": "Allow", "Action": [ "sagemaker:CreatePresignedDomainUrl", "sagemaker:DescribeUserProfile" ], "Resource": "*", "Condition": { "IpAddress": { "aws:VpcSourceIp": [ "192.0.2.0/24", "203.0.113.0/24" ] }, "StringEquals": { "aws:SourceVpc": "vpc-111bbaaa" } } } ] }
隱私權網站條款Cookie 偏好設定
© 2025, Amazon Web Services, Inc.或其附屬公司。保留所有權利。