CfnEndpointConfigPropsMixin

class aws_cdk.cfn_property_mixins.aws_sagemaker.CfnEndpointConfigPropsMixin(props, *, strategy=None)

Bases: Mixin

The AWS::SageMaker::EndpointConfig resource creates a configuration for an Amazon SageMaker endpoint.

For more information, see CreateEndpointConfig in the SageMaker Developer Guide .

See:

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

CloudformationResource:

AWS::SageMaker::EndpointConfig

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.cfn_property_mixins import aws_sagemaker as sagemaker
import aws_cdk as cdk

# merge_strategy: cdk.IMergeStrategy

cfn_endpoint_config_props_mixin = sagemaker.CfnEndpointConfigPropsMixin(sagemaker.CfnEndpointConfigMixinProps(
    async_inference_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceConfigProperty(
        client_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceClientConfigProperty(
            max_concurrent_invocations_per_instance=123
        ),
        output_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceOutputConfigProperty(
            kms_key_id="kmsKeyId",
            notification_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceNotificationConfigProperty(
                error_topic="errorTopic",
                include_inference_response_in=["includeInferenceResponseIn"],
                success_topic="successTopic"
            ),
            s3_failure_path="s3FailurePath",
            s3_output_path="s3OutputPath"
        )
    ),
    data_capture_config=sagemaker.CfnEndpointConfigPropsMixin.DataCaptureConfigProperty(
        capture_content_type_header=sagemaker.CfnEndpointConfigPropsMixin.CaptureContentTypeHeaderProperty(
            csv_content_types=["csvContentTypes"],
            json_content_types=["jsonContentTypes"]
        ),
        capture_options=[sagemaker.CfnEndpointConfigPropsMixin.CaptureOptionProperty(
            capture_mode="captureMode"
        )],
        destination_s3_uri="destinationS3Uri",
        enable_capture=False,
        initial_sampling_percentage=123,
        kms_key_id="kmsKeyId"
    ),
    enable_network_isolation=False,
    endpoint_config_name="endpointConfigName",
    execution_role_arn="executionRoleArn",
    explainer_config=sagemaker.CfnEndpointConfigPropsMixin.ExplainerConfigProperty(
        clarify_explainer_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyExplainerConfigProperty(
            enable_explanations="enableExplanations",
            inference_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyInferenceConfigProperty(
                content_template="contentTemplate",
                feature_headers=["featureHeaders"],
                features_attribute="featuresAttribute",
                feature_types=["featureTypes"],
                label_attribute="labelAttribute",
                label_headers=["labelHeaders"],
                label_index=123,
                max_payload_in_mb=123,
                max_record_count=123,
                probability_attribute="probabilityAttribute",
                probability_index=123
            ),
            shap_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapConfigProperty(
                number_of_samples=123,
                seed=123,
                shap_baseline_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapBaselineConfigProperty(
                    mime_type="mimeType",
                    shap_baseline="shapBaseline",
                    shap_baseline_uri="shapBaselineUri"
                ),
                text_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyTextConfigProperty(
                    granularity="granularity",
                    language="language"
                ),
                use_logit=False
            )
        )
    ),
    kms_key_id="kmsKeyId",
    metrics_config=sagemaker.CfnEndpointConfigPropsMixin.MetricsConfigProperty(
        enable_detailed_observability=False,
        enable_enhanced_metrics=False,
        metric_publish_frequency_in_seconds=123
    ),
    production_variants=[sagemaker.CfnEndpointConfigPropsMixin.ProductionVariantProperty(
        accelerator_type="acceleratorType",
        capacity_reservation_config=sagemaker.CfnEndpointConfigPropsMixin.CapacityReservationConfigProperty(
            capacity_reservation_preference="capacityReservationPreference",
            ml_reservation_arn="mlReservationArn"
        ),
        container_startup_health_check_timeout_in_seconds=123,
        core_dump_config=sagemaker.CfnEndpointConfigPropsMixin.CoreDumpConfigProperty(
            destination_s3_uri="destinationS3Uri",
            kms_key_id="kmsKeyId"
        ),
        enable_ssm_access=False,
        inference_ami_version="inferenceAmiVersion",
        initial_instance_count=123,
        initial_variant_weight=123,
        instance_pools=[sagemaker.CfnEndpointConfigPropsMixin.InstancePoolProperty(
            instance_type="instanceType",
            model_name_override="modelNameOverride",
            priority=123
        )],
        instance_type="instanceType",
        managed_instance_scaling=sagemaker.CfnEndpointConfigPropsMixin.ManagedInstanceScalingProperty(
            max_instance_count=123,
            min_instance_count=123,
            scale_in_policy=sagemaker.CfnEndpointConfigPropsMixin.ScaleInPolicyProperty(
                cooldown_in_minutes=123,
                maximum_step_size=123,
                strategy="strategy"
            ),
            status="status"
        ),
        model_data_download_timeout_in_seconds=123,
        model_name="modelName",
        routing_config=sagemaker.CfnEndpointConfigPropsMixin.RoutingConfigProperty(
            prefix_aware_routing_config=sagemaker.CfnEndpointConfigPropsMixin.PrefixAwareRoutingConfigProperty(
                concurrency_threshold=123,
                prefix_length=123
            ),
            routing_strategy="routingStrategy"
        ),
        serverless_config=sagemaker.CfnEndpointConfigPropsMixin.ServerlessConfigProperty(
            max_concurrency=123,
            memory_size_in_mb=123,
            provisioned_concurrency=123
        ),
        variant_instance_provision_timeout_in_seconds=123,
        variant_name="variantName",
        volume_size_in_gb=123
    )],
    shadow_production_variants=[sagemaker.CfnEndpointConfigPropsMixin.ProductionVariantProperty(
        accelerator_type="acceleratorType",
        capacity_reservation_config=sagemaker.CfnEndpointConfigPropsMixin.CapacityReservationConfigProperty(
            capacity_reservation_preference="capacityReservationPreference",
            ml_reservation_arn="mlReservationArn"
        ),
        container_startup_health_check_timeout_in_seconds=123,
        core_dump_config=sagemaker.CfnEndpointConfigPropsMixin.CoreDumpConfigProperty(
            destination_s3_uri="destinationS3Uri",
            kms_key_id="kmsKeyId"
        ),
        enable_ssm_access=False,
        inference_ami_version="inferenceAmiVersion",
        initial_instance_count=123,
        initial_variant_weight=123,
        instance_pools=[sagemaker.CfnEndpointConfigPropsMixin.InstancePoolProperty(
            instance_type="instanceType",
            model_name_override="modelNameOverride",
            priority=123
        )],
        instance_type="instanceType",
        managed_instance_scaling=sagemaker.CfnEndpointConfigPropsMixin.ManagedInstanceScalingProperty(
            max_instance_count=123,
            min_instance_count=123,
            scale_in_policy=sagemaker.CfnEndpointConfigPropsMixin.ScaleInPolicyProperty(
                cooldown_in_minutes=123,
                maximum_step_size=123,
                strategy="strategy"
            ),
            status="status"
        ),
        model_data_download_timeout_in_seconds=123,
        model_name="modelName",
        routing_config=sagemaker.CfnEndpointConfigPropsMixin.RoutingConfigProperty(
            prefix_aware_routing_config=sagemaker.CfnEndpointConfigPropsMixin.PrefixAwareRoutingConfigProperty(
                concurrency_threshold=123,
                prefix_length=123
            ),
            routing_strategy="routingStrategy"
        ),
        serverless_config=sagemaker.CfnEndpointConfigPropsMixin.ServerlessConfigProperty(
            max_concurrency=123,
            memory_size_in_mb=123,
            provisioned_concurrency=123
        ),
        variant_instance_provision_timeout_in_seconds=123,
        variant_name="variantName",
        volume_size_in_gb=123
    )],
    tags=[cdk.CfnTag(
        key="key",
        value="value"
    )],
    vpc_config=sagemaker.CfnEndpointConfigPropsMixin.VpcConfigProperty(
        security_group_ids=["securityGroupIds"],
        subnets=["subnets"]
    )
),
    strategy=merge_strategy
)

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

Parameters:
  • props (Union[CfnEndpointConfigMixinProps, Dict[str, Any]]) – L1 properties to apply.

  • strategy (Optional[IMergeStrategy]) – Strategy for merging nested properties. Default: - PropertyMergeStrategy.combine()

Methods

apply_to(construct)

Apply the mixin properties to the construct.

Parameters:

construct (IConstruct)

Return type:

None

supports(construct)

Check if this mixin supports the given construct.

Parameters:

construct (IConstruct)

Return type:

bool

