Skip to main content

domains

Creates, updates, deletes, gets or lists a domains resource.

Overview

Namedomains
TypeResource
Idaws.sagemaker.domains

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
app_network_access_typestringSpecifies the VPC used for non-EFS traffic. The default value is PublicInternetOnly. PublicInternetOnly - Non-EFS traffic is through a VPC managed by Amazon SageMaker AI, which allows direct internet access VpcOnly - All traffic is through the specified VPC and subnets (PublicInternetOnly, VpcOnly)
app_security_group_managementstringThe 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. (Service, Customer)
auth_modestringThe domain's authentication mode. (SSO, IAM)
creation_timestring (date-time)The creation time.
default_space_settingsobjectThe default settings for shared spaces that users create in the domain.
default_user_settingsobjectSettings which are applied to UserProfiles in this domain if settings are not explicitly specified in a given UserProfile.
domain_arnstringThe domain's Amazon Resource Name (ARN). (pattern: <code>arn:aws[a-z-]:sagemaker:[a-z0-9-]:[0-9]{12}:domain/.*</code>)
domain_idstringThe domain ID. (pattern: <code>d-(-*[a-z0-9]){1,61}</code>)
domain_namestringThe domain name. (pattern: <code>[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}</code>)
domain_settingsobjectA collection of Domain settings.
failure_reasonstringThe failure reason.
home_efs_file_system_creationstringIndicates whether a home EFS file system is created for the domain. (Enabled, Disabled)
home_efs_file_system_idstringThe ID of the Amazon Elastic File System managed by this Domain.
home_efs_file_system_kms_key_idstringUse KmsKeyId. (pattern: <code>[a-zA-Z0-9:/_-]*</code>)
kms_key_idstringThe Amazon Web Services KMS customer managed key used to encrypt the EFS volume attached to the domain. (pattern: <code>[a-zA-Z0-9:/_-]*</code>)
last_modified_timestring (date-time)The last modified time.
security_group_id_for_domain_boundarystringThe ID of the security group that authorizes traffic between the RSessionGateway apps and the RStudioServerPro app. (pattern: <code>[-0-9a-zA-Z]+</code>)
single_sign_on_application_arnstringThe ARN of the application managed by SageMaker AI in IAM Identity Center. This value is only returned for domains created after October 1, 2023. (pattern: <code>arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso::[0-9]+:application/[a-zA-Z0-9-_.]+/apl-[a-zA-Z0-9]+</code>)
single_sign_on_managed_application_instance_idstringThe IAM Identity Center managed application instance ID.
statusstringThe status. (Deleting, Failed, InService, Pending, Updating, Update_Failed, Delete_Failed)
subnet_idsarrayThe VPC subnets that the domain uses for communication.
tag_propagationstringIndicates whether custom tag propagation is supported for the domain. (ENABLED, DISABLED)
urlstringThe domain's URL.
vpc_idstringThe ID of the Amazon Virtual Private Cloud (VPC) that the domain uses for communication. (pattern: <code>[-0-9a-zA-Z]+</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_domainselectregionThe description of the domain.
list_domainsselectregionLists the domains.
create_domaininsertregion, DomainName, AuthMode, DefaultUserSettingsCreates 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 AI uses the Amazon Web Services Key Management Service (Amazon Web Services KMS) to encrypt the EFS volume attached to the domain with an Amazon Web Services 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 AI, 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 AI Studio notebook or to train or host models unless your VPC has an interface endpoint to the SageMaker AI API and runtime or a NAT gateway and your security groups allow outbound connections. NFS traffic over TCP on port 2049 needs to be allowed in both inbound and outbound rules in order to launch a Amazon SageMaker AI Studio app successfully. For more information, see Connect Amazon SageMaker AI Studio Notebooks to Resources in a VPC.
update_domainupdateregion, DomainIdUpdates the default settings for new user profiles in the domain.
delete_domaindeleteregionUsed to delete a domain. If you onboarded with IAM mode, you will need to delete your domain to onboard again using IAM Identity Center. Use with caution. All of the members of the domain will lose access to their EFS volume, including data, notebooks, and other artifacts.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

The description of the domain.

SELECT
app_network_access_type,
app_security_group_management,
auth_mode,
creation_time,
default_space_settings,
default_user_settings,
domain_arn,
domain_id,
domain_name,
domain_settings,
failure_reason,
home_efs_file_system_creation,
home_efs_file_system_id,
home_efs_file_system_kms_key_id,
kms_key_id,
last_modified_time,
security_group_id_for_domain_boundary,
single_sign_on_application_arn,
single_sign_on_managed_application_instance_id,
status,
subnet_ids,
tag_propagation,
url,
vpc_id
FROM aws.sagemaker.domains
WHERE region = '{{ region }}' -- required
;

INSERT examples

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 AI uses the Amazon Web Services Key Management Service (Amazon Web Services KMS) to encrypt the EFS volume attached to the domain with an Amazon Web Services 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 AI, 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 AI Studio notebook or to train or host models unless your VPC has an interface endpoint to the SageMaker AI API and runtime or a NAT gateway and your security groups allow outbound connections. NFS traffic over TCP on port 2049 needs to be allowed in both inbound and outbound rules in order to launch a Amazon SageMaker AI Studio app successfully. For more information, see Connect Amazon SageMaker AI Studio Notebooks to Resources in a VPC.

INSERT INTO aws.sagemaker.domains (
DomainName,
AuthMode,
DefaultUserSettings,
DomainSettings,
SubnetIds,
VpcId,
Tags,
AppNetworkAccessType,
HomeEfsFileSystemKmsKeyId,
KmsKeyId,
AppSecurityGroupManagement,
HomeEfsFileSystemCreation,
TagPropagation,
DefaultSpaceSettings,
region
)
SELECT
'{{ DomainName }}' /* required */,
'{{ AuthMode }}' /* required */,
'{{ DefaultUserSettings }}' /* required */,
'{{ DomainSettings }}',
'{{ SubnetIds }}',
'{{ VpcId }}',
'{{ Tags }}',
'{{ AppNetworkAccessType }}',
'{{ HomeEfsFileSystemKmsKeyId }}',
'{{ KmsKeyId }}',
'{{ AppSecurityGroupManagement }}',
'{{ HomeEfsFileSystemCreation }}',
'{{ TagPropagation }}',
'{{ DefaultSpaceSettings }}',
'{{ region }}'
RETURNING
domain_arn,
domain_id,
url
;

UPDATE examples

Updates the default settings for new user profiles in the domain.

UPDATE aws.sagemaker.domains
SET
DomainId = '{{ DomainId }}',
DefaultUserSettings = '{{ DefaultUserSettings }}',
DomainSettingsForUpdate = '{{ DomainSettingsForUpdate }}',
AppSecurityGroupManagement = '{{ AppSecurityGroupManagement }}',
DefaultSpaceSettings = '{{ DefaultSpaceSettings }}',
SubnetIds = '{{ SubnetIds }}',
AppNetworkAccessType = '{{ AppNetworkAccessType }}',
TagPropagation = '{{ TagPropagation }}',
HomeEfsFileSystemCreation = '{{ HomeEfsFileSystemCreation }}',
VpcId = '{{ VpcId }}'
WHERE
region = '{{ region }}' --required
AND DomainId = '{{ DomainId }}' --required
RETURNING
domain_arn;

DELETE examples

Used to delete a domain. If you onboarded with IAM mode, you will need to delete your domain to onboard again using IAM Identity Center. Use with caution. All of the members of the domain will lose access to their EFS volume, including data, notebooks, and other artifacts.

DELETE FROM aws.sagemaker.domains
WHERE region = '{{ region }}' --required
;