Class: AWSCDK::Sagemaker::CfnNotebookInstanceProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sagemaker/cfn_notebook_instance_props.rb

Overview

Properties for defining a CfnNotebookInstance.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(instance_type:, role_arn:, accelerator_types: nil, additional_code_repositories: nil, default_code_repository: nil, direct_internet_access: nil, instance_metadata_service_configuration: nil, kms_key_id: nil, lifecycle_config_name: nil, notebook_instance_name: nil, platform_identifier: nil, root_access: nil, security_group_ids: nil, subnet_id: nil, tags: nil, volume_size_in_gb: nil) ⇒ CfnNotebookInstanceProps

Returns a new instance of CfnNotebookInstanceProps.

Parameters:

  • instance_type (String)

    The type of ML compute instance to launch for the notebook instance.

  • role_arn (String)

    When you send any requests to AWS resources from the notebook instance, SageMaker AI assumes this role to perform tasks on your behalf.

  • accelerator_types (Array<String>, nil) (defaults to: nil)

    A list of Amazon Elastic Inference (EI) instance types to associate with the notebook instance.

  • additional_code_repositories (Array<String>, nil) (defaults to: nil)

    An array of up to three Git repositories associated with the notebook instance.

  • default_code_repository (String, nil) (defaults to: nil)

    The Git repository associated with the notebook instance as its default code repository.

  • direct_internet_access (String, nil) (defaults to: nil)

    Sets whether SageMaker AI provides internet access to the notebook instance.

  • instance_metadata_service_configuration (AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnNotebookInstance::InstanceMetadataServiceConfigurationProperty, nil) (defaults to: nil)

    Information on the IMDS configuration of the notebook instance.

  • kms_key_id (String, nil) (defaults to: nil)

    The Amazon Resource Name (ARN) of a AWS Key Management Service key that SageMaker AI uses to encrypt data on the storage volume attached to your notebook instance.

  • lifecycle_config_name (String, nil) (defaults to: nil)

    The name of a lifecycle configuration to associate with the notebook instance.

  • notebook_instance_name (String, nil) (defaults to: nil)

    The name of the new notebook instance.

  • platform_identifier (String, nil) (defaults to: nil)

    The platform identifier of the notebook instance runtime environment.

  • root_access (String, nil) (defaults to: nil)

    Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .

  • security_group_ids (Array<String>, nil) (defaults to: nil)

    The VPC security group IDs, in the form sg-xxxxxxxx.

  • subnet_id (String, nil) (defaults to: nil)

    The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    A list of key-value pairs to apply to this resource.

  • volume_size_in_gb (Numeric, nil) (defaults to: nil)

    The size, in GB, of the ML storage volume to attach to the notebook instance.



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'sagemaker/cfn_notebook_instance_props.rb', line 25