Attributes

CFN_PROPERTY_KEYS = ['asyncInferenceConfig', 'dataCaptureConfig', 'enableNetworkIsolation', 'endpointConfigName', 'executionRoleArn', 'explainerConfig', 'kmsKeyId', 'metricsConfig', 'productionVariants', 'shadowProductionVariants', 'tags', 'vpcConfig']

Static Methods

classmethod is_mixin(x)

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.

AsyncInferenceClientConfigProperty

class CfnEndpointConfigPropsMixin.AsyncInferenceClientConfigProperty(*, max_concurrent_invocations_per_instance=None)

Bases: object

Configures the behavior of the client used by SageMaker to interact with the model container during asynchronous inference.

Parameters:

max_concurrent_invocations_per_instance (Union[int, float, None]) – The maximum number of concurrent requests sent by the SageMaker client to the model container. If no value is provided, SageMaker will choose an optimal value for you.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceclientconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

async_inference_client_config_property = sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceClientConfigProperty(
    max_concurrent_invocations_per_instance=123
)

Attributes

max_concurrent_invocations_per_instance

The maximum number of concurrent requests sent by the SageMaker client to the model container.

If no value is provided, SageMaker will choose an optimal value for you.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceclientconfig.html#cfn-sagemaker-endpointconfig-asyncinferenceclientconfig-maxconcurrentinvocationsperinstance

AsyncInferenceConfigProperty

class CfnEndpointConfigPropsMixin.AsyncInferenceConfigProperty(*, client_config=None, output_config=None)

Bases: object

Specifies configuration for how an endpoint performs asynchronous inference.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

async_inference_config_property = sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceConfigProperty(
    client_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceClientConfigProperty(
        max_concurrent_invocations_per_instance=123
    ),
    output_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceOutputConfigProperty(
        kms_key_id="kmsKeyId",
        notification_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceNotificationConfigProperty(
            error_topic="errorTopic",
            include_inference_response_in=["includeInferenceResponseIn"],
            success_topic="successTopic"
        ),
        s3_failure_path="s3FailurePath",
        s3_output_path="s3OutputPath"
    )
)

Attributes

client_config

Configures the behavior of the client used by SageMaker to interact with the model container during asynchronous inference.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceconfig.html#cfn-sagemaker-endpointconfig-asyncinferenceconfig-clientconfig

output_config

Specifies the configuration for asynchronous inference invocation outputs.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceconfig.html#cfn-sagemaker-endpointconfig-asyncinferenceconfig-outputconfig

AsyncInferenceNotificationConfigProperty

class CfnEndpointConfigPropsMixin.AsyncInferenceNotificationConfigProperty(*, error_topic=None, include_inference_response_in=None, success_topic=None)

Bases: object

Specifies the configuration for notifications of inference results for asynchronous inference.

Parameters:
  • error_topic (Optional[str]) – Amazon SNS topic to post a notification to when an inference fails. If no topic is provided, no notification is sent on failure.

  • include_inference_response_in (Optional[Sequence[str]]) – The Amazon SNS topics where you want the inference response to be included. .. epigraph:: The inference response is included only if the response size is less than or equal to 128 KB.

  • success_topic (Optional[str]) – Amazon SNS topic to post a notification to when an inference completes successfully. If no topic is provided, no notification is sent on success.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferencenotificationconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

async_inference_notification_config_property = sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceNotificationConfigProperty(
    error_topic="errorTopic",
    include_inference_response_in=["includeInferenceResponseIn"],
    success_topic="successTopic"
)

Attributes

error_topic

Amazon SNS topic to post a notification to when an inference fails.

If no topic is provided, no notification is sent on failure.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferencenotificationconfig.html#cfn-sagemaker-endpointconfig-asyncinferencenotificationconfig-errortopic

include_inference_response_in

The Amazon SNS topics where you want the inference response to be included.

The inference response is included only if the response size is less than or equal to 128 KB.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferencenotificationconfig.html#cfn-sagemaker-endpointconfig-asyncinferencenotificationconfig-includeinferenceresponsein

success_topic

Amazon SNS topic to post a notification to when an inference completes successfully.

If no topic is provided, no notification is sent on success.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferencenotificationconfig.html#cfn-sagemaker-endpointconfig-asyncinferencenotificationconfig-successtopic

AsyncInferenceOutputConfigProperty

class CfnEndpointConfigPropsMixin.AsyncInferenceOutputConfigProperty(*, kms_key_id=None, notification_config=None, s3_failure_path=None, s3_output_path=None)

Bases: object

Specifies the configuration for asynchronous inference invocation outputs.

Parameters:
  • kms_key_id (Optional[str]) – The AWS Key Management Service ( AWS KMS) key that Amazon SageMaker uses to encrypt the asynchronous inference output in Amazon S3.

  • notification_config (Union[IResolvable, AsyncInferenceNotificationConfigProperty, Dict[str, Any], None]) – Specifies the configuration for notifications of inference results for asynchronous inference.

  • s3_failure_path (Optional[str]) – The Amazon S3 location to upload failure inference responses to.

  • s3_output_path (Optional[str]) – The Amazon S3 location to upload inference responses to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceoutputconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

async_inference_output_config_property = sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceOutputConfigProperty(
    kms_key_id="kmsKeyId",
    notification_config=sagemaker.CfnEndpointConfigPropsMixin.AsyncInferenceNotificationConfigProperty(
        error_topic="errorTopic",
        include_inference_response_in=["includeInferenceResponseIn"],
        success_topic="successTopic"
    ),
    s3_failure_path="s3FailurePath",
    s3_output_path="s3OutputPath"
)

Attributes

kms_key_id

The AWS Key Management Service ( AWS KMS) key that Amazon SageMaker uses to encrypt the asynchronous inference output in Amazon S3.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceoutputconfig.html#cfn-sagemaker-endpointconfig-asyncinferenceoutputconfig-kmskeyid

notification_config

Specifies the configuration for notifications of inference results for asynchronous inference.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceoutputconfig.html#cfn-sagemaker-endpointconfig-asyncinferenceoutputconfig-notificationconfig

s3_failure_path

The Amazon S3 location to upload failure inference responses to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceoutputconfig.html#cfn-sagemaker-endpointconfig-asyncinferenceoutputconfig-s3failurepath

s3_output_path

The Amazon S3 location to upload inference responses to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-asyncinferenceoutputconfig.html#cfn-sagemaker-endpointconfig-asyncinferenceoutputconfig-s3outputpath

CapacityReservationConfigProperty

class CfnEndpointConfigPropsMixin.CapacityReservationConfigProperty(*, capacity_reservation_preference=None, ml_reservation_arn=None)

Bases: object

Settings for the capacity reservation for the compute instances that SageMaker AI reserves for an endpoint.

Parameters:
  • capacity_reservation_preference (Optional[str]) – Options that you can choose for the capacity reservation.

  • ml_reservation_arn (Optional[str]) – The Amazon Resource Name (ARN) that uniquely identifies the ML capacity reservation that SageMaker AI applies when it deploys the endpoint.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-capacityreservationconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

capacity_reservation_config_property = sagemaker.CfnEndpointConfigPropsMixin.CapacityReservationConfigProperty(
    capacity_reservation_preference="capacityReservationPreference",
    ml_reservation_arn="mlReservationArn"
)

Attributes

capacity_reservation_preference

Options that you can choose for the capacity reservation.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-capacityreservationconfig.html#cfn-sagemaker-endpointconfig-capacityreservationconfig-capacityreservationpreference

ml_reservation_arn

The Amazon Resource Name (ARN) that uniquely identifies the ML capacity reservation that SageMaker AI applies when it deploys the endpoint.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-capacityreservationconfig.html#cfn-sagemaker-endpointconfig-capacityreservationconfig-mlreservationarn

CaptureContentTypeHeaderProperty

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

Bases: object

Specifies the JSON and CSV content types of the data that the endpoint captures.

Parameters:
  • csv_content_types (Optional[Sequence[str]]) – A list of the CSV content types of the data that the endpoint captures. For the endpoint to capture the data, you must also specify the content type when you invoke the endpoint.

  • json_content_types (Optional[Sequence[str]]) – A list of the JSON content types of the data that the endpoint captures. For the endpoint to capture the data, you must also specify the content type when you invoke the endpoint.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-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.cfn_property_mixins import aws_sagemaker as sagemaker

capture_content_type_header_property = sagemaker.CfnEndpointConfigPropsMixin.CaptureContentTypeHeaderProperty(
    csv_content_types=["csvContentTypes"],
    json_content_types=["jsonContentTypes"]
)

