Skip to content
v2.278.0

CfnInferenceExperimentProps Struct ​

Properties for defining a CfnInferenceExperiment.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';
const cfnInferenceExperimentProps: sagemaker.CfnInferenceExperimentProps = {
  endpointName: 'endpointName',
  modelVariants: [{
    infrastructureConfig: {
      infrastructureType: 'infrastructureType',
      realTimeInferenceConfig: {
        instanceCount: 123,
        instanceType: 'instanceType',
      },
    },
    modelName: 'modelName',
    variantName: 'variantName',
  }],
  name: 'name',
  roleArn: 'roleArn',
  type: 'type',

  // the properties below are optional
  dataStorageConfig: {
    destination: 'destination',

    // the properties below are optional
    contentType: {
      csvContentTypes: ['csvContentTypes'],
      jsonContentTypes: ['jsonContentTypes'],
    },
    kmsKey: 'kmsKey',
  },
  description: 'description',
  desiredState: 'desiredState',
  kmsKey: 'kmsKey',
  schedule: {
    endTime: 'endTime',
    startTime: 'startTime',
  },
  shadowModeConfig: {
    shadowModelVariants: [{
      samplingPercentage: 123,
      shadowModelVariantName: 'shadowModelVariantName',
    }],
    sourceModelVariantName: 'sourceModelVariantName',
  },
  statusReason: 'statusReason',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sagemaker as sagemaker

cfn_inference_experiment_props = sagemaker.CfnInferenceExperimentProps(
    endpoint_name="endpointName",
    model_variants=[sagemaker.CfnInferenceExperiment.ModelVariantConfigProperty(
        infrastructure_config=sagemaker.CfnInferenceExperiment.ModelInfrastructureConfigProperty(
            infrastructure_type="infrastructureType",
            real_time_inference_config=sagemaker.CfnInferenceExperiment.RealTimeInferenceConfigProperty(
                instance_count=123,
                instance_type="instanceType"
            )
        ),
        model_name="modelName",
        variant_name="variantName"
    )],
    name="name",
    role_arn="roleArn",
    type="type",

    # the properties below are optional
    data_storage_config=sagemaker.CfnInferenceExperiment.DataStorageConfigProperty(
        destination="destination",

        # the properties below are optional
        content_type=sagemaker.CfnInferenceExperiment.CaptureContentTypeHeaderProperty(
            csv_content_types=["csvContentTypes"],
            json_content_types=["jsonContentTypes"]
        ),
        kms_key="kmsKey"
    ),
    description="description",
    desired_state="desiredState",
    kms_key="kmsKey",
    schedule=sagemaker.CfnInferenceExperiment.InferenceExperimentScheduleProperty(
        end_time="endTime",
        start_time="startTime"
    ),
    shadow_mode_config=sagemaker.CfnInferenceExperiment.ShadowModeConfigProperty(
        shadow_model_variants=[sagemaker.CfnInferenceExperiment.ShadowModelVariantConfigProperty(
            sampling_percentage=123,
            shadow_model_variant_name="shadowModelVariantName"
        )],
        source_model_variant_name="sourceModelVariantName"
    ),
    status_reason="statusReason",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.*;

CfnInferenceExperimentProps cfnInferenceExperimentProps = CfnInferenceExperimentProps.builder()
        .endpointName("endpointName")
        .modelVariants(List.of(ModelVariantConfigProperty.builder()
                .infrastructureConfig(ModelInfrastructureConfigProperty.builder()
                        .infrastructureType("infrastructureType")
                        .realTimeInferenceConfig(RealTimeInferenceConfigProperty.builder()
                                .instanceCount(123)
                                .instanceType("instanceType")
                                .build())
                        .build())
                .modelName("modelName")
                .variantName("variantName")
                .build()))
        .name("name")
        .roleArn("roleArn")
        .type("type")

        // the properties below are optional
        .dataStorageConfig(DataStorageConfigProperty.builder()
                .destination("destination")

                // the properties below are optional
                .contentType(CaptureContentTypeHeaderProperty.builder()
                        .csvContentTypes(List.of("csvContentTypes"))
                        .jsonContentTypes(List.of("jsonContentTypes"))
                        .build())
                .kmsKey("kmsKey")
                .build())
        .description("description")
        .desiredState("desiredState")
        .kmsKey("kmsKey")
        .schedule(InferenceExperimentScheduleProperty.builder()
                .endTime("endTime")
                .startTime("startTime")
                .build())
        .shadowModeConfig(ShadowModeConfigProperty.builder()
                .shadowModelVariants(List.of(ShadowModelVariantConfigProperty.builder()
                        .samplingPercentage(123)
                        .shadowModelVariantName("shadowModelVariantName")
                        .build()))
                .sourceModelVariantName("sourceModelVariantName")
                .build())
        .statusReason("statusReason")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;

var cfnInferenceExperimentProps = new CfnInferenceExperimentProps {
    EndpointName = "endpointName",
    ModelVariants = new [] { new ModelVariantConfigProperty {
        InfrastructureConfig = new ModelInfrastructureConfigProperty {
            InfrastructureType = "infrastructureType",
            RealTimeInferenceConfig = new RealTimeInferenceConfigProperty {
                InstanceCount = 123,
                InstanceType = "instanceType"
            }
        },
        ModelName = "modelName",
        VariantName = "variantName"
    } },
    Name = "name",
    RoleArn = "roleArn",
    Type = "type",

    // the properties below are optional
    DataStorageConfig = new DataStorageConfigProperty {
        Destination = "destination",

        // the properties below are optional
        ContentType = new CaptureContentTypeHeaderProperty {
            CsvContentTypes = new [] { "csvContentTypes" },
            JsonContentTypes = new [] { "jsonContentTypes" }
        },
        KmsKey = "kmsKey"
    },
    Description = "description",
    DesiredState = "desiredState",
    KmsKey = "kmsKey",
    Schedule = new InferenceExperimentScheduleProperty {
        EndTime = "endTime",
        StartTime = "startTime"
    },
    ShadowModeConfig = new ShadowModeConfigProperty {
        ShadowModelVariants = new [] { new ShadowModelVariantConfigProperty {
            SamplingPercentage = 123,
            ShadowModelVariantName = "shadowModelVariantName"
        } },
        SourceModelVariantName = "sourceModelVariantName"
    },
    StatusReason = "statusReason",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

cfnInferenceExperimentProps := &CfnInferenceExperimentProps{
	EndpointName: jsii.String("endpointName"),
	ModelVariants: []interface{}{
		&ModelVariantConfigProperty{
			InfrastructureConfig: &ModelInfrastructureConfigProperty{
				InfrastructureType: jsii.String("infrastructureType"),
				RealTimeInferenceConfig: &RealTimeInferenceConfigProperty{
					InstanceCount: jsii.Number(123),
					InstanceType: jsii.String("instanceType"),
				},
			},
			ModelName: jsii.String("modelName"),
			VariantName: jsii.String("variantName"),
		},
	},
	Name: jsii.String("name"),
	RoleArn: jsii.String("roleArn"),
	Type: jsii.String("type"),

	// the properties below are optional
	DataStorageConfig: &DataStorageConfigProperty{
		Destination: jsii.String("destination"),

		// the properties below are optional
		ContentType: &CaptureContentTypeHeaderProperty{
			CsvContentTypes: []*string{
				jsii.String("csvContentTypes"),
			},
			JsonContentTypes: []*string{
				jsii.String("jsonContentTypes"),
			},
		},
		KmsKey: jsii.String("kmsKey"),
	},
	Description: jsii.String("description"),
	DesiredState: jsii.String("desiredState"),
	KmsKey: jsii.String("kmsKey"),
	Schedule: &InferenceExperimentScheduleProperty{
		EndTime: jsii.String("endTime"),
		StartTime: jsii.String("startTime"),
	},
	ShadowModeConfig: &ShadowModeConfigProperty{
		ShadowModelVariants: []interface{}{
			&ShadowModelVariantConfigProperty{
				SamplingPercentage: jsii.Number(123),
				ShadowModelVariantName: jsii.String("shadowModelVariantName"),
			},
		},
		SourceModelVariantName: jsii.String("sourceModelVariantName"),
	},
	StatusReason: jsii.String("statusReason"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}

Properties ​

dataStorageConfigoptionalIResolvable | CfnInferenceExperiment.DataStorageConfigPropertydata_storage_configoptionaltyping.Union[IResolvable, DataStorageConfigProperty]dataStorageConfigoptionalIResolvableDataStorageConfigoptionalIResolvableDataStorageConfigoptionalinterface{} #
The Amazon S3 location and configuration for storing inference request and response data.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string #
The description of the inference experiment.
desiredStateoptionalstringdesired_stateoptionalstrdesiredStateoptionalStringDesiredStateoptionalstringDesiredStateoptional*string #
The desired state of the experiment after stopping. The possible states are the following:.
  • Completed : The experiment completed successfully
  • Cancelled : The experiment was canceled
endpointNamestringendpoint_namestrendpointNameStringEndpointNamestringEndpointName*string required #
The name of the endpoint.
kmsKeyoptionalstringkms_keyoptionalstrkmsKeyoptionalStringKmsKeyoptionalstringKmsKeyoptional*string #
The AWS Key Management Service key that Amazon SageMaker uses to encrypt captured data at rest using Amazon S3 server-side encryption.
modelVariantsIResolvable | IResolvable | CfnInferenceExperiment.ModelVariantConfigProperty[]model_variantstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, ModelVariantConfigProperty]]]modelVariantsIResolvableModelVariantsIResolvableModelVariantsinterface{} required #
An array of `ModelVariantConfigSummary` objects.

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

namestringnamestrnameStringNamestringName*string required #
The name of the inference experiment.
roleArnstringrole_arnstrroleArnStringRoleArnstringRoleArn*string required #
The ARN of the IAM role that Amazon SageMaker can assume to access model artifacts and container images, and manage Amazon SageMaker Inference endpoints for model deployment.
scheduleoptionalIResolvable | CfnInferenceExperiment.InferenceExperimentSchedulePropertyscheduleoptionaltyping.Union[IResolvable, InferenceExperimentScheduleProperty]scheduleoptionalIResolvableScheduleoptionalIResolvableScheduleoptionalinterface{} #
The duration for which the inference experiment ran or will run.

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

shadowModeConfigoptionalIResolvable | CfnInferenceExperiment.ShadowModeConfigPropertyshadow_mode_configoptionaltyping.Union[IResolvable, ShadowModeConfigProperty]shadowModeConfigoptionalIResolvableShadowModeConfigoptionalIResolvableShadowModeConfigoptionalinterface{} #
The configuration of `ShadowMode` inference experiment type, which shows the production variant that takes all the inference requests, and the shadow variant to which Amazon SageMaker replicates a percentage of the inference requests.

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

statusReasonoptionalstringstatus_reasonoptionalstrstatusReasonoptionalStringStatusReasonoptionalstringStatusReasonoptional*string #
The error message for the inference experiment status result.
tagsoptionalCfnTag[]tagsoptionaltyping.List[CfnTag]tagsoptionalList<CfnTag>TagsoptionalCfnTag[]Tagsoptional*[]CfnTag #
An array of key-value pairs to apply to this resource.

For more information, see Tag .

typestringtypestrtypeStringTypestringType*string required #
The type of the inference experiment.