Class: AWSCDK::Sagemaker::CfnModelProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Sagemaker::CfnModelProps
- Defined in:
- sagemaker/cfn_model_props.rb
Overview
Properties for defining a CfnModel.
Instance Attribute Summary collapse
-
#containers ⇒ AWSCDK::IResolvable, ...
readonly
Specifies the containers in the inference pipeline.
-
#enable_network_isolation ⇒ Boolean, ...
readonly
Isolates the model container.
-
#execution_role_arn ⇒ String?
readonly
The Amazon Resource Name (ARN) of the IAM role that SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs.
-
#inference_execution_config ⇒ AWSCDK::IResolvable, ...
readonly
Specifies details of how containers in a multi-container endpoint are called.
-
#model_name ⇒ String?
readonly
The name of the new model.
-
#primary_container ⇒ AWSCDK::IResolvable, ...
readonly
The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.
-
#tags ⇒ Array<AWSCDK::CfnTag>?
readonly
A list of key-value pairs to apply to this resource.
-
#vpc_config ⇒ AWSCDK::IResolvable, ...
readonly
A VpcConfig object that specifies the VPC that you want your model to connect to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(containers: nil, enable_network_isolation: nil, execution_role_arn: nil, inference_execution_config: nil, model_name: nil, primary_container: nil, tags: nil, vpc_config: nil) ⇒ CfnModelProps
constructor
A new instance of CfnModelProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(containers: nil, enable_network_isolation: nil, execution_role_arn: nil, inference_execution_config: nil, model_name: nil, primary_container: nil, tags: nil, vpc_config: nil) ⇒ CfnModelProps
Returns a new instance of CfnModelProps.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'sagemaker/cfn_model_props.rb', line 17 def initialize(containers: nil, enable_network_isolation: nil, execution_role_arn: nil, inference_execution_config: nil, model_name: nil, primary_container: nil, tags: nil, vpc_config: nil) @containers = containers Jsii::Type.check_type(@containers, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2FnZW1ha2VyLkNmbk1vZGVsLkNvbnRhaW5lckRlZmluaXRpb25Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "containers") unless @containers.nil? @enable_network_isolation = enable_network_isolation Jsii::Type.check_type(@enable_network_isolation, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "enableNetworkIsolation") unless @enable_network_isolation.nil? @execution_role_arn = execution_role_arn Jsii::Type.check_type(@execution_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "executionRoleArn") unless @execution_role_arn.nil? @inference_execution_config = inference_execution_config.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnModel::InferenceExecutionConfigProperty.new(**inference_execution_config.transform_keys(&:to_sym)) : inference_execution_config Jsii::Type.check_type(@inference_execution_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuTW9kZWwuSW5mZXJlbmNlRXhlY3V0aW9uQ29uZmlnUHJvcGVydHkifV19fQ==")), "inferenceExecutionConfig") unless @inference_execution_config.nil? @model_name = model_name Jsii::Type.check_type(@model_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelName") unless @model_name.nil? @primary_container = primary_container.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnModel::ContainerDefinitionProperty.new(**primary_container.transform_keys(&:to_sym)) : primary_container Jsii::Type.check_type(@primary_container, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuTW9kZWwuQ29udGFpbmVyRGVmaW5pdGlvblByb3BlcnR5In1dfX0=")), "primaryContainer") unless @primary_container.nil? @tags = .is_a?(Array) ? .map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil? @vpc_config = vpc_config.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnModel::VPCConfigProperty.new(**vpc_config.transform_keys(&:to_sym)) : vpc_config Jsii::Type.check_type(@vpc_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuTW9kZWwuVnBjQ29uZmlnUHJvcGVydHkifV19fQ==")), "vpcConfig") unless @vpc_config.nil? end |
Instance Attribute Details
#containers ⇒ AWSCDK::IResolvable, ... (readonly)
Specifies the containers in the inference pipeline.
40 41 42 |
# File 'sagemaker/cfn_model_props.rb', line 40 def containers @containers end |
#enable_network_isolation ⇒ Boolean, ... (readonly)
Isolates the model container.
No inbound or outbound network calls can be made to or from the model container.
47 48 49 |
# File 'sagemaker/cfn_model_props.rb', line 47 def enable_network_isolation @enable_network_isolation end |
#execution_role_arn ⇒ String? (readonly)
The Amazon Resource Name (ARN) of the IAM role that SageMaker can assume to access model artifacts and docker image for deployment on ML compute instances or for batch transform jobs.
Deploying on ML compute instances is part of model hosting. For more information, see SageMaker Roles .
To be able to pass this role to SageMaker, the caller of this API must have the
iam:PassRolepermission.
56 57 58 |
# File 'sagemaker/cfn_model_props.rb', line 56 def execution_role_arn @execution_role_arn end |
#inference_execution_config ⇒ AWSCDK::IResolvable, ... (readonly)
Specifies details of how containers in a multi-container endpoint are called.
61 62 63 |
# File 'sagemaker/cfn_model_props.rb', line 61 def inference_execution_config @inference_execution_config end |
#model_name ⇒ String? (readonly)
The name of the new model.
66 67 68 |
# File 'sagemaker/cfn_model_props.rb', line 66 def model_name @model_name end |
#primary_container ⇒ AWSCDK::IResolvable, ... (readonly)
The location of the primary docker image containing inference code, associated artifacts, and custom environment map that the inference code uses when the model is deployed for predictions.
71 72 73 |
# File 'sagemaker/cfn_model_props.rb', line 71 def primary_container @primary_container end |
#tags ⇒ Array<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 in the AWS Billing and Cost Management User Guide .
78 79 80 |
# File 'sagemaker/cfn_model_props.rb', line 78 def @tags end |
#vpc_config ⇒ AWSCDK::IResolvable, ... (readonly)
A VpcConfig object that specifies the VPC that you want your model to connect to. Control access to and from your model container by configuring the VPC. VpcConfig is used in hosting services and in batch transform. For more information, see Protect Endpoints by Using an Amazon Virtual Private Cloud and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private Cloud .
83 84 85 |
# File 'sagemaker/cfn_model_props.rb', line 83 def vpc_config @vpc_config end |
Class Method Details
.jsii_properties ⇒ Object
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'sagemaker/cfn_model_props.rb', line 85 def self.jsii_properties { :containers => "containers", :enable_network_isolation => "enableNetworkIsolation", :execution_role_arn => "executionRoleArn", :inference_execution_config => "inferenceExecutionConfig", :model_name => "modelName", :primary_container => "primaryContainer", :tags => "tags", :vpc_config => "vpcConfig", } end |
Instance Method Details
#to_jsii ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'sagemaker/cfn_model_props.rb', line 98 def to_jsii result = {} result.merge!({ "containers" => @containers, "enableNetworkIsolation" => @enable_network_isolation, "executionRoleArn" => @execution_role_arn, "inferenceExecutionConfig" => @inference_execution_config, "modelName" => @model_name, "primaryContainer" => @primary_container, "tags" => @tags, "vpcConfig" => @vpc_config, }) result.compact end |