Attributes

csv_content_types

A list of the CSV content types of the data that the endpoint captures.

For the endpoint to capture the data, you must also specify the content type when you invoke the endpoint.

See:

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

json_content_types

A list of the JSON content types of the data that the endpoint captures.

For the endpoint to capture the data, you must also specify the content type when you invoke the endpoint.

See:

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

CaptureOptionProperty

class CfnEndpointConfigPropsMixin.CaptureOptionProperty(*, capture_mode=None)

Bases: object

Specifies whether the endpoint captures input data or output data.

Parameters:

capture_mode (Optional[str]) – Specifies whether the endpoint captures input data or output data.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-captureoption.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.cfn_property_mixins import aws_sagemaker as sagemaker

capture_option_property = sagemaker.CfnEndpointConfigPropsMixin.CaptureOptionProperty(
    capture_mode="captureMode"
)

Attributes

capture_mode

Specifies whether the endpoint captures input data or output data.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-captureoption.html#cfn-sagemaker-endpointconfig-captureoption-capturemode

ClarifyExplainerConfigProperty

class CfnEndpointConfigPropsMixin.ClarifyExplainerConfigProperty(*, enable_explanations=None, inference_config=None, shap_config=None)

Bases: object

The configuration parameters for the SageMaker Clarify explainer.

Parameters:
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyexplainerconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

clarify_explainer_config_property = sagemaker.CfnEndpointConfigPropsMixin.ClarifyExplainerConfigProperty(
    enable_explanations="enableExplanations",
    inference_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyInferenceConfigProperty(
        content_template="contentTemplate",
        feature_headers=["featureHeaders"],
        features_attribute="featuresAttribute",
        feature_types=["featureTypes"],
        label_attribute="labelAttribute",
        label_headers=["labelHeaders"],
        label_index=123,
        max_payload_in_mb=123,
        max_record_count=123,
        probability_attribute="probabilityAttribute",
        probability_index=123
    ),
    shap_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapConfigProperty(
        number_of_samples=123,
        seed=123,
        shap_baseline_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapBaselineConfigProperty(
            mime_type="mimeType",
            shap_baseline="shapBaseline",
            shap_baseline_uri="shapBaselineUri"
        ),
        text_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyTextConfigProperty(
            granularity="granularity",
            language="language"
        ),
        use_logit=False
    )
)

Attributes

enable_explanations

A JMESPath boolean expression used to filter which records to explain.

Explanations are activated by default. See `EnableExplanations <https://docs.aws.amazon.com/sagemaker/latest/dg/clarify-online-explainability-create-endpoint.html#clarify-online-explainability-create-endpoint-enable>`_ for additional information.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyexplainerconfig.html#cfn-sagemaker-endpointconfig-clarifyexplainerconfig-enableexplanations

inference_config

The inference configuration parameter for the model container.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyexplainerconfig.html#cfn-sagemaker-endpointconfig-clarifyexplainerconfig-inferenceconfig

shap_config

The configuration for SHAP analysis.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyexplainerconfig.html#cfn-sagemaker-endpointconfig-clarifyexplainerconfig-shapconfig

ClarifyInferenceConfigProperty

class CfnEndpointConfigPropsMixin.ClarifyInferenceConfigProperty(*, content_template=None, feature_headers=None, features_attribute=None, feature_types=None, label_attribute=None, label_headers=None, label_index=None, max_payload_in_mb=None, max_record_count=None, probability_attribute=None, probability_index=None)

Bases: object

The inference configuration parameter for the model container.

Parameters:
  • content_template (Optional[str]) – A template string used to format a JSON record into an acceptable model container input. For example, a ContentTemplate string '{"myfeatures":$features}' will format a list of features [1,2,3] into the record string '{"myfeatures":[1,2,3]}' . Required only when the model container input is in JSON Lines format.

  • feature_headers (Optional[Sequence[str]]) – The names of the features. If provided, these are included in the endpoint response payload to help readability of the InvokeEndpoint output. See the Response section under Invoke the endpoint in the Developer Guide for more information.

  • features_attribute (Optional[str]) – Provides the JMESPath expression to extract the features from a model container input in JSON Lines format. For example, if FeaturesAttribute is the JMESPath expression 'myfeatures' , it extracts a list of features [1,2,3] from request data '{"myfeatures":[1,2,3]}' .

  • feature_types (Optional[Sequence[str]]) –

    A list of data types of the features (optional). Applicable only to NLP explainability. If provided, FeatureTypes must have at least one 'text' string (for example, ['text'] ). If FeatureTypes is not provided, the explainer infers the feature types based on the baseline data. The feature types are included in the endpoint response payload. For additional information see the response section under Invoke the endpoint in the Developer Guide for more information.

  • label_attribute (Optional[str]) – A JMESPath expression used to locate the list of label headers in the model container output. Example : If the model container output of a batch request is '{"labels":["cat","dog","fish"],"probability":[0.6,0.3,0.1]}' , then set LabelAttribute to 'labels' to extract the list of label headers ["cat","dog","fish"]

  • label_headers (Optional[Sequence[str]]) –

    For multiclass classification problems, the label headers are the names of the classes. Otherwise, the label header is the name of the predicted label. These are used to help readability for the output of the InvokeEndpoint API. See the response section under Invoke the endpoint in the Developer Guide for more information. If there are no label headers in the model container output, provide them manually using this parameter.

  • label_index (Union[int, float, None]) – A zero-based index used to extract a label header or list of label headers from model container output in CSV format. Example for a multiclass model: If the model container output consists of label headers followed by probabilities: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"' , set LabelIndex to 0 to select the label headers ['cat','dog','fish'] .

  • max_payload_in_mb (Union[int, float, None]) – The maximum payload size (MB) allowed of a request from the explainer to the model container. Defaults to 6 MB.

  • max_record_count (Union[int, float, None]) – The maximum number of records in a request that the model container can process when querying the model container for the predictions of a synthetic dataset . A record is a unit of input data that inference can be made on, for example, a single line in CSV data. If MaxRecordCount is 1 , the model container expects one record per request. A value of 2 or greater means that the model expects batch requests, which can reduce overhead and speed up the inferencing process. If this parameter is not provided, the explainer will tune the record count per request according to the model container’s capacity at runtime.

  • probability_attribute (Optional[str]) – A JMESPath expression used to extract the probability (or score) from the model container output if the model container is in JSON Lines format. Example : If the model container output of a single request is '{"predicted_label":1,"probability":0.6}' , then set ProbabilityAttribute to 'probability' .

  • probability_index (Union[int, float, None]) – A zero-based index used to extract a probability value (score) or list from model container output in CSV format. If this value is not provided, the entire model container output will be treated as a probability value (score) or list. Example for a single class model: If the model container output consists of a string-formatted prediction label followed by its probability: '1,0.6' , set ProbabilityIndex to 1 to select the probability value 0.6 . Example for a multiclass model: If the model container output consists of a string-formatted prediction label followed by its probability: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"' , set ProbabilityIndex to 1 to select the probability values [0.1,0.6,0.3] .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

clarify_inference_config_property = sagemaker.CfnEndpointConfigPropsMixin.ClarifyInferenceConfigProperty(
    content_template="contentTemplate",
    feature_headers=["featureHeaders"],
    features_attribute="featuresAttribute",
    feature_types=["featureTypes"],
    label_attribute="labelAttribute",
    label_headers=["labelHeaders"],
    label_index=123,
    max_payload_in_mb=123,
    max_record_count=123,
    probability_attribute="probabilityAttribute",
    probability_index=123
)

Attributes

content_template

A template string used to format a JSON record into an acceptable model container input.

For example, a ContentTemplate string '{"myfeatures":$features}' will format a list of features [1,2,3] into the record string '{"myfeatures":[1,2,3]}' . Required only when the model container input is in JSON Lines format.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-contenttemplate

feature_headers

The names of the features.

If provided, these are included in the endpoint response payload to help readability of the InvokeEndpoint output. See the Response section under Invoke the endpoint in the Developer Guide for more information.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-featureheaders

feature_types

A list of data types of the features (optional).

Applicable only to NLP explainability. If provided, FeatureTypes must have at least one 'text' string (for example, ['text'] ). If FeatureTypes is not provided, the explainer infers the feature types based on the baseline data. The feature types are included in the endpoint response payload. For additional information see the response section under Invoke the endpoint in the Developer Guide for more information.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-featuretypes

features_attribute

Provides the JMESPath expression to extract the features from a model container input in JSON Lines format.

For example, if FeaturesAttribute is the JMESPath expression 'myfeatures' , it extracts a list of features [1,2,3] from request data '{"myfeatures":[1,2,3]}' .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-featuresattribute

