AWS::SageMaker::Domain - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::SageMaker::Domain

Creates a Domain. A domain consists of an associated Amazon Elastic File System volume, a list of authorized users, and a variety of security, application, policy, and Amazon Virtual Private Cloud (VPC) configurations. Users within a domain can share notebook files and other artifacts with each other.

EFS storage

When a domain is created, an EFS volume is created for use by all of the users within the domain. Each user receives a private home directory within the EFS volume for notebooks, Git repositories, and data files.

SageMaker uses the Amazon Key Management Service (Amazon KMS) to encrypt the EFS volume attached to the domain with an Amazon managed key by default. For more control, you can specify a customer managed key. For more information, see Protect Data at Rest Using Encryption.

VPC configuration

All traffic between the domain and the Amazon EFS volume is through the specified VPC and subnets. For other traffic, you can specify the AppNetworkAccessType parameter. AppNetworkAccessType corresponds to the network access type that you choose when you onboard to the domain. The following options are available:

  • PublicInternetOnly - Non-EFS traffic goes through a VPC managed by Amazon SageMaker, which allows internet access. This is the default value.

  • VpcOnly - All traffic is through the specified VPC and subnets. Internet access is disabled by default. To allow internet access, you must specify a NAT gateway.

    When internet access is disabled, you won't be able to run a Amazon SageMaker Studio notebook or to train or host models unless your VPC has an interface endpoint to the SageMaker API and runtime or a NAT gateway and your security groups allow outbound connections.

Important

NFS traffic over TCP on port 2049 needs to be allowed in both inbound and outbound rules in order to launch a Amazon SageMaker Studio app successfully.

For more information, see Connect Amazon SageMaker Studio Notebooks to Resources in a VPC.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::SageMaker::Domain", "Properties" : { "AppNetworkAccessType" : String, "AppSecurityGroupManagement" : String, "AuthMode" : String, "DefaultSpaceSettings" : DefaultSpaceSettings, "DefaultUserSettings" : UserSettings, "DomainName" : String, "DomainSettings" : DomainSettings, "KmsKeyId" : String, "SubnetIds" : [ String, ... ], "Tags" : [ Tag, ... ], "VpcId" : String } }

Properties

AppNetworkAccessType

Specifies the VPC used for non-EFS traffic. The default value is PublicInternetOnly.

  • PublicInternetOnly - Non-EFS traffic is through a VPC managed by Amazon SageMaker, which allows direct internet access

  • VpcOnly - All Studio traffic is through the specified VPC and subnets

Valid Values: PublicInternetOnly | VpcOnly

Required: No

Type: String

Allowed values: PublicInternetOnly | VpcOnly

Update requires: No interruption

AppSecurityGroupManagement

The entity that creates and manages the required security groups for inter-app communication in VpcOnly mode. Required when CreateDomain.AppNetworkAccessType is VpcOnly and DomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArn is provided. If setting up the domain for use with RStudio, this value must be set to Service.

Allowed Values: Service | Customer

Required: No

Type: String

Allowed values: Service | Customer

Update requires: No interruption

AuthMode

The mode of authentication that members use to access the Domain.

Valid Values: SSO | IAM

Required: Yes

Type: String

Allowed values: SSO | IAM

Update requires: Replacement

DefaultSpaceSettings

A collection of settings that apply to spaces created in the domain.

Required: No

Type: DefaultSpaceSettings

Update requires: No interruption

DefaultUserSettings

The default user settings.

Required: Yes

Type: UserSettings

Update requires: No interruption

DomainName

The domain name.

Required: Yes

Type: String

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}

Maximum: 63

Update requires: Replacement

DomainSettings

A collection of settings that apply to the SageMaker Domain. These settings are specified through the CreateDomain API call.

Required: No

Type: DomainSettings

Update requires: No interruption

KmsKeyId

SageMaker uses Amazon KMS to encrypt the EFS volume attached to the Domain with an Amazon managed customer master key (CMK) by default. For more control, specify a customer managed CMK.

Length Constraints: Maximum length of 2048.

Pattern: .*

Required: No

Type: String

Pattern: .*

Maximum: 2048

Update requires: Replacement

SubnetIds

The VPC subnets that Studio uses for communication.

Length Constraints: Maximum length of 32.

Array members: Minimum number of 1 item. Maximum number of 16 items.

Pattern: [-0-9a-zA-Z]+

Required: Yes

Type: Array of String

Minimum: 1

Maximum: 32 | 16

Update requires: No interruption

Tags

Tags to associated with the Domain. Each tag consists of a key and an optional value. Tag keys must be unique per resource. Tags are searchable using the Search API.

Tags that you specify for the Domain are also added to all apps that are launched in the Domain.

Array members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

Type: Array of Tag

Minimum: 0

Maximum: 50

Update requires: Replacement

VpcId

The ID of the Amazon Virtual Private Cloud (Amazon VPC) that Studio uses for communication.

Length Constraints: Maximum length of 32.

Pattern: [-0-9a-zA-Z]+

Required: Yes

Type: String

Pattern: [-0-9a-zA-Z]+

Maximum: 32

Update requires: Replacement

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the Domain ID, such as d-xxxxxxxxxxxx.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

DomainArn

The Amazon Resource Name (ARN) of the Domain, such as arn:aws:sagemaker:us-west-2:account-id:domain/my-domain-name.

DomainId

The Domain ID.

HomeEfsFileSystemId

The ID of the Amazon Elastic File System (EFS) managed by this Domain.

SecurityGroupIdForDomainBoundary

The ID of the security group that authorizes traffic between the RSessionGateway apps and the RStudioServerPro app.

SingleSignOnApplicationArn

The ARN of the application managed by SageMaker in IAM Identity Center. This value is only returned for domains created after October 1, 2023.

SingleSignOnManagedApplicationInstanceId

The IAM Identity Center managed application instance ID.

Url

The URL for the Domain.