domains
Creates, updates, deletes or gets a domain resource or lists domains in a region
Overview
| Name | domains |
| Type | Resource |
| Description | Resource Type definition for AWS::SageMaker::Domain |
| Id | awscc.sagemaker.domains |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
domain_arn | string | The Amazon Resource Name (ARN) of the created domain. |
url | string | The URL to the created domain. |
app_network_access_type | string | Specifies the VPC used for non-EFS traffic. The default value is PublicInternetOnly. |
auth_mode | string | The mode of authentication that members use to access the domain. |
default_user_settings | object | The default user settings. |
default_space_settings | object | The default space settings. |
domain_name | string | A name for the domain. |
kms_key_id | string | SageMaker uses AWS KMS to encrypt the EFS volume attached to the domain with an AWS managed customer master key (CMK) by default. |
subnet_ids | array | The VPC subnets that Studio uses for communication. |
tags | array | A list of tags to apply to the user profile. |
vpc_id | string | The ID of the Amazon Virtual Private Cloud (VPC) that Studio uses for communication. |
domain_id | string | The domain name. |
home_efs_file_system_id | string | The ID of the Amazon Elastic File System (EFS) managed by this Domain. |
single_sign_on_managed_application_instance_id | string | The SSO managed application instance ID. |
single_sign_on_application_arn | string | The ARN of the application managed by SageMaker in IAM Identity Center. This value is only returned for domains created after October 1, 2023. |
domain_settings | object | A collection of Domain settings. |
app_security_group_management | string | 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. |
security_group_id_for_domain_boundary | string | The ID of the security group that authorizes traffic between the RSessionGateway apps and the RStudioServerPro app. |
tag_propagation | string | Indicates whether the tags added to Domain, User Profile and Space entity is propagated to all SageMaker resources. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
domain_id | string | The domain name. |
region | string | AWS region. |
For more information, see AWS::SageMaker::Domain.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | domains | INSERT | AuthMode, DefaultUserSettings, DomainName, region |
delete_resource | domains | DELETE | Identifier, region |
update_resource | domains | UPDATE | Identifier, PatchDocument, region |
list_resources | domains_list_only | SELECT | region |
get_resource | domains | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual domain.
SELECT
region,
domain_arn,
url,
app_network_access_type,
auth_mode,
default_user_settings,
default_space_settings,
domain_name,
kms_key_id,
subnet_ids,
tags,
vpc_id,
domain_id,
home_efs_file_system_id,
single_sign_on_managed_application_instance_id,
single_sign_on_application_arn,
domain_settings,
app_security_group_management,
security_group_id_for_domain_boundary,
tag_propagation
FROM awscc.sagemaker.domains
WHERE
region = '{{ region }}' AND
Identifier = '{{ domain_id }}';
Lists all domains in a region.
SELECT
region,
domain_id
FROM awscc.sagemaker.domains_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new domain resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.sagemaker.domains (
AuthMode,
DefaultUserSettings,
DomainName,
region
)
SELECT
'{{ auth_mode }}',
'{{ default_user_settings }}',
'{{ domain_name }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.sagemaker.domains (
AppNetworkAccessType,
AuthMode,
DefaultUserSettings,
DefaultSpaceSettings,
DomainName,
KmsKeyId,
SubnetIds,
Tags,
VpcId,
DomainSettings,
AppSecurityGroupManagement,
TagPropagation,
region
)
SELECT
'{{ app_network_access_type }}',
'{{ auth_mode }}',
'{{ default_user_settings }}',
'{{ default_space_settings }}',
'{{ domain_name }}',
'{{ kms_key_id }}',
'{{ subnet_ids }}',
'{{ tags }}',
'{{ vpc_id }}',
'{{ domain_settings }}',
'{{ app_security_group_management }}',
'{{ tag_propagation }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: domain
props:
- name: app_network_access_type
value: '{{ app_network_access_type }}'
- name: auth_mode
value: '{{ auth_mode }}'
- name: default_user_settings
value:
execution_role: '{{ execution_role }}'
auto_mount_home_ef_s: '{{ auto_mount_home_ef_s }}'
jupyter_server_app_settings:
default_resource_spec:
instance_type: '{{ instance_type }}'
sage_maker_image_arn: '{{ sage_maker_image_arn }}'
sage_maker_image_version_arn: '{{ sage_maker_image_version_arn }}'
lifecycle_config_arn: '{{ lifecycle_config_arn }}'
lifecycle_config_arns:
- '{{ lifecycle_config_arns[0] }}'
kernel_gateway_app_settings:
custom_images:
- app_image_config_name: '{{ app_image_config_name }}'
image_name: '{{ image_name }}'
image_version_number: '{{ image_version_number }}'
default_resource_spec: null
lifecycle_config_arns:
- null
r_studio_server_pro_app_settings:
access_status: '{{ access_status }}'
user_group: '{{ user_group }}'
r_session_app_settings:
custom_images:
- null
default_resource_spec: null
jupyter_lab_app_settings:
default_resource_spec: null
lifecycle_config_arns:
- null
code_repositories:
- repository_url: '{{ repository_url }}'
custom_images:
- null
app_lifecycle_management:
idle_settings:
lifecycle_management: '{{ lifecycle_management }}'
idle_timeout_in_minutes: '{{ idle_timeout_in_minutes }}'
min_idle_timeout_in_minutes: '{{ min_idle_timeout_in_minutes }}'
max_idle_timeout_in_minutes: '{{ max_idle_timeout_in_minutes }}'
built_in_lifecycle_config_arn: '{{ built_in_lifecycle_config_arn }}'
space_storage_settings:
default_ebs_storage_settings:
default_ebs_volume_size_in_gb: '{{ default_ebs_volume_size_in_gb }}'
maximum_ebs_volume_size_in_gb: null
code_editor_app_settings:
default_resource_spec: null
lifecycle_config_arns:
- null
custom_images:
- null
app_lifecycle_management: null
built_in_lifecycle_config_arn: '{{ built_in_lifecycle_config_arn }}'
studio_web_portal_settings:
hidden_ml_tools:
- '{{ hidden_ml_tools[0] }}'
hidden_app_types:
- '{{ hidden_app_types[0] }}'
hidden_instance_types:
- '{{ hidden_instance_types[0] }}'
hidden_sage_maker_image_version_aliases:
- sage_maker_image_name: '{{ sage_maker_image_name }}'
version_aliases:
- '{{ version_aliases[0] }}'
default_landing_uri: '{{ default_landing_uri }}'
studio_web_portal: '{{ studio_web_portal }}'
custom_posix_user_config:
uid: '{{ uid }}'
gid: '{{ gid }}'
custom_file_system_configs:
- e_fs_file_system_config:
file_system_path: '{{ file_system_path }}'
file_system_id: '{{ file_system_id }}'
f_sx_lustre_file_system_config:
file_system_path: '{{ file_system_path }}'
file_system_id: '{{ file_system_id }}'
s3_file_system_config:
mount_path: '{{ mount_path }}'
s3_uri: '{{ s3_uri }}'
security_groups:
- '{{ security_groups[0] }}'
sharing_settings:
notebook_output_option: '{{ notebook_output_option }}'
s3_kms_key_id: '{{ s3_kms_key_id }}'
s3_output_path: '{{ s3_output_path }}'
- name: default_space_settings
value:
execution_role: '{{ execution_role }}'
jupyter_server_app_settings: null
kernel_gateway_app_settings: null
security_groups:
- '{{ security_groups[0] }}'
jupyter_lab_app_settings: null
space_storage_settings: null
custom_posix_user_config: null
custom_file_system_configs:
- null
- name: domain_name
value: '{{ domain_name }}'
- name: kms_key_id
value: '{{ kms_key_id }}'
- name: subnet_ids
value:
- '{{ subnet_ids[0] }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
- name: vpc_id
value: '{{ vpc_id }}'
- name: domain_settings
value:
security_group_ids:
- '{{ security_group_ids[0] }}'
r_studio_server_pro_domain_settings:
domain_execution_role_arn: '{{ domain_execution_role_arn }}'
r_studio_connect_url: '{{ r_studio_connect_url }}'
r_studio_package_manager_url: '{{ r_studio_package_manager_url }}'
default_resource_spec: null
docker_settings:
enable_docker_access: '{{ enable_docker_access }}'
vpc_only_trusted_accounts:
- '{{ vpc_only_trusted_accounts[0] }}'
execution_role_identity_config: '{{ execution_role_identity_config }}'
unified_studio_settings:
studio_web_portal_access: '{{ studio_web_portal_access }}'
domain_account_id: '{{ domain_account_id }}'
domain_region: '{{ domain_region }}'
domain_id: '{{ domain_id }}'
project_id: '{{ project_id }}'
environment_id: '{{ environment_id }}'
project_s3_path: '{{ project_s3_path }}'
- name: app_security_group_management
value: '{{ app_security_group_management }}'
- name: tag_propagation
value: '{{ tag_propagation }}'
UPDATE example
Use the following StackQL query and manifest file to update a domain resource, using stack-deploy.
/*+ update */
UPDATE awscc.sagemaker.domains
SET PatchDocument = string('{{ {
"AppNetworkAccessType": app_network_access_type,
"DefaultUserSettings": default_user_settings,
"DefaultSpaceSettings": default_space_settings,
"SubnetIds": subnet_ids,
"AppSecurityGroupManagement": app_security_group_management,
"TagPropagation": tag_propagation
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ domain_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.sagemaker.domains
WHERE
Identifier = '{{ domain_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the domains resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
sagemaker:CreateApp,
sagemaker:CreateDomain,
sagemaker:DescribeDomain,
sagemaker:DescribeImage,
sagemaker:DescribeImageVersion,
iam:CreateServiceLinkedRole,
iam:PassRole,
efs:CreateFileSystem,
kms:CreateGrant,
kms:Decrypt,
kms:DescribeKey,
kms:GenerateDataKeyWithoutPlainText
sagemaker:DescribeDomain
sagemaker:CreateApp,
sagemaker:UpdateDomain,
sagemaker:DescribeDomain,
sagemaker:DescribeImage,
sagemaker:DescribeImageVersion,
iam:PassRole
sagemaker:DeleteApp,
sagemaker:DeleteDomain,
sagemaker:DescribeDomain
sagemaker:ListDomains