label_attribute

A JMESPath expression used to locate the list of label headers in the model container output.

Example : If the model container output of a batch request is '{"labels":["cat","dog","fish"],"probability":[0.6,0.3,0.1]}' , then set LabelAttribute to 'labels' to extract the list of label headers ["cat","dog","fish"]

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-labelattribute

label_headers

For multiclass classification problems, the label headers are the names of the classes.

Otherwise, the label header is the name of the predicted label. These are used to help readability for the output of the InvokeEndpoint API. See the response section under Invoke the endpoint in the Developer Guide for more information. If there are no label headers in the model container output, provide them manually using this parameter.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-labelheaders

label_index

A zero-based index used to extract a label header or list of label headers from model container output in CSV format.

Example for a multiclass model: If the model container output consists of label headers followed by probabilities: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"' , set LabelIndex to 0 to select the label headers ['cat','dog','fish'] .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-labelindex

max_payload_in_mb

The maximum payload size (MB) allowed of a request from the explainer to the model container.

Defaults to 6 MB.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-maxpayloadinmb

max_record_count

The maximum number of records in a request that the model container can process when querying the model container for the predictions of a synthetic dataset . A record is a unit of input data that inference can be made on, for example, a single line in CSV data. If MaxRecordCount is 1 , the model container expects one record per request. A value of 2 or greater means that the model expects batch requests, which can reduce overhead and speed up the inferencing process. If this parameter is not provided, the explainer will tune the record count per request according to the model container’s capacity at runtime.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-maxrecordcount

probability_attribute

A JMESPath expression used to extract the probability (or score) from the model container output if the model container is in JSON Lines format.

Example : If the model container output of a single request is '{"predicted_label":1,"probability":0.6}' , then set ProbabilityAttribute to 'probability' .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-probabilityattribute

probability_index

A zero-based index used to extract a probability value (score) or list from model container output in CSV format.

If this value is not provided, the entire model container output will be treated as a probability value (score) or list.

Example for a single class model: If the model container output consists of a string-formatted prediction label followed by its probability: '1,0.6' , set ProbabilityIndex to 1 to select the probability value 0.6 .

Example for a multiclass model: If the model container output consists of a string-formatted prediction label followed by its probability: '"[\'cat\',\'dog\',\'fish\']","[0.1,0.6,0.3]"' , set ProbabilityIndex to 1 to select the probability values [0.1,0.6,0.3] .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyinferenceconfig.html#cfn-sagemaker-endpointconfig-clarifyinferenceconfig-probabilityindex

ClarifyShapBaselineConfigProperty

class CfnEndpointConfigPropsMixin.ClarifyShapBaselineConfigProperty(*, mime_type=None, shap_baseline=None, shap_baseline_uri=None)

Bases: object

The configuration for the SHAP baseline (also called the background or reference dataset) of the Kernal SHAP algorithm.

  • The number of records in the baseline data determines the size of the synthetic dataset, which has an impact on latency of explainability requests. For more information, see the Synthetic data of Configure and create an endpoint .

  • ShapBaseline and ShapBaselineUri are mutually exclusive parameters. One or the either is required to configure a SHAP baseline.

Parameters:
  • mime_type (Optional[str]) – The MIME type of the baseline data. Choose from 'text/csv' or 'application/jsonlines' . Defaults to 'text/csv' .

  • shap_baseline (Optional[str]) – The inline SHAP baseline data in string format. ShapBaseline can have one or multiple records to be used as the baseline dataset. The format of the SHAP baseline file should be the same format as the training dataset. For example, if the training dataset is in CSV format and each record contains four features, and all features are numerical, then the format of the baseline data should also share these characteristics. For natural language processing (NLP) of text columns, the baseline value should be the value used to replace the unit of text specified by the Granularity of the TextConfig parameter. The size limit for ShapBasline is 4 KB. Use the ShapBaselineUri parameter if you want to provide more than 4 KB of baseline data.

  • shap_baseline_uri (Optional[str]) – The uniform resource identifier (URI) of the S3 bucket where the SHAP baseline file is stored. The format of the SHAP baseline file should be the same format as the format of the training dataset. For example, if the training dataset is in CSV format, and each record in the training dataset has four features, and all features are numerical, then the baseline file should also have this same format. Each record should contain only the features. If you are using a virtual private cloud (VPC), the ShapBaselineUri should be accessible to the VPC. For more information about setting up endpoints with Amazon Virtual Private Cloud, see Give SageMaker access to Resources in your Amazon Virtual Private Cloud .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapbaselineconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

clarify_shap_baseline_config_property = sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapBaselineConfigProperty(
    mime_type="mimeType",
    shap_baseline="shapBaseline",
    shap_baseline_uri="shapBaselineUri"
)

Attributes

mime_type

The MIME type of the baseline data.

Choose from 'text/csv' or 'application/jsonlines' . Defaults to 'text/csv' .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapbaselineconfig.html#cfn-sagemaker-endpointconfig-clarifyshapbaselineconfig-mimetype

shap_baseline

The inline SHAP baseline data in string format.

ShapBaseline can have one or multiple records to be used as the baseline dataset. The format of the SHAP baseline file should be the same format as the training dataset. For example, if the training dataset is in CSV format and each record contains four features, and all features are numerical, then the format of the baseline data should also share these characteristics. For natural language processing (NLP) of text columns, the baseline value should be the value used to replace the unit of text specified by the Granularity of the TextConfig parameter. The size limit for ShapBasline is 4 KB. Use the ShapBaselineUri parameter if you want to provide more than 4 KB of baseline data.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapbaselineconfig.html#cfn-sagemaker-endpointconfig-clarifyshapbaselineconfig-shapbaseline

shap_baseline_uri

The uniform resource identifier (URI) of the S3 bucket where the SHAP baseline file is stored.

The format of the SHAP baseline file should be the same format as the format of the training dataset. For example, if the training dataset is in CSV format, and each record in the training dataset has four features, and all features are numerical, then the baseline file should also have this same format. Each record should contain only the features. If you are using a virtual private cloud (VPC), the ShapBaselineUri should be accessible to the VPC. For more information about setting up endpoints with Amazon Virtual Private Cloud, see Give SageMaker access to Resources in your Amazon Virtual Private Cloud .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapbaselineconfig.html#cfn-sagemaker-endpointconfig-clarifyshapbaselineconfig-shapbaselineuri

ClarifyShapConfigProperty

class CfnEndpointConfigPropsMixin.ClarifyShapConfigProperty(*, number_of_samples=None, seed=None, shap_baseline_config=None, text_config=None, use_logit=None)

Bases: object

The configuration for SHAP analysis using SageMaker Clarify Explainer.

Parameters:
  • number_of_samples (Union[int, float, None]) –

    The number of samples to be used for analysis by the Kernal SHAP algorithm. .. epigraph:: The number of samples determines the size of the synthetic dataset, which has an impact on latency of explainability requests. For more information, see the Synthetic data of Configure and create an endpoint .

  • seed (Union[int, float, None]) – The starting value used to initialize the random number generator in the explainer. Provide a value for this parameter to obtain a deterministic SHAP result.

  • shap_baseline_config (Union[IResolvable, ClarifyShapBaselineConfigProperty, Dict[str, Any], None]) – The configuration for the SHAP baseline of the Kernal SHAP algorithm.

  • text_config (Union[IResolvable, ClarifyTextConfigProperty, Dict[str, Any], None]) – A parameter that indicates if text features are treated as text and explanations are provided for individual units of text. Required for natural language processing (NLP) explainability only.

  • use_logit (Union[bool, IResolvable, None]) – A Boolean toggle to indicate if you want to use the logit function (true) or log-odds units (false) for model predictions. Defaults to false.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

clarify_shap_config_property = sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapConfigProperty(
    number_of_samples=123,
    seed=123,
    shap_baseline_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapBaselineConfigProperty(
        mime_type="mimeType",
        shap_baseline="shapBaseline",
        shap_baseline_uri="shapBaselineUri"
    ),
    text_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyTextConfigProperty(
        granularity="granularity",
        language="language"
    ),
    use_logit=False
)

Attributes

number_of_samples

The number of samples to be used for analysis by the Kernal SHAP algorithm.

The number of samples determines the size of the synthetic dataset, which has an impact on latency of explainability requests. For more information, see the Synthetic data of Configure and create an endpoint .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapconfig.html#cfn-sagemaker-endpointconfig-clarifyshapconfig-numberofsamples

seed

The starting value used to initialize the random number generator in the explainer.