def initialize(instance_type:, role_arn:, accelerator_types: nil, additional_code_repositories: nil, default_code_repository: nil, direct_internet_access: nil, instance_metadata_service_configuration: nil, kms_key_id: nil, lifecycle_config_name: nil, notebook_instance_name: nil, platform_identifier: nil, root_access: nil, security_group_ids: nil, subnet_id: nil, tags: nil, volume_size_in_gb: nil)
  @instance_type = instance_type
  Jsii::Type.check_type(@instance_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "instanceType")
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn")
  @accelerator_types = accelerator_types
  Jsii::Type.check_type(@accelerator_types, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "acceleratorTypes") unless @accelerator_types.nil?
  @additional_code_repositories = additional_code_repositories
  Jsii::Type.check_type(@additional_code_repositories, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "additionalCodeRepositories") unless @additional_code_repositories.nil?
  @default_code_repository = default_code_repository
  Jsii::Type.check_type(@default_code_repository, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "defaultCodeRepository") unless @default_code_repository.nil?
  @direct_internet_access = direct_internet_access
  Jsii::Type.check_type(@direct_internet_access, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "directInternetAccess") unless @direct_internet_access.nil?
  @instance_metadata_service_configuration = .is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnNotebookInstance::InstanceMetadataServiceConfigurationProperty.new(**.transform_keys(&:to_sym)) : 
  Jsii::Type.check_type(@instance_metadata_service_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuTm90ZWJvb2tJbnN0YW5jZS5JbnN0YW5jZU1ldGFkYXRhU2VydmljZUNvbmZpZ3VyYXRpb25Qcm9wZXJ0eSJ9XX19")), "instanceMetadataServiceConfiguration") unless @instance_metadata_service_configuration.nil?
  @kms_key_id = kms_key_id
  Jsii::Type.check_type(@kms_key_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kmsKeyId") unless @kms_key_id.nil?
  @lifecycle_config_name = lifecycle_config_name
  Jsii::Type.check_type(@lifecycle_config_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "lifecycleConfigName") unless @lifecycle_config_name.nil?
  @notebook_instance_name = notebook_instance_name
  Jsii::Type.check_type(@notebook_instance_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "notebookInstanceName") unless @notebook_instance_name.nil?
  @platform_identifier = platform_identifier
  Jsii::Type.check_type(@platform_identifier, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "platformIdentifier") unless @platform_identifier.nil?
  @root_access = root_access
  Jsii::Type.check_type(@root_access, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "rootAccess") unless @root_access.nil?
  @security_group_ids = security_group_ids
  Jsii::Type.check_type(@security_group_ids, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "securityGroupIds") unless @security_group_ids.nil?
  @subnet_id = subnet_id
  Jsii::Type.check_type(@subnet_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "subnetId") unless @subnet_id.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @volume_size_in_gb = volume_size_in_gb
  Jsii::Type.check_type(@volume_size_in_gb, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "volumeSizeInGb") unless @volume_size_in_gb.nil?
end

Instance Attribute Details

#accelerator_typesArray<String>? (readonly)

A list of Amazon Elastic Inference (EI) instance types to associate with the notebook instance.

Currently, only one instance type can be associated with a notebook instance. For more information, see Using Elastic Inference in Amazon SageMaker .

Valid Values: ml.eia1.medium | ml.eia1.large | ml.eia1.xlarge | ml.eia2.medium | ml.eia2.large | ml.eia2.xlarge .



84
85
86
# File 'sagemaker/cfn_notebook_instance_props.rb', line 84

def accelerator_types
  @accelerator_types
end

#additional_code_repositoriesArray<String>? (readonly)

An array of up to three Git repositories associated with the notebook instance.

These can be either the names of Git repositories stored as resources in your account, or the URL of Git repositories in AWS CodeCommit or in any other Git repository. These repositories are cloned at the same level as the default repository of your notebook instance. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances .



91
92
93
# File 'sagemaker/cfn_notebook_instance_props.rb', line 91

def additional_code_repositories
  @additional_code_repositories
end

#default_code_repositoryString? (readonly)

The Git repository associated with the notebook instance as its default code repository.

This can be either the name of a Git repository stored as a resource in your account, or the URL of a Git repository in AWS CodeCommit or in any other Git repository. When you open a notebook instance, it opens in the directory that contains this repository. For more information, see Associating Git Repositories with SageMaker AI Notebook Instances .



98
99
100
# File 'sagemaker/cfn_notebook_instance_props.rb', line 98

def default_code_repository
  @default_code_repository
end

#direct_internet_accessString? (readonly)

Sets whether SageMaker AI provides internet access to the notebook instance.

If you set this to Disabled this notebook instance is able to access resources only in your VPC, and is not be able to connect to SageMaker AI training and endpoint services unless you configure a NAT Gateway in your VPC.

For more information, see Notebook Instances Are Internet-Enabled by Default . You can set the value of this parameter to Disabled only if you set a value for the SubnetId parameter.



107
108
109
# File 'sagemaker/cfn_notebook_instance_props.rb', line 107

def direct_internet_access
  @direct_internet_access
end

#instance_metadata_service_configurationAWSCDK::IResolvable, ... (readonly)

Information on the IMDS configuration of the notebook instance.



112
113
114
# File 'sagemaker/cfn_notebook_instance_props.rb', line 112

def 
  @instance_metadata_service_configuration
end

#instance_typeString (readonly)

The type of ML compute instance to launch for the notebook instance.

Expect some interruption of service if this parameter is changed as CloudFormation stops a notebook instance and starts it up again to update it.



66
67
68
# File 'sagemaker/cfn_notebook_instance_props.rb', line 66

def instance_type
  @instance_type
end

#kms_key_idString? (readonly)

The Amazon Resource Name (ARN) of a AWS Key Management Service key that SageMaker AI uses to encrypt data on the storage volume attached to your notebook instance.

The KMS key you provide must be enabled. For information, see Enabling and Disabling Keys in the AWS Key Management Service Developer Guide .



119
120
121
# File 'sagemaker/cfn_notebook_instance_props.rb', line 119

def kms_key_id
  @kms_key_id
end

#lifecycle_config_nameString? (readonly)

The name of a lifecycle configuration to associate with the notebook instance.

For information about lifecycle configurations, see Customize a Notebook Instance in the Amazon SageMaker Developer Guide .



126
127
128
# File 'sagemaker/cfn_notebook_instance_props.rb', line 126

def lifecycle_config_name
  @lifecycle_config_name
end

#notebook_instance_nameString? (readonly)

The name of the new notebook instance.



131
132
133
# File 'sagemaker/cfn_notebook_instance_props.rb', line 131

def notebook_instance_name
  @notebook_instance_name
end

#platform_identifierString? (readonly)

The platform identifier of the notebook instance runtime environment.

The default value is notebook-al2-v2 .



138
139
140
# File 'sagemaker/cfn_notebook_instance_props.rb', line 138

def platform_identifier
  @platform_identifier
end

#role_arnString (readonly)

When you send any requests to AWS resources from the notebook instance, SageMaker AI assumes this role to perform tasks on your behalf.

You must grant this role necessary permissions so SageMaker AI can perform these tasks. The policy must allow the SageMaker AI service principal (sagemaker.amazonaws.com) permissions to assume this role. For more information, see SageMaker AI Roles .

To be able to pass this role to SageMaker AI, the caller of this API must have the iam:PassRole permission.



75
76
77
# File 'sagemaker/cfn_notebook_instance_props.rb', line 75

def role_arn
  @role_arn
end

#root_accessString? (readonly)

Whether root access is enabled or disabled for users of the notebook instance. The default value is Enabled .

Lifecycle configurations need root access to be able to set up a notebook instance. Because of this, lifecycle configurations associated with a notebook instance always run with root access even if you disable root access for users.



145
146
147
# File 'sagemaker/cfn_notebook_instance_props.rb', line 145

def root_access
  @root_access
end

#security_group_idsArray<String>? (readonly)

The VPC security group IDs, in the form sg-xxxxxxxx.

The security groups must be for the same VPC as specified in the subnet.



152
153
154
# File 'sagemaker/cfn_notebook_instance_props.rb', line 152

def security_group_ids
  @security_group_ids
end

#subnet_idString? (readonly)

The ID of the subnet in a VPC to which you would like to have a connectivity from your ML compute instance.



157
158
159
# File 'sagemaker/cfn_notebook_instance_props.rb', line 157

def subnet_id
  @subnet_id
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

A list of key-value pairs to apply to this resource.

For more information, see Resource Tag and Using Cost Allocation Tags .

You can add tags later by using the CreateTags API.



166
167
168
# File 'sagemaker/cfn_notebook_instance_props.rb', line 166

def tags
  @tags
end

#volume_size_in_gbNumeric? (readonly)

The size, in GB, of the ML storage volume to attach to the notebook instance.

The default value is 5 GB.

Expect some interruption of service if this parameter is changed as CloudFormation stops a notebook instance and starts it up again to update it.



175
176
177
# File 'sagemaker/cfn_notebook_instance_props.rb', line 175

def volume_size_in_gb
  @volume_size_in_gb
end

Class Method Details

.jsii_propertiesObject



177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'sagemaker/cfn_notebook_instance_props.rb', line 177

def self.jsii_properties
  {
    :instance_type => "instanceType",
    :role_arn => "roleArn",
    :accelerator_types => "acceleratorTypes",
    :additional_code_repositories => "additionalCodeRepositories",
    :default_code_repository => "defaultCodeRepository",
    :direct_internet_access => "directInternetAccess",
    :instance_metadata_service_configuration => "instanceMetadataServiceConfiguration",
    :kms_key_id => "kmsKeyId",
    :lifecycle_config_name => "lifecycleConfigName",
    :notebook_instance_name => "notebookInstanceName",
    :platform_identifier => "platformIdentifier",
    :root_access => "rootAccess",
    :security_group_ids => "securityGroupIds",
    :subnet_id => "subnetId",
    :tags => "tags",
    :volume_size_in_gb => "volumeSizeInGb",
  }
end

Instance Method Details

#to_jsiiObject



198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
# File 'sagemaker/cfn_notebook_instance_props.rb', line 198

def to_jsii
  result = {}
  result.merge!({
    "instanceType" => @instance_type,
    "roleArn" => @role_arn,
    "acceleratorTypes" => @accelerator_types,
    "additionalCodeRepositories" => @additional_code_repositories,
    "defaultCodeRepository" => @default_code_repository,
    "directInternetAccess" => @direct_internet_access,
    "instanceMetadataServiceConfiguration" => @instance_metadata_service_configuration,
    "kmsKeyId" => @kms_key_id,
    "lifecycleConfigName" => @lifecycle_config_name,
    "notebookInstanceName" => @notebook_instance_name,
    "platformIdentifier" => @platform_identifier,
    "rootAccess" => @root_access,
    "securityGroupIds" => @security_group_ids,
    "subnetId" => @subnet_id,
    "tags" => @tags,
    "volumeSizeInGb" => @volume_size_in_gb,
  })
  result.compact
end