Class: AWSCDK::Sagemaker::CfnInferenceExperimentProps

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

Overview

Properties for defining a CfnInferenceExperiment.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(endpoint_name:, model_variants:, name:, role_arn:, type:, data_storage_config: nil, description: nil, desired_state: nil, kms_key: nil, schedule: nil, shadow_mode_config: nil, status_reason: nil, tags: nil) ⇒ CfnInferenceExperimentProps

Returns a new instance of CfnInferenceExperimentProps.

Parameters:

  • endpoint_name (String)

    The name of the endpoint.

  • model_variants (AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnInferenceExperiment::ModelVariantConfigProperty>)

    An array of ModelVariantConfigSummary objects.

  • name (String)

    The name of the inference experiment.

  • role_arn (String)

    The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.

  • type (String)

    The type of the inference experiment.

  • data_storage_config (AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnInferenceExperiment::DataStorageConfigProperty, nil) (defaults to: nil)

    The Amazon S3 location and configuration for storing inference request and response data.

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

    The description of the inference experiment.

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

    The desired state of the experiment after stopping. The possible states are the following:.

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

    The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.

  • schedule (AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnInferenceExperiment::InferenceExperimentScheduleProperty, nil) (defaults to: nil)

    The duration for which the inference experiment ran or will run.

  • shadow_mode_config (AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnInferenceExperiment::ShadowModeConfigProperty, nil) (defaults to: nil)

    The configuration of ShadowMode inference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.

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

    The error message for the inference experiment status result.

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

    An array of key-value pairs to apply to this resource.



22
23
24
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
# File 'sagemaker/cfn_inference_experiment_props.rb', line 22

