CfnInferenceExperimentPropsMixin

class aws_cdk.mixins_preview.aws_sagemaker.mixins.CfnInferenceExperimentPropsMixin(props, *, strategy=None)

Bases: Mixin

Creates an inference experiment using the configurations specified in the request.

Use this API to setup and schedule an experiment to compare model variants on a Amazon SageMaker inference endpoint. For more information about inference experiments, see Shadow tests .

Amazon SageMaker begins your experiment at the scheduled time and routes traffic to your endpoint’s model variants based on your specified configuration.

While the experiment is in progress or after it has concluded, you can view metrics that compare your model variants. For more information, see View, monitor, and edit shadow tests .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-sagemaker-inferenceexperiment.html

CloudformationResource:

AWS::SageMaker::InferenceExperiment

Mixin:

true

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview import mixins
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

cfn_inference_experiment_props_mixin = sagemaker_mixins.CfnInferenceExperimentPropsMixin(sagemaker_mixins.CfnInferenceExperimentMixinProps(
    data_storage_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.DataStorageConfigProperty(
        content_type=sagemaker_mixins.CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty(
            csv_content_types=["csvContentTypes"],
            json_content_types=["jsonContentTypes"]
        ),
        destination="destination",
        kms_key="kmsKey"
    ),
    description="description",
    desired_state="desiredState",
    endpoint_name="endpointName",
    kms_key="kmsKey",
    model_variants=[sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelVariantConfigProperty(
        infrastructure_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty(
            infrastructure_type="infrastructureType",
            real_time_inference_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty(
                instance_count=123,
                instance_type="instanceType"
            )
        ),
        model_name="modelName",
        variant_name="variantName"
    )],
    name="name",
    role_arn="roleArn",
    schedule=sagemaker_mixins.CfnInferenceExperimentPropsMixin.InferenceExperimentScheduleProperty(
        end_time="endTime",
        start_time="startTime"
    ),
    shadow_mode_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModeConfigProperty(
        shadow_model_variants=[sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty(
            sampling_percentage=123,
            shadow_model_variant_name="shadowModelVariantName"
        )],
        source_model_variant_name="sourceModelVariantName"
    ),
    status_reason="statusReason",
    tags=[CfnTag(
        key="key",
        value="value"
    )],
    type="type"
),
    strategy=mixins.PropertyMergeStrategy.OVERRIDE
)

Create a mixin to apply properties to AWS::SageMaker::InferenceExperiment.

Parameters:

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

IConstruct

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['dataStorageConfig', 'description', 'desiredState', 'endpointName', 'kmsKey', 'modelVariants', 'name', 'roleArn', 'schedule', 'shadowModeConfig', 'statusReason', 'tags', 'type']

Static Methods

classmethod is_mixin(x)

(experimental) Checks if x is a Mixin.

Parameters:

x (Any) – Any object.

Return type:

bool

Returns:

true if x is an object created from a class which extends Mixin.

Stability:

experimental

CaptureContentTypeHeaderProperty

class CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty(*, csv_content_types=None, json_content_types=None)

Bases: object

Configuration specifying how to treat different headers.

If no headers are specified Amazon SageMaker AI will by default base64 encode when capturing the data.

Parameters:
  • csv_content_types (Optional[Sequence[str]]) – The list of all content type headers that Amazon SageMaker AI will treat as CSV and capture accordingly.

  • json_content_types (Optional[Sequence[str]]) – The list of all content type headers that SageMaker AI will treat as JSON and capture accordingly.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-capturecontenttypeheader.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

capture_content_type_header_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty(
    csv_content_types=["csvContentTypes"],
    json_content_types=["jsonContentTypes"]
)

Attributes

csv_content_types

The list of all content type headers that Amazon SageMaker AI will treat as CSV and capture accordingly.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-capturecontenttypeheader.html#cfn-sagemaker-inferenceexperiment-capturecontenttypeheader-csvcontenttypes

json_content_types

The list of all content type headers that SageMaker AI will treat as JSON and capture accordingly.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-capturecontenttypeheader.html#cfn-sagemaker-inferenceexperiment-capturecontenttypeheader-jsoncontenttypes

DataStorageConfigProperty

class CfnInferenceExperimentPropsMixin.DataStorageConfigProperty(*, content_type=None, destination=None, kms_key=None)

Bases: object

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

This is an optional parameter that you can use for data capture. For more information, see Capture data .

