Class CfnDomain
- All Implemented Interfaces:
IConstruct,IDependable,IInspectable,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct
AWS::SageMaker::Domain.
Creates a Domain used by Amazon SageMaker Studio. A domain consists of an associated Amazon Elastic File System (EFS) 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 AWS Key Management Service ( AWS KMS) to encrypt the EFS volume attached to the domain with an AWS 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 SageMaker Studio traffic between the domain and the EFS volume is through the specified VPC and subnets. For other Studio traffic, you can specify the AppNetworkAccessType parameter. AppNetworkAccessType corresponds to the network access type that you choose when you onboard to Studio. 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 Studio 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 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.
NFS traffic over TCP on port 2049 needs to be allowed in both inbound and outbound rules in order to launch a SageMaker Studio app successfully.
For more information, see Connect SageMaker Studio Notebooks to Resources in a VPC .
Example:
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.*;
CfnDomain cfnDomain = CfnDomain.Builder.create(this, "MyCfnDomain")
.authMode("authMode")
.defaultUserSettings(UserSettingsProperty.builder()
.executionRole("executionRole")
// the properties below are optional
.jupyterServerAppSettings(JupyterServerAppSettingsProperty.builder()
.defaultResourceSpec(ResourceSpecProperty.builder()
.instanceType("instanceType")
.lifecycleConfigArn("lifecycleConfigArn")
.sageMakerImageArn("sageMakerImageArn")
.sageMakerImageVersionArn("sageMakerImageVersionArn")
.build())
.build())
.kernelGatewayAppSettings(KernelGatewayAppSettingsProperty.builder()
.customImages(List.of(CustomImageProperty.builder()
.appImageConfigName("appImageConfigName")
.imageName("imageName")
// the properties below are optional
.imageVersionNumber(123)
.build()))
.defaultResourceSpec(ResourceSpecProperty.builder()
.instanceType("instanceType")
.lifecycleConfigArn("lifecycleConfigArn")
.sageMakerImageArn("sageMakerImageArn")
.sageMakerImageVersionArn("sageMakerImageVersionArn")
.build())
.build())
.rSessionAppSettings(RSessionAppSettingsProperty.builder()
.customImages(List.of(CustomImageProperty.builder()
.appImageConfigName("appImageConfigName")
.imageName("imageName")
// the properties below are optional
.imageVersionNumber(123)
.build()))
.defaultResourceSpec(ResourceSpecProperty.builder()
.instanceType("instanceType")
.lifecycleConfigArn("lifecycleConfigArn")
.sageMakerImageArn("sageMakerImageArn")
.sageMakerImageVersionArn("sageMakerImageVersionArn")
.build())
.build())
.rStudioServerProAppSettings(RStudioServerProAppSettingsProperty.builder()
.accessStatus("accessStatus")
.userGroup("userGroup")
.build())
.securityGroups(List.of("securityGroups"))
.sharingSettings(SharingSettingsProperty.builder()
.notebookOutputOption("notebookOutputOption")
.s3KmsKeyId("s3KmsKeyId")
.s3OutputPath("s3OutputPath")
.build())
.build())
.domainName("domainName")
.subnetIds(List.of("subnetIds"))
.vpcId("vpcId")
// the properties below are optional
.appNetworkAccessType("appNetworkAccessType")
.appSecurityGroupManagement("appSecurityGroupManagement")
.defaultSpaceSettings(DefaultSpaceSettingsProperty.builder()
.executionRole("executionRole")
// the properties below are optional
.jupyterServerAppSettings(JupyterServerAppSettingsProperty.builder()
.defaultResourceSpec(ResourceSpecProperty.builder()
.instanceType("instanceType")
.lifecycleConfigArn("lifecycleConfigArn")
.sageMakerImageArn("sageMakerImageArn")
.sageMakerImageVersionArn("sageMakerImageVersionArn")
.build())
.build())
.kernelGatewayAppSettings(KernelGatewayAppSettingsProperty.builder()
.customImages(List.of(CustomImageProperty.builder()
.appImageConfigName("appImageConfigName")
.imageName("imageName")
// the properties below are optional
.imageVersionNumber(123)
.build()))
.defaultResourceSpec(ResourceSpecProperty.builder()
.instanceType("instanceType")
.lifecycleConfigArn("lifecycleConfigArn")
.sageMakerImageArn("sageMakerImageArn")
.sageMakerImageVersionArn("sageMakerImageVersionArn")
.build())
.build())
.securityGroups(List.of("securityGroups"))
.build())
.domainSettings(DomainSettingsProperty.builder()
.rStudioServerProDomainSettings(RStudioServerProDomainSettingsProperty.builder()
.domainExecutionRoleArn("domainExecutionRoleArn")
// the properties below are optional
.defaultResourceSpec(ResourceSpecProperty.builder()
.instanceType("instanceType")
.lifecycleConfigArn("lifecycleConfigArn")
.sageMakerImageArn("sageMakerImageArn")
.sageMakerImageVersionArn("sageMakerImageVersionArn")
.build())
.rStudioConnectUrl("rStudioConnectUrl")
.rStudioPackageManagerUrl("rStudioPackageManagerUrl")
.build())
.securityGroupIds(List.of("securityGroupIds"))
.build())
.kmsKeyId("kmsKeyId")
.tags(List.of(CfnTag.builder()
.key("key")
.value("value")
.build()))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnDomain.static interfaceA custom SageMaker image.static interfaceA collection of settings that apply to spaces created in the Domain.static interfaceA collection of settings that apply to theSageMaker Domain.static interfaceThe JupyterServer app settings.static interfaceThe KernelGateway app settings.static interfaceSpecifies the ARN's of a SageMaker image and SageMaker image version, and the instance type that the version runs on.static interfaceA collection of settings that apply to anRSessionGatewayapp.static interfaceA collection of settings that configure user interaction with theRStudioServerProapp.static interfaceA collection of settings that configure theRStudioServerProDomain-level app.static interfaceSpecifies options when sharing an Amazon SageMaker Studio notebook.static interfaceA collection of settings that apply to users of Amazon SageMaker Studio.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct
IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.core.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSpecifies the VPC used for non-EFS traffic.The entity that creates and manages the required security groups for inter-app communication inVpcOnlymode.The Amazon Resource Name (ARN) of the Domain, such asarn:aws:sagemaker:us-west-2:account-id:domain/my-domain-name.The Domain ID.The ID of the Amazon Elastic File System (EFS) managed by this Domain.The ID of the security group that authorizes traffic between theRSessionGatewayapps and theRStudioServerProapp.The IAM Identity Center managed application instance ID.The URL for the Domain.The mode of authentication that members use to access the Domain.AWS::SageMaker::Domain.DefaultSpaceSettings.The default user settings.The domain name.A collection of settings that apply to theSageMaker Domain.SageMaker uses AWS KMS to encrypt the EFS volume attached to the Domain with an AWS managed customer master key (CMK) by default.The VPC subnets that Studio uses for communication.getTags()Tags to associated with the Domain.getVpcId()The ID of the Amazon Virtual Private Cloud (Amazon VPC) that Studio uses for communication.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties(Map<String, Object> props) voidsetAppNetworkAccessType(String value) Specifies the VPC used for non-EFS traffic.voidThe entity that creates and manages the required security groups for inter-app communication inVpcOnlymode.voidsetAuthMode(String value) The mode of authentication that members use to access the Domain.voidAWS::SageMaker::Domain.DefaultSpaceSettings.voidAWS::SageMaker::Domain.DefaultSpaceSettings.voidThe default user settings.voidThe default user settings.voidsetDomainName(String value) The domain name.voidsetDomainSettings(IResolvable value) A collection of settings that apply to theSageMaker Domain.voidA collection of settings that apply to theSageMaker Domain.voidsetKmsKeyId(String value) SageMaker uses AWS KMS to encrypt the EFS volume attached to the Domain with an AWS managed customer master key (CMK) by default.voidsetSubnetIds(List<String> value) The VPC subnets that Studio uses for communication.voidThe ID of the Amazon Virtual Private Cloud (Amazon VPC) that Studio uses for communication.Methods inherited from class software.amazon.awscdk.core.CfnResource
addDeletionOverride, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, isCfnResource, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.core.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.core.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.amazon.awscdk.core.Construct
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validateMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnDomain
protected CfnDomain(software.amazon.jsii.JsiiObjectRef objRef) -
CfnDomain
protected CfnDomain(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnDomain
@Stability(Stable) public CfnDomain(@NotNull Construct scope, @NotNull String id, @NotNull CfnDomainProps props) Create a newAWS::SageMaker::Domain.- Parameters:
scope-- scope in which this resource is defined.
id-- scoped id of the resource.
props-- resource properties.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin interfaceIInspectable- Parameters:
inspector-- tree inspector to collect and process attributes.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderPropertiesin classCfnResource- Parameters:
props- This parameter is required.
-
getAttrDomainArn
The Amazon Resource Name (ARN) of the Domain, such asarn:aws:sagemaker:us-west-2:account-id:domain/my-domain-name. -
getAttrDomainId
The Domain ID. -
getAttrHomeEfsFileSystemId
The ID of the Amazon Elastic File System (EFS) managed by this Domain. -
getAttrSecurityGroupIdForDomainBoundary
The ID of the security group that authorizes traffic between theRSessionGatewayapps and theRStudioServerProapp. -
getAttrSingleSignOnManagedApplicationInstanceId
The IAM Identity Center managed application instance ID. -
getAttrUrl
The URL for the Domain. -
getCfnProperties
- Overrides:
getCfnPropertiesin classCfnResource
-
getTags
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.
-
getAuthMode
The mode of authentication that members use to access the Domain.Valid Values :
SSO | IAM -
setAuthMode
The mode of authentication that members use to access the Domain.Valid Values :
SSO | IAM -
getDefaultUserSettings
The default user settings. -
setDefaultUserSettings
The default user settings. -
setDefaultUserSettings
@Stability(Stable) public void setDefaultUserSettings(@NotNull CfnDomain.UserSettingsProperty value) The default user settings. -
getDomainName
The domain name. -
setDomainName
The domain name. -
getSubnetIds
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]+ -
setSubnetIds
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]+ -
getVpcId
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]+ -
setVpcId
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]+ -
getAppNetworkAccessType
Specifies the VPC used for non-EFS traffic. The default value isPublicInternetOnly.PublicInternetOnly- Non-EFS traffic is through a VPC managed by Amazon SageMaker , which allows direct internet accessVpcOnly- All Studio traffic is through the specified VPC and subnets
Valid Values :
PublicInternetOnly | VpcOnly -
setAppNetworkAccessType
Specifies the VPC used for non-EFS traffic. The default value isPublicInternetOnly.PublicInternetOnly- Non-EFS traffic is through a VPC managed by Amazon SageMaker , which allows direct internet accessVpcOnly- All Studio traffic is through the specified VPC and subnets
Valid Values :
PublicInternetOnly | VpcOnly -
getAppSecurityGroupManagement
The entity that creates and manages the required security groups for inter-app communication inVpcOnlymode.Required when
CreateDomain.AppNetworkAccessTypeisVpcOnlyandDomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArnis provided. If setting up the domain for use with RStudio, this value must be set toService.Allowed Values :
Service|Customer -
setAppSecurityGroupManagement
The entity that creates and manages the required security groups for inter-app communication inVpcOnlymode.Required when
CreateDomain.AppNetworkAccessTypeisVpcOnlyandDomainSettings.RStudioServerProDomainSettings.DomainExecutionRoleArnis provided. If setting up the domain for use with RStudio, this value must be set toService.Allowed Values :
Service|Customer -
getDefaultSpaceSettings
AWS::SageMaker::Domain.DefaultSpaceSettings. -
setDefaultSpaceSettings
AWS::SageMaker::Domain.DefaultSpaceSettings. -
setDefaultSpaceSettings
@Stability(Stable) public void setDefaultSpaceSettings(@Nullable CfnDomain.DefaultSpaceSettingsProperty value) AWS::SageMaker::Domain.DefaultSpaceSettings. -
getDomainSettings
A collection of settings that apply to theSageMaker Domain.These settings are specified through the
CreateDomainAPI call. -
setDomainSettings
A collection of settings that apply to theSageMaker Domain.These settings are specified through the
CreateDomainAPI call. -
setDomainSettings
A collection of settings that apply to theSageMaker Domain.These settings are specified through the
CreateDomainAPI call. -
getKmsKeyId
SageMaker uses AWS KMS to encrypt the EFS volume attached to the Domain with an AWS managed customer master key (CMK) by default.For more control, specify a customer managed CMK.
Length Constraints : Maximum length of 2048.
Pattern :
.* -
setKmsKeyId
SageMaker uses AWS KMS to encrypt the EFS volume attached to the Domain with an AWS managed customer master key (CMK) by default.For more control, specify a customer managed CMK.
Length Constraints : Maximum length of 2048.
Pattern :
.*
-