def initialize(endpoint_name:, model_variants:, name:, role_arn:, type:, data_storage_config: nil, description: nil, desired_state: nil, kms_key: nil, schedule: nil, shadow_mode_config: nil, status_reason: nil, tags: nil)
  @endpoint_name = endpoint_name
  Jsii::Type.check_type(@endpoint_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endpointName")
  @model_variants = model_variants
  Jsii::Type.check_type(@model_variants, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc2FnZW1ha2VyLkNmbkluZmVyZW5jZUV4cGVyaW1lbnQuTW9kZWxWYXJpYW50Q29uZmlnUHJvcGVydHkifV19fSwia2luZCI6ImFycmF5In19XX19")), "modelVariants")
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @role_arn = role_arn
  Jsii::Type.check_type(@role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "roleArn")
  @type = type
  Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "type")
  @data_storage_config = data_storage_config.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnInferenceExperiment::DataStorageConfigProperty.new(**data_storage_config.transform_keys(&:to_sym)) : data_storage_config
  Jsii::Type.check_type(@data_storage_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuSW5mZXJlbmNlRXhwZXJpbWVudC5EYXRhU3RvcmFnZUNvbmZpZ1Byb3BlcnR5In1dfX0=")), "dataStorageConfig") unless @data_storage_config.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @desired_state = desired_state
  Jsii::Type.check_type(@desired_state, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "desiredState") unless @desired_state.nil?
  @kms_key = kms_key
  Jsii::Type.check_type(@kms_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "kmsKey") unless @kms_key.nil?
  @schedule = schedule.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnInferenceExperiment::InferenceExperimentScheduleProperty.new(**schedule.transform_keys(&:to_sym)) : schedule
  Jsii::Type.check_type(@schedule, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuSW5mZXJlbmNlRXhwZXJpbWVudC5JbmZlcmVuY2VFeHBlcmltZW50U2NoZWR1bGVQcm9wZXJ0eSJ9XX19")), "schedule") unless @schedule.nil?
  @shadow_mode_config = shadow_mode_config.is_a?(Hash) ? ::AWSCDK::Sagemaker::CfnInferenceExperiment::ShadowModeConfigProperty.new(**shadow_mode_config.transform_keys(&:to_sym)) : shadow_mode_config
  Jsii::Type.check_type(@shadow_mode_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19zYWdlbWFrZXIuQ2ZuSW5mZXJlbmNlRXhwZXJpbWVudC5TaGFkb3dNb2RlQ29uZmlnUHJvcGVydHkifV19fQ==")), "shadowModeConfig") unless @shadow_mode_config.nil?
  @status_reason = status_reason
  Jsii::Type.check_type(@status_reason, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statusReason") unless @status_reason.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?
end

Instance Attribute Details

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

The Amazon S3 location and configuration for storing inference request and response data.



82
83
84
# File 'sagemaker/cfn_inference_experiment_props.rb', line 82

def data_storage_config
  @data_storage_config
end

#descriptionString? (readonly)

The description of the inference experiment.



87
88
89
# File 'sagemaker/cfn_inference_experiment_props.rb', line 87

def description
  @description
end

#desired_stateString? (readonly)

The desired state of the experiment after stopping. The possible states are the following:.

  • Completed : The experiment completed successfully
  • Cancelled : The experiment was canceled


95
96
97
# File 'sagemaker/cfn_inference_experiment_props.rb', line 95

def desired_state
  @desired_state
end

#endpoint_nameString (readonly)

The name of the endpoint.



55
56
57
# File 'sagemaker/cfn_inference_experiment_props.rb', line 55

def endpoint_name
  @endpoint_name
end

#kms_keyString? (readonly)

The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.



100
101
102
# File 'sagemaker/cfn_inference_experiment_props.rb', line 100

def kms_key
  @kms_key
end

#model_variantsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Sagemaker::CfnInferenceExperiment::ModelVariantConfigProperty> (readonly)

An array of ModelVariantConfigSummary objects.

There is one for each variant in the inference experiment. Each ModelVariantConfigSummary object in the array describes the infrastructure configuration for deploying the corresponding variant.



62
63
64
# File 'sagemaker/cfn_inference_experiment_props.rb', line 62

def model_variants
  @model_variants
end

#nameString (readonly)

The name of the inference experiment.



67
68
69
# File 'sagemaker/cfn_inference_experiment_props.rb', line 67

def name
  @name
end

#role_arnString (readonly)

The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.



72
73
74
# File 'sagemaker/cfn_inference_experiment_props.rb', line 72

def role_arn
  @role_arn
end

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

The duration for which the inference experiment ran or will run.

The maximum duration that you can set for an inference experiment is 30 days.



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

def schedule
  @schedule
end

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

The configuration of ShadowMode inference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.

For the shadow variant it also shows the percentage of requests that Amazon SageMaker replicates.



114
115
116
# File 'sagemaker/cfn_inference_experiment_props.rb', line 114

def shadow_mode_config
  @shadow_mode_config
end

#status_reasonString? (readonly)

The error message for the inference experiment status result.



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

def status_reason
  @status_reason
end

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

An array of key-value pairs to apply to this resource.

For more information, see Tag .



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

def tags
  @tags
end

#typeString (readonly)

The type of the inference experiment.



77
78
79
# File 'sagemaker/cfn_inference_experiment_props.rb', line 77

def type
  @type
end

Class Method Details

.jsii_propertiesObject



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'sagemaker/cfn_inference_experiment_props.rb', line 128

def self.jsii_properties
  {
    :endpoint_name => "endpointName",
    :model_variants => "modelVariants",
    :name => "name",
    :role_arn => "roleArn",
    :type => "type",
    :data_storage_config => "dataStorageConfig",
    :description => "description",
    :desired_state => "desiredState",
    :kms_key => "kmsKey",
    :schedule => "schedule",
    :shadow_mode_config => "shadowModeConfig",
    :status_reason => "statusReason",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'sagemaker/cfn_inference_experiment_props.rb', line 146

def to_jsii
  result = {}
  result.merge!({
    "endpointName" => @endpoint_name,
    "modelVariants" => @model_variants,
    "name" => @name,
    "roleArn" => @role_arn,
    "type" => @type,
    "dataStorageConfig" => @data_storage_config,
    "description" => @description,
    "desiredState" => @desired_state,
    "kmsKey" => @kms_key,
    "schedule" => @schedule,
    "shadowModeConfig" => @shadow_mode_config,
    "statusReason" => @status_reason,
    "tags" => @tags,
  })
  result.compact
end