Parameters:
  • content_type (Union[IResolvable, CaptureContentTypeHeaderProperty, Dict[str, Any], None]) – Configuration specifying how to treat different headers. If no headers are specified SageMaker will by default base64 encode when capturing the data.

  • destination (Optional[str]) – The Amazon S3 bucket where the inference request and response data is stored.

  • kms_key (Optional[str]) – The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-datastorageconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

data_storage_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.DataStorageConfigProperty(
    content_type=sagemaker_mixins.CfnInferenceExperimentPropsMixin.CaptureContentTypeHeaderProperty(
        csv_content_types=["csvContentTypes"],
        json_content_types=["jsonContentTypes"]
    ),
    destination="destination",
    kms_key="kmsKey"
)

Attributes

content_type

Configuration specifying how to treat different headers.

If no headers are specified SageMaker will by default base64 encode when capturing the data.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-datastorageconfig.html#cfn-sagemaker-inferenceexperiment-datastorageconfig-contenttype

destination

The Amazon S3 bucket where the inference request and response data is stored.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-datastorageconfig.html#cfn-sagemaker-inferenceexperiment-datastorageconfig-destination

kms_key

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

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-datastorageconfig.html#cfn-sagemaker-inferenceexperiment-datastorageconfig-kmskey

EndpointMetadataProperty

class CfnInferenceExperimentPropsMixin.EndpointMetadataProperty(*, endpoint_config_name=None, endpoint_name=None, endpoint_status=None)

Bases: object

The metadata of the endpoint.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-endpointmetadata.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

endpoint_metadata_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.EndpointMetadataProperty(
    endpoint_config_name="endpointConfigName",
    endpoint_name="endpointName",
    endpoint_status="endpointStatus"
)

Attributes

endpoint_config_name

The name of the endpoint configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-endpointmetadata.html#cfn-sagemaker-inferenceexperiment-endpointmetadata-endpointconfigname

endpoint_name

The name of the endpoint.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-endpointmetadata.html#cfn-sagemaker-inferenceexperiment-endpointmetadata-endpointname

endpoint_status

The status of the endpoint.

For possible values of the status of an endpoint, see ` <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-endpointmetadata.html#cfn-sagemaker-inferenceexperiment-endpointmetadata-endpointstatus>`_ .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-endpointmetadata.html#cfn-sagemaker-inferenceexperiment-endpointmetadata-endpointstatus

InferenceExperimentScheduleProperty

class CfnInferenceExperimentPropsMixin.InferenceExperimentScheduleProperty(*, end_time=None, start_time=None)

Bases: object

The start and end times of an inference experiment.

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

Parameters:
  • end_time (Optional[str]) – The timestamp at which the inference experiment ended or will end.

  • start_time (Optional[str]) – The timestamp at which the inference experiment started or will start.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-inferenceexperimentschedule.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

inference_experiment_schedule_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.InferenceExperimentScheduleProperty(
    end_time="endTime",
    start_time="startTime"
)

Attributes

end_time

The timestamp at which the inference experiment ended or will end.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-inferenceexperimentschedule.html#cfn-sagemaker-inferenceexperiment-inferenceexperimentschedule-endtime

start_time

The timestamp at which the inference experiment started or will start.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-inferenceexperimentschedule.html#cfn-sagemaker-inferenceexperiment-inferenceexperimentschedule-starttime

ModelInfrastructureConfigProperty

class CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty(*, infrastructure_type=None, real_time_inference_config=None)

Bases: object

The configuration for the infrastructure that the model will be deployed to.

Parameters:
  • infrastructure_type (Optional[str]) – The inference option to which to deploy your model. Possible values are the following:. - RealTime : Deploy to real-time inference.

  • real_time_inference_config (Union[IResolvable, RealTimeInferenceConfigProperty, Dict[str, Any], None]) – The infrastructure configuration for deploying the model to real-time inference.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-modelinfrastructureconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

model_infrastructure_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty(
    infrastructure_type="infrastructureType",
    real_time_inference_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty(
        instance_count=123,
        instance_type="instanceType"
    )
)

Attributes

infrastructure_type

.

  • RealTime : Deploy to real-time inference.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-modelinfrastructureconfig.html#cfn-sagemaker-inferenceexperiment-modelinfrastructureconfig-infrastructuretype

Type:

The inference option to which to deploy your model. Possible values are the following

real_time_inference_config

The infrastructure configuration for deploying the model to real-time inference.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-modelinfrastructureconfig.html#cfn-sagemaker-inferenceexperiment-modelinfrastructureconfig-realtimeinferenceconfig

ModelVariantConfigProperty

class CfnInferenceExperimentPropsMixin.ModelVariantConfigProperty(*, infrastructure_config=None, model_name=None, variant_name=None)