Provide a value for this parameter to obtain a deterministic SHAP result.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapconfig.html#cfn-sagemaker-endpointconfig-clarifyshapconfig-seed

shap_baseline_config

The configuration for the SHAP baseline of the Kernal SHAP algorithm.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapconfig.html#cfn-sagemaker-endpointconfig-clarifyshapconfig-shapbaselineconfig

text_config

A parameter that indicates if text features are treated as text and explanations are provided for individual units of text.

Required for natural language processing (NLP) explainability only.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapconfig.html#cfn-sagemaker-endpointconfig-clarifyshapconfig-textconfig

use_logit

A Boolean toggle to indicate if you want to use the logit function (true) or log-odds units (false) for model predictions.

Defaults to false.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifyshapconfig.html#cfn-sagemaker-endpointconfig-clarifyshapconfig-uselogit

ClarifyTextConfigProperty

class CfnEndpointConfigPropsMixin.ClarifyTextConfigProperty(*, granularity=None, language=None)

Bases: object

A parameter used to configure the SageMaker Clarify explainer to treat text features as text so that explanations are provided for individual units of text.

Required only for natural language processing (NLP) explainability.

Parameters:
  • granularity (Optional[str]) – The unit of granularity for the analysis of text features. For example, if the unit is 'token' , then each token (like a word in English) of the text is treated as a feature. SHAP values are computed for each unit/feature.

  • language (Optional[str]) – Specifies the language of the text features in [ISO 639-1](https://docs.aws.amazon.com/ https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) or ISO 639-3 code of a supported language. .. epigraph:: For a mix of multiple languages, use code 'xx' .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifytextconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

clarify_text_config_property = sagemaker.CfnEndpointConfigPropsMixin.ClarifyTextConfigProperty(
    granularity="granularity",
    language="language"
)

Attributes

granularity

The unit of granularity for the analysis of text features.

For example, if the unit is 'token' , then each token (like a word in English) of the text is treated as a feature. SHAP values are computed for each unit/feature.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifytextconfig.html#cfn-sagemaker-endpointconfig-clarifytextconfig-granularity

language

//en.wikipedia.org/wiki/List_of_ISO_639-1_codes) or ISO 639-3 code of a supported language.

For a mix of multiple languages, use code 'xx' .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-clarifytextconfig.html#cfn-sagemaker-endpointconfig-clarifytextconfig-language

Type:

Specifies the language of the text features in [ISO 639-1](https

Type:

//docs.aws.amazon.com/ https

CoreDumpConfigProperty

class CfnEndpointConfigPropsMixin.CoreDumpConfigProperty(*, destination_s3_uri=None, kms_key_id=None)

Bases: object

Specifies where SageMaker writes core dumps from the model container when the process crashes, and how it encrypts them.

Parameters:
  • destination_s3_uri (Optional[str]) – The Amazon S3 bucket to send the core dump to.

  • kms_key_id (Optional[str]) – The AWS Key Management Service (AWS KMS) key that SageMaker uses to encrypt the core dump data at rest using Amazon S3 server-side encryption. If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions to call kms:Encrypt.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-coredumpconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

core_dump_config_property = sagemaker.CfnEndpointConfigPropsMixin.CoreDumpConfigProperty(
    destination_s3_uri="destinationS3Uri",
    kms_key_id="kmsKeyId"
)

Attributes

destination_s3_uri

The Amazon S3 bucket to send the core dump to.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-coredumpconfig.html#cfn-sagemaker-endpointconfig-coredumpconfig-destinations3uri

kms_key_id

The AWS Key Management Service (AWS KMS) key that SageMaker uses to encrypt the core dump data at rest using Amazon S3 server-side encryption.

If you use a KMS key ID or an alias of your KMS key, the SageMaker execution role must include permissions to call kms:Encrypt.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-coredumpconfig.html#cfn-sagemaker-endpointconfig-coredumpconfig-kmskeyid

DataCaptureConfigProperty

class CfnEndpointConfigPropsMixin.DataCaptureConfigProperty(*, capture_content_type_header=None, capture_options=None, destination_s3_uri=None, enable_capture=None, initial_sampling_percentage=None, kms_key_id=None)

Bases: object

Specifies the configuration of your endpoint for model monitor data capture.

Parameters:
  • capture_content_type_header (Union[IResolvable, CaptureContentTypeHeaderProperty, Dict[str, Any], None]) – A list of the JSON and CSV content type that the endpoint captures.

  • capture_options (Union[IResolvable, Sequence[Union[IResolvable, CaptureOptionProperty, Dict[str, Any]]], None]) – Specifies whether the endpoint captures input data to your model, output data from your model, or both.

  • destination_s3_uri (Optional[str]) – The S3 bucket where model monitor stores captured data.

  • enable_capture (Union[bool, IResolvable, None]) – Set to True to enable data capture.

  • initial_sampling_percentage (Union[int, float, None]) – The percentage of data to capture.

  • kms_key_id (Optional[str]) – The AWS Key Management Service ( AWS KMS) key that Amazon SageMaker uses to encrypt the captured data at rest using Amazon S3 server-side encryption. The KmsKeyId can be any of the following formats: Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab Alias name: alias/ExampleAlias Alias name ARN: arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias If you don’t provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role’s account. For more information, see KMS-Managed Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) in the Amazon Simple Storage Service Developer Guide. The KMS key policy must grant permission to the IAM role that you specify in your CreateModel (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateModel.html) request. For more information, see Using Key Policies in AWS KMS (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the AWS Key Management Service Developer Guide.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-datacaptureconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

data_capture_config_property = sagemaker.CfnEndpointConfigPropsMixin.DataCaptureConfigProperty(
    capture_content_type_header=sagemaker.CfnEndpointConfigPropsMixin.CaptureContentTypeHeaderProperty(
        csv_content_types=["csvContentTypes"],
        json_content_types=["jsonContentTypes"]
    ),
    capture_options=[sagemaker.CfnEndpointConfigPropsMixin.CaptureOptionProperty(
        capture_mode="captureMode"
    )],
    destination_s3_uri="destinationS3Uri",
    enable_capture=False,
    initial_sampling_percentage=123,
    kms_key_id="kmsKeyId"
)

Attributes

capture_content_type_header

A list of the JSON and CSV content type that the endpoint captures.

See:

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

capture_options

Specifies whether the endpoint captures input data to your model, output data from your model, or both.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-datacaptureconfig.html#cfn-sagemaker-endpointconfig-datacaptureconfig-captureoptions

destination_s3_uri

The S3 bucket where model monitor stores captured data.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-datacaptureconfig.html#cfn-sagemaker-endpointconfig-datacaptureconfig-destinations3uri

enable_capture

Set to True to enable data capture.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-datacaptureconfig.html#cfn-sagemaker-endpointconfig-datacaptureconfig-enablecapture

initial_sampling_percentage

The percentage of data to capture.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-datacaptureconfig.html#cfn-sagemaker-endpointconfig-datacaptureconfig-initialsamplingpercentage

kms_key_id

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

The KmsKeyId can be any of the following formats: Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab Alias name: alias/ExampleAlias Alias name ARN: arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias If you don’t provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon S3 for your role’s account. For more information, see KMS-Managed Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) in the Amazon Simple Storage Service Developer Guide. The KMS key policy must grant permission to the IAM role that you specify in your CreateModel (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateModel.html) request. For more information, see Using Key Policies in AWS KMS (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the AWS Key Management Service Developer Guide.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-datacaptureconfig.html#cfn-sagemaker-endpointconfig-datacaptureconfig-kmskeyid

ExplainerConfigProperty

class CfnEndpointConfigPropsMixin.ExplainerConfigProperty(*, clarify_explainer_config=None)

Bases: object

A parameter to activate explainers.

Parameters:

clarify_explainer_config (Union[IResolvable, ClarifyExplainerConfigProperty, Dict[str, Any], None]) – A member of ExplainerConfig that contains configuration parameters for the SageMaker Clarify explainer.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-explainerconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

explainer_config_property = sagemaker.CfnEndpointConfigPropsMixin.ExplainerConfigProperty(
    clarify_explainer_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyExplainerConfigProperty(
        enable_explanations="enableExplanations",
        inference_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyInferenceConfigProperty(
            content_template="contentTemplate",
            feature_headers=["featureHeaders"],
            features_attribute="featuresAttribute",
            feature_types=["featureTypes"],
            label_attribute="labelAttribute",
            label_headers=["labelHeaders"],
            label_index=123,
            max_payload_in_mb=123,
            max_record_count=123,
            probability_attribute="probabilityAttribute",
            probability_index=123
        ),
        shap_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapConfigProperty(
            number_of_samples=123,
            seed=123,
            shap_baseline_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyShapBaselineConfigProperty(
                mime_type="mimeType",
                shap_baseline="shapBaseline",
                shap_baseline_uri="shapBaselineUri"
            ),
            text_config=sagemaker.CfnEndpointConfigPropsMixin.ClarifyTextConfigProperty(
                granularity="granularity",
                language="language"
            ),
            use_logit=False
        )
    )
)

Attributes

clarify_explainer_config

A member of ExplainerConfig that contains configuration parameters for the SageMaker Clarify explainer.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-explainerconfig.html#cfn-sagemaker-endpointconfig-explainerconfig-clarifyexplainerconfig

InstancePoolProperty

class CfnEndpointConfigPropsMixin.InstancePoolProperty(*, instance_type=None, model_name_override=None, priority=None)

Bases: object

Specifies an instance type and its priority for a heterogeneous endpoint.

Use instance pools to configure a production variant with multiple instance types, enabling the endpoint to provision instances across different types based on priority.

Parameters:
  • instance_type (Optional[str]) – The ML compute instance type for the instance pool.

  • model_name_override (Optional[str]) – The name of a SageMaker model to use for this instance pool instead of the model specified for the production variant. Use this to deploy a different model optimized for the instance type in this pool.

  • priority (Union[int, float, None]) – The priority for the instance pool. SageMaker attempts to provision instances in order of priority, starting with the lowest value. If instances for a higher-priority pool are unavailable, SageMaker attempts to provision from the next pool. Valid values: 1 to 5, where 1 is the highest priority.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-instancepool.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.cfn_property_mixins import aws_sagemaker as sagemaker

instance_pool_property = sagemaker.CfnEndpointConfigPropsMixin.InstancePoolProperty(
    instance_type="instanceType",
    model_name_override="modelNameOverride",
    priority=123
)

Attributes

instance_type

The ML compute instance type for the instance pool.

See:

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

model_name_override

The name of a SageMaker model to use for this instance pool instead of the model specified for the production variant.

Use this to deploy a different model optimized for the instance type in this pool.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-instancepool.html#cfn-sagemaker-endpointconfig-instancepool-modelnameoverride

priority

The priority for the instance pool.

SageMaker attempts to provision instances in order of priority, starting with the lowest value. If instances for a higher-priority pool are unavailable, SageMaker attempts to provision from the next pool. Valid values: 1 to 5, where 1 is the highest priority.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-instancepool.html#cfn-sagemaker-endpointconfig-instancepool-priority

ManagedInstanceScalingProperty

class CfnEndpointConfigPropsMixin.ManagedInstanceScalingProperty(*, max_instance_count=None, min_instance_count=None, scale_in_policy=None, status=None)

Bases: object

Settings that control the range in the number of instances that the endpoint provisions as it scales up or down to accommodate traffic.

Parameters:
  • max_instance_count (Union[int, float, None]) – The maximum number of instances that the endpoint can provision when it scales up to accommodate an increase in traffic.

  • min_instance_count (Union[int, float, None]) – The minimum number of instances that the endpoint must retain when it scales down to accommodate a decrease in traffic.

  • scale_in_policy (Union[IResolvable, ScaleInPolicyProperty, Dict[str, Any], None]) – Specifies how the endpoint releases instances when managed instance scaling scales in.

  • status (Optional[str]) – Indicates whether managed instance scaling is enabled.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-managedinstancescaling.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.cfn_property_mixins import aws_sagemaker as sagemaker

managed_instance_scaling_property = sagemaker.CfnEndpointConfigPropsMixin.ManagedInstanceScalingProperty(
    max_instance_count=123,
    min_instance_count=123,
    scale_in_policy=sagemaker.CfnEndpointConfigPropsMixin.ScaleInPolicyProperty(
        cooldown_in_minutes=123,
        maximum_step_size=123,
        strategy="strategy"
    ),
    status="status"
)

Attributes

max_instance_count

The maximum number of instances that the endpoint can provision when it scales up to accommodate an increase in traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-managedinstancescaling.html#cfn-sagemaker-endpointconfig-managedinstancescaling-maxinstancecount

min_instance_count

The minimum number of instances that the endpoint must retain when it scales down to accommodate a decrease in traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-managedinstancescaling.html#cfn-sagemaker-endpointconfig-managedinstancescaling-mininstancecount

scale_in_policy

Specifies how the endpoint releases instances when managed instance scaling scales in.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-managedinstancescaling.html#cfn-sagemaker-endpointconfig-managedinstancescaling-scaleinpolicy

status

Indicates whether managed instance scaling is enabled.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-managedinstancescaling.html#cfn-sagemaker-endpointconfig-managedinstancescaling-status

MetricsConfigProperty

class CfnEndpointConfigPropsMixin.MetricsConfigProperty(*, enable_detailed_observability=None, enable_enhanced_metrics=None, metric_publish_frequency_in_seconds=None)

Bases: object

Specifies the metrics that the endpoint publishes to Amazon CloudWatch, the frequency of publication, and whether to enable enhanced or detailed observability metrics.

Parameters:
  • enable_detailed_observability (Union[bool, IResolvable, None]) – Specifies whether to enable detailed observability for the endpoint. When set to true, the endpoint publishes container-level inference metrics, per-GPU metrics, per-instance host metrics, and inference component placement metrics.

  • enable_enhanced_metrics (Union[bool, IResolvable, None]) – Specifies whether to enable enhanced metrics for the endpoint. Enhanced metrics provide utilization and invocation data at instance and container granularity.

  • metric_publish_frequency_in_seconds (Union[int, float, None]) – The interval, in seconds, at which the endpoint publishes metrics to Amazon CloudWatch. Valid values are 10, 30, 60, 120, 180, 240, and 300. The default is 60.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-metricsconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

metrics_config_property = sagemaker.CfnEndpointConfigPropsMixin.MetricsConfigProperty(
    enable_detailed_observability=False,
    enable_enhanced_metrics=False,
    metric_publish_frequency_in_seconds=123
)

Attributes

enable_detailed_observability

Specifies whether to enable detailed observability for the endpoint.

When set to true, the endpoint publishes container-level inference metrics, per-GPU metrics, per-instance host metrics, and inference component placement metrics.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-metricsconfig.html#cfn-sagemaker-endpointconfig-metricsconfig-enabledetailedobservability

enable_enhanced_metrics

Specifies whether to enable enhanced metrics for the endpoint.

Enhanced metrics provide utilization and invocation data at instance and container granularity.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-metricsconfig.html#cfn-sagemaker-endpointconfig-metricsconfig-enableenhancedmetrics

metric_publish_frequency_in_seconds

The interval, in seconds, at which the endpoint publishes metrics to Amazon CloudWatch.

Valid values are 10, 30, 60, 120, 180, 240, and 300. The default is 60.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-metricsconfig.html#cfn-sagemaker-endpointconfig-metricsconfig-metricpublishfrequencyinseconds

PrefixAwareRoutingConfigProperty

class CfnEndpointConfigPropsMixin.PrefixAwareRoutingConfigProperty(*, concurrency_threshold=None, prefix_length=None)

Bases: object

The configuration for prefix-aware routing on a SageMaker real-time inference endpoint.

Specify PrefixLength and ConcurrencyThreshold to control routing behavior.

Parameters:
  • concurrency_threshold (Union[int, float, None]) – The maximum number of in-flight requests on the target instance before the endpoint routes to another instance. Required when RoutingStrategy is PREFIX_AWARE. Valid values are 1 to 1024.

  • prefix_length (Union[int, float, None]) – The maximum length of the prefix used for routing decisions. Required when RoutingStrategy is PREFIX_AWARE. Valid values are 1024 to 65536.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-prefixawareroutingconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

prefix_aware_routing_config_property = sagemaker.CfnEndpointConfigPropsMixin.PrefixAwareRoutingConfigProperty(
    concurrency_threshold=123,
    prefix_length=123
)

Attributes

concurrency_threshold

The maximum number of in-flight requests on the target instance before the endpoint routes to another instance.

Required when RoutingStrategy is PREFIX_AWARE. Valid values are 1 to 1024.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-prefixawareroutingconfig.html#cfn-sagemaker-endpointconfig-prefixawareroutingconfig-concurrencythreshold

prefix_length

The maximum length of the prefix used for routing decisions.

Required when RoutingStrategy is PREFIX_AWARE. Valid values are 1024 to 65536.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-prefixawareroutingconfig.html#cfn-sagemaker-endpointconfig-prefixawareroutingconfig-prefixlength

ProductionVariantProperty

class CfnEndpointConfigPropsMixin.ProductionVariantProperty(*, accelerator_type=None, capacity_reservation_config=None, container_startup_health_check_timeout_in_seconds=None, core_dump_config=None, enable_ssm_access=None, inference_ami_version=None, initial_instance_count=None, initial_variant_weight=None, instance_pools=None, instance_type=None, managed_instance_scaling=None, model_data_download_timeout_in_seconds=None, model_name=None, routing_config=None, serverless_config=None, variant_instance_provision_timeout_in_seconds=None, variant_name=None, volume_size_in_gb=None)

Bases: object

Specifies a model that you want to host and the resources to deploy for hosting it.

If you are deploying multiple models, tell Amazon SageMaker how to distribute traffic among the models by specifying the InitialVariantWeight objects.

Parameters:
  • accelerator_type (Optional[str]) –

    The size of the Elastic Inference (EI) instance to use for the production variant. EI instances provide on-demand GPU computing for inference. For more information, see Using Elastic Inference in Amazon SageMaker . For more information, see Using Elastic Inference in Amazon SageMaker .

  • capacity_reservation_config (Union[IResolvable, CapacityReservationConfigProperty, Dict[str, Any], None]) – Settings for the capacity reservation for the compute instances that SageMaker AI reserves for an endpoint.

  • container_startup_health_check_timeout_in_seconds (Union[int, float, None]) – The timeout value, in seconds, for your inference container to pass health check by SageMaker Hosting. For more information about health check, see How Your Container Should Respond to Health Check (Ping) Requests .

  • core_dump_config (Union[IResolvable, CoreDumpConfigProperty, Dict[str, Any], None]) – Specifies where SageMaker writes core dumps from the model container when the process crashes, and how it encrypts them.

  • enable_ssm_access (Union[bool, IResolvable, None]) – You can use this parameter to turn on native AWS Systems Manager (SSM) access for a production variant behind an endpoint. By default, SSM access is disabled for all production variants behind an endpoint. You can turn on or turn off SSM access for a production variant behind an existing endpoint by creating a new endpoint configuration and calling UpdateEndpoint .

  • inference_ami_version (Optional[str]) – Specifies an option from a collection of preconfigured Amazon Machine Image (AMI) images. Each image is configured by AWS with a set of software and driver versions. AWS optimizes these configurations for different machine learning workloads. By selecting an AMI version, you can ensure that your inference environment is compatible with specific software requirements, such as CUDA driver versions, Linux kernel versions, or AWS Neuron driver versions

  • initial_instance_count (Union[int, float, None]) – Number of instances to launch initially.

  • initial_variant_weight (Union[int, float, None]) – Determines initial traffic distribution among all of the models that you specify in the endpoint configuration. The traffic to a production variant is determined by the ratio of the VariantWeight to the sum of all VariantWeight values across all ProductionVariants. If unspecified, it defaults to 1.0.

  • instance_pools (Union[IResolvable, Sequence[Union[IResolvable, InstancePoolProperty, Dict[str, Any]]], None]) – A list of instance pools for the production variant. Each instance pool specifies an instance type and its priority for provisioning. Use instance pools to configure heterogeneous endpoints that deploy models across multiple instance types.

  • instance_type (Optional[str]) – The ML compute instance type.

  • managed_instance_scaling (Union[IResolvable, ManagedInstanceScalingProperty, Dict[str, Any], None]) – Settings that control the range in the number of instances that the endpoint provisions as it scales up or down to accommodate traffic.

  • model_data_download_timeout_in_seconds (Union[int, float, None]) – The timeout value, in seconds, to download and extract the model that you want to host from Amazon S3 to the individual inference instance associated with this production variant.

  • model_name (Optional[str]) – The name of the model that you want to host. This is the name that you specified when creating the model.

  • routing_config (Union[IResolvable, RoutingConfigProperty, Dict[str, Any], None]) – Settings that control how the endpoint routes incoming traffic to the instances that the endpoint hosts.

  • serverless_config (Union[IResolvable, ServerlessConfigProperty, Dict[str, Any], None]) – The serverless configuration for an endpoint. Specifies a serverless endpoint configuration instead of an instance-based endpoint configuration.

  • variant_instance_provision_timeout_in_seconds (Union[int, float, None]) – The timeout value, in seconds, for provisioning instances for the production variant. When SageMaker encounters an insufficient capacity error while provisioning instances, it retries with the next instance pool (if configured) or waits until the timeout expires. This timeout applies only to capacity provisioning and does not include the time for model download or container startup.

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

  • volume_size_in_gb (Union[int, float, None]) – The size, in GB, of the ML storage volume attached to individual inference instance associated with the production variant. Currently only Amazon EBS gp2 storage volumes are supported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.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.cfn_property_mixins import aws_sagemaker as sagemaker

production_variant_property = sagemaker.CfnEndpointConfigPropsMixin.ProductionVariantProperty(
    accelerator_type="acceleratorType",
    capacity_reservation_config=sagemaker.CfnEndpointConfigPropsMixin.CapacityReservationConfigProperty(
        capacity_reservation_preference="capacityReservationPreference",
        ml_reservation_arn="mlReservationArn"
    ),
    container_startup_health_check_timeout_in_seconds=123,
    core_dump_config=sagemaker.CfnEndpointConfigPropsMixin.CoreDumpConfigProperty(
        destination_s3_uri="destinationS3Uri",
        kms_key_id="kmsKeyId"
    ),
    enable_ssm_access=False,
    inference_ami_version="inferenceAmiVersion",
    initial_instance_count=123,
    initial_variant_weight=123,
    instance_pools=[sagemaker.CfnEndpointConfigPropsMixin.InstancePoolProperty(
        instance_type="instanceType",
        model_name_override="modelNameOverride",
        priority=123
    )],
    instance_type="instanceType",
    managed_instance_scaling=sagemaker.CfnEndpointConfigPropsMixin.ManagedInstanceScalingProperty(
        max_instance_count=123,
        min_instance_count=123,
        scale_in_policy=sagemaker.CfnEndpointConfigPropsMixin.ScaleInPolicyProperty(
            cooldown_in_minutes=123,
            maximum_step_size=123,
            strategy="strategy"
        ),
        status="status"
    ),
    model_data_download_timeout_in_seconds=123,
    model_name="modelName",
    routing_config=sagemaker.CfnEndpointConfigPropsMixin.RoutingConfigProperty(
        prefix_aware_routing_config=sagemaker.CfnEndpointConfigPropsMixin.PrefixAwareRoutingConfigProperty(
            concurrency_threshold=123,
            prefix_length=123
        ),
        routing_strategy="routingStrategy"
    ),
    serverless_config=sagemaker.CfnEndpointConfigPropsMixin.ServerlessConfigProperty(
        max_concurrency=123,
        memory_size_in_mb=123,
        provisioned_concurrency=123
    ),
    variant_instance_provision_timeout_in_seconds=123,
    variant_name="variantName",
    volume_size_in_gb=123
)

Attributes

accelerator_type

The size of the Elastic Inference (EI) instance to use for the production variant.

EI instances provide on-demand GPU computing for inference. For more information, see Using Elastic Inference in Amazon SageMaker . For more information, see Using Elastic Inference in Amazon SageMaker .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-acceleratortype

capacity_reservation_config

Settings for the capacity reservation for the compute instances that SageMaker AI reserves for an endpoint.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-capacityreservationconfig

container_startup_health_check_timeout_in_seconds

The timeout value, in seconds, for your inference container to pass health check by SageMaker Hosting.

For more information about health check, see How Your Container Should Respond to Health Check (Ping) Requests .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-containerstartuphealthchecktimeoutinseconds

core_dump_config

Specifies where SageMaker writes core dumps from the model container when the process crashes, and how it encrypts them.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-coredumpconfig

enable_ssm_access

You can use this parameter to turn on native AWS Systems Manager (SSM) access for a production variant behind an endpoint.

By default, SSM access is disabled for all production variants behind an endpoint. You can turn on or turn off SSM access for a production variant behind an existing endpoint by creating a new endpoint configuration and calling UpdateEndpoint .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-enablessmaccess

inference_ami_version

Specifies an option from a collection of preconfigured Amazon Machine Image (AMI) images.

Each image is configured by AWS with a set of software and driver versions. AWS optimizes these configurations for different machine learning workloads. By selecting an AMI version, you can ensure that your inference environment is compatible with specific software requirements, such as CUDA driver versions, Linux kernel versions, or AWS Neuron driver versions

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-inferenceamiversion

initial_instance_count

Number of instances to launch initially.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-initialinstancecount

initial_variant_weight

Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.

The traffic to a production variant is determined by the ratio of the VariantWeight to the sum of all VariantWeight values across all ProductionVariants. If unspecified, it defaults to 1.0.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-initialvariantweight

instance_pools

A list of instance pools for the production variant.

Each instance pool specifies an instance type and its priority for provisioning. Use instance pools to configure heterogeneous endpoints that deploy models across multiple instance types.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-instancepools

instance_type

The ML compute instance type.

See:

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

managed_instance_scaling

Settings that control the range in the number of instances that the endpoint provisions as it scales up or down to accommodate traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-managedinstancescaling

model_data_download_timeout_in_seconds

The timeout value, in seconds, to download and extract the model that you want to host from Amazon S3 to the individual inference instance associated with this production variant.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-modeldatadownloadtimeoutinseconds

model_name

The name of the model that you want to host.

This is the name that you specified when creating the model.

See:

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

routing_config

Settings that control how the endpoint routes incoming traffic to the instances that the endpoint hosts.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-routingconfig

serverless_config

The serverless configuration for an endpoint.

Specifies a serverless endpoint configuration instead of an instance-based endpoint configuration.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-serverlessconfig

variant_instance_provision_timeout_in_seconds

The timeout value, in seconds, for provisioning instances for the production variant.

When SageMaker encounters an insufficient capacity error while provisioning instances, it retries with the next instance pool (if configured) or waits until the timeout expires. This timeout applies only to capacity provisioning and does not include the time for model download or container startup.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-variantinstanceprovisiontimeoutinseconds

variant_name

The name of the production variant.

See:

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

volume_size_in_gb

The size, in GB, of the ML storage volume attached to individual inference instance associated with the production variant.

Currently only Amazon EBS gp2 storage volumes are supported.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-productionvariant.html#cfn-sagemaker-endpointconfig-productionvariant-volumesizeingb

RoutingConfigProperty

class CfnEndpointConfigPropsMixin.RoutingConfigProperty(*, prefix_aware_routing_config=None, routing_strategy=None)

Bases: object

Settings that control how the endpoint routes incoming traffic to the instances that the endpoint hosts.

Parameters:
  • prefix_aware_routing_config (Union[IResolvable, PrefixAwareRoutingConfigProperty, Dict[str, Any], None]) – The configuration for prefix-aware routing on a SageMaker real-time inference endpoint. Specify PrefixLength and ConcurrencyThreshold to control routing behavior.

  • routing_strategy (Optional[str]) – Sets how the endpoint routes incoming traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-routingconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

routing_config_property = sagemaker.CfnEndpointConfigPropsMixin.RoutingConfigProperty(
    prefix_aware_routing_config=sagemaker.CfnEndpointConfigPropsMixin.PrefixAwareRoutingConfigProperty(
        concurrency_threshold=123,
        prefix_length=123
    ),
    routing_strategy="routingStrategy"
)

Attributes

prefix_aware_routing_config

The configuration for prefix-aware routing on a SageMaker real-time inference endpoint.

Specify PrefixLength and ConcurrencyThreshold to control routing behavior.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-routingconfig.html#cfn-sagemaker-endpointconfig-routingconfig-prefixawareroutingconfig

routing_strategy

Sets how the endpoint routes incoming traffic.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-routingconfig.html#cfn-sagemaker-endpointconfig-routingconfig-routingstrategy

ScaleInPolicyProperty

class CfnEndpointConfigPropsMixin.ScaleInPolicyProperty(*, cooldown_in_minutes=None, maximum_step_size=None, strategy=None)

Bases: object

Specifies how the endpoint releases instances when managed instance scaling scales in.

Parameters:
  • cooldown_in_minutes (Union[int, float, None]) – The cooldown period, in minutes, after the last endpoint operation before the endpoint evaluates consolidation scale-in opportunities. Valid values are 5 to 1440. The default is 20.

  • maximum_step_size (Union[int, float, None]) – The maximum number of instances that the endpoint can terminate at a time during a consolidation scale-in operation. Valid values are 1 to 100. The default is 1.

  • strategy (Optional[str]) – The strategy for scaling in instances. IDLE_RELEASE releases instances that have no hosted inference component copies. CONSOLIDATION consolidates inference component copies onto fewer instances to release more instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-scaleinpolicy.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.cfn_property_mixins import aws_sagemaker as sagemaker

scale_in_policy_property = sagemaker.CfnEndpointConfigPropsMixin.ScaleInPolicyProperty(
    cooldown_in_minutes=123,
    maximum_step_size=123,
    strategy="strategy"
)

Attributes

cooldown_in_minutes

The cooldown period, in minutes, after the last endpoint operation before the endpoint evaluates consolidation scale-in opportunities.

Valid values are 5 to 1440. The default is 20.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-scaleinpolicy.html#cfn-sagemaker-endpointconfig-scaleinpolicy-cooldowninminutes

maximum_step_size

The maximum number of instances that the endpoint can terminate at a time during a consolidation scale-in operation.

Valid values are 1 to 100. The default is 1.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-scaleinpolicy.html#cfn-sagemaker-endpointconfig-scaleinpolicy-maximumstepsize

strategy

The strategy for scaling in instances.

IDLE_RELEASE releases instances that have no hosted inference component copies. CONSOLIDATION consolidates inference component copies onto fewer instances to release more instances.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-scaleinpolicy.html#cfn-sagemaker-endpointconfig-scaleinpolicy-strategy

ServerlessConfigProperty

class CfnEndpointConfigPropsMixin.ServerlessConfigProperty(*, max_concurrency=None, memory_size_in_mb=None, provisioned_concurrency=None)

Bases: object

Specifies the serverless configuration for an endpoint variant.

Parameters:
  • max_concurrency (Union[int, float, None]) – The maximum number of concurrent invocations your serverless endpoint can process.

  • memory_size_in_mb (Union[int, float, None]) – The memory size of your serverless endpoint. Valid values are in 1 GB increments: 1024 MB, 2048 MB, 3072 MB, 4096 MB, 5120 MB, or 6144 MB.

  • provisioned_concurrency (Union[int, float, None]) – The amount of provisioned concurrency to allocate for the serverless endpoint. Should be less than or equal to MaxConcurrency . .. epigraph:: This field is not supported for serverless endpoint recommendations for Inference Recommender jobs. For more information about creating an Inference Recommender job, see CreateInferenceRecommendationsJobs .

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-serverlessconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

serverless_config_property = sagemaker.CfnEndpointConfigPropsMixin.ServerlessConfigProperty(
    max_concurrency=123,
    memory_size_in_mb=123,
    provisioned_concurrency=123
)

Attributes

max_concurrency

The maximum number of concurrent invocations your serverless endpoint can process.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-serverlessconfig.html#cfn-sagemaker-endpointconfig-serverlessconfig-maxconcurrency

memory_size_in_mb

The memory size of your serverless endpoint.

Valid values are in 1 GB increments: 1024 MB, 2048 MB, 3072 MB, 4096 MB, 5120 MB, or 6144 MB.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-serverlessconfig.html#cfn-sagemaker-endpointconfig-serverlessconfig-memorysizeinmb

provisioned_concurrency

The amount of provisioned concurrency to allocate for the serverless endpoint.

Should be less than or equal to MaxConcurrency . .. epigraph:

This field is not supported for serverless endpoint recommendations for Inference Recommender jobs. For more information about creating an Inference Recommender job, see `CreateInferenceRecommendationsJobs <https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateInferenceRecommendationsJob.html>`_ .
See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-serverlessconfig.html#cfn-sagemaker-endpointconfig-serverlessconfig-provisionedconcurrency

VpcConfigProperty

class CfnEndpointConfigPropsMixin.VpcConfigProperty(*, security_group_ids=None, subnets=None)

Bases: object

Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to.

You can control access to and from your resources by configuring a VPC.

Parameters:
  • security_group_ids (Optional[Sequence[str]]) – The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field.

  • subnets (Optional[Sequence[str]]) – The ID of the subnets in the VPC to which you want to connect your training job or model.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-vpcconfig.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.cfn_property_mixins import aws_sagemaker as sagemaker

vpc_config_property = sagemaker.CfnEndpointConfigPropsMixin.VpcConfigProperty(
    security_group_ids=["securityGroupIds"],
    subnets=["subnets"]
)

Attributes

security_group_ids

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

Specify the security groups for the VPC that is specified in the Subnets field.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-vpcconfig.html#cfn-sagemaker-endpointconfig-vpcconfig-securitygroupids

subnets

The ID of the subnets in the VPC to which you want to connect your training job or model.

See:

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sagemaker-endpointconfig-vpcconfig.html#cfn-sagemaker-endpointconfig-vpcconfig-subnets