Bases: object

Contains information about the deployment options of a model.

Parameters:
  • infrastructure_config (Union[IResolvable, ModelInfrastructureConfigProperty, Dict[str, Any], None]) – The configuration for the infrastructure that the model will be deployed to.

  • model_name (Optional[str]) – The name of the Amazon SageMaker Model entity.

  • variant_name (Optional[str]) – The name of the variant.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-modelvariantconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

model_variant_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelVariantConfigProperty(
    infrastructure_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.ModelInfrastructureConfigProperty(
        infrastructure_type="infrastructureType",
        real_time_inference_config=sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty(
            instance_count=123,
            instance_type="instanceType"
        )
    ),
    model_name="modelName",
    variant_name="variantName"
)

Attributes

infrastructure_config

The configuration for the infrastructure that the model will be deployed to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-modelvariantconfig.html#cfn-sagemaker-inferenceexperiment-modelvariantconfig-infrastructureconfig

model_name

The name of the Amazon SageMaker Model entity.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-modelvariantconfig.html#cfn-sagemaker-inferenceexperiment-modelvariantconfig-modelname

variant_name

The name of the variant.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-modelvariantconfig.html#cfn-sagemaker-inferenceexperiment-modelvariantconfig-variantname

RealTimeInferenceConfigProperty

class CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty(*, instance_count=None, instance_type=None)

Bases: object

The infrastructure configuration for deploying the model to a real-time inference endpoint.

Parameters:
  • instance_count (Union[int, float, None]) – The number of instances of the type specified by InstanceType .

  • instance_type (Optional[str]) – The instance type the model is deployed to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-realtimeinferenceconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

real_time_inference_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.RealTimeInferenceConfigProperty(
    instance_count=123,
    instance_type="instanceType"
)

Attributes

instance_count

The number of instances of the type specified by InstanceType .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-realtimeinferenceconfig.html#cfn-sagemaker-inferenceexperiment-realtimeinferenceconfig-instancecount

instance_type

The instance type the model is deployed to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-realtimeinferenceconfig.html#cfn-sagemaker-inferenceexperiment-realtimeinferenceconfig-instancetype

ShadowModeConfigProperty

class CfnInferenceExperimentPropsMixin.ShadowModeConfigProperty(*, shadow_model_variants=None, source_model_variant_name=None)

Bases: object

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

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

Parameters:
  • shadow_model_variants (Union[IResolvable, Sequence[Union[IResolvable, ShadowModelVariantConfigProperty, Dict[str, Any]]], None]) – List of shadow variant configurations.

  • source_model_variant_name (Optional[str]) – The name of the production variant, which takes all the inference requests.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-shadowmodeconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

shadow_mode_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModeConfigProperty(
    shadow_model_variants=[sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty(
        sampling_percentage=123,
        shadow_model_variant_name="shadowModelVariantName"
    )],
    source_model_variant_name="sourceModelVariantName"
)

Attributes

shadow_model_variants

List of shadow variant configurations.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-shadowmodeconfig.html#cfn-sagemaker-inferenceexperiment-shadowmodeconfig-shadowmodelvariants

source_model_variant_name

The name of the production variant, which takes all the inference requests.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-shadowmodeconfig.html#cfn-sagemaker-inferenceexperiment-shadowmodeconfig-sourcemodelvariantname

ShadowModelVariantConfigProperty

class CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty(*, sampling_percentage=None, shadow_model_variant_name=None)

Bases: object

The name and sampling percentage of a shadow variant.

Parameters:
  • sampling_percentage (Union[int, float, None]) – The percentage of inference requests that Amazon SageMaker replicates from the production variant to the shadow variant.

  • shadow_model_variant_name (Optional[str]) – The name of the shadow variant.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-shadowmodelvariantconfig.html

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk.mixins_preview.aws_sagemaker import mixins as sagemaker_mixins

shadow_model_variant_config_property = sagemaker_mixins.CfnInferenceExperimentPropsMixin.ShadowModelVariantConfigProperty(
    sampling_percentage=123,
    shadow_model_variant_name="shadowModelVariantName"
)

Attributes

sampling_percentage

The percentage of inference requests that Amazon SageMaker replicates from the production variant to the shadow variant.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-shadowmodelvariantconfig.html#cfn-sagemaker-inferenceexperiment-shadowmodelvariantconfig-samplingpercentage

shadow_model_variant_name

The name of the shadow variant.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-inferenceexperiment-shadowmodelvariantconfig.html#cfn-sagemaker-inferenceexperiment-shadowmodelvariantconfig-shadowmodelvariantname