ProductionVariant Struct
Identifies a model that you want to host and the resources to deploy for hosting it.
| Source | aws-stepfunctions-tasks/lib/sagemaker/base-types.ts |
|---|
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_stepfunctions_tasks as stepfunctions_tasks } from 'aws-cdk-lib';
declare const acceleratorType: stepfunctions_tasks.AcceleratorType;
declare const instanceType: ec2.InstanceType;
const productionVariant: stepfunctions_tasks.ProductionVariant = {
instanceType: instanceType,
modelName: 'modelName',
variantName: 'variantName',
// the properties below are optional
acceleratorType: acceleratorType,
initialInstanceCount: 123,
initialVariantWeight: 123,
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2
from aws_cdk import aws_stepfunctions_tasks as stepfunctions_tasks
# accelerator_type: stepfunctions_tasks.AcceleratorType
# instance_type: ec2.InstanceType
production_variant = stepfunctions_tasks.ProductionVariant(
instance_type=instance_type,
model_name="modelName",
variant_name="variantName",
# the properties below are optional
accelerator_type=accelerator_type,
initial_instance_count=123,
initial_variant_weight=123
)
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.ec2.*;
import software.amazon.awscdk.services.stepfunctions.tasks.*;
AcceleratorType acceleratorType;
InstanceType instanceType;
ProductionVariant productionVariant = ProductionVariant.builder()
.instanceType(instanceType)
.modelName("modelName")
.variantName("variantName")
// the properties below are optional
.acceleratorType(acceleratorType)
.initialInstanceCount(123)
.initialVariantWeight(123)
.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.EC2;
using Amazon.CDK.AWS.StepFunctions.Tasks;
AcceleratorType acceleratorType;
InstanceType instanceType;
var productionVariant = new ProductionVariant {
InstanceType = instanceType,
ModelName = "modelName",
VariantName = "variantName",
// the properties below are optional
AcceleratorType = acceleratorType,
InitialInstanceCount = 123,
InitialVariantWeight = 123
};
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"
import "github.com/aws/aws-cdk-go/awscdk"
var acceleratorType AcceleratorType
var instanceType InstanceType
productionVariant := &ProductionVariant{
InstanceType: instanceType,
ModelName: jsii.String("modelName"),
VariantName: jsii.String("variantName"),
// the properties below are optional
AcceleratorType: acceleratorType,
InitialInstanceCount: jsii.Number(123),
InitialVariantWeight: jsii.Number(123),
}
Properties
acceleratorTypeoptionalAcceleratorTypeaccelerator_typeoptionalAcceleratorTypeacceleratorTypeoptionalAcceleratorTypeAcceleratorTypeoptionalAcceleratorTypeAcceleratorTypeoptionalAcceleratorType = None #The size of the Elastic Inference (EI) instance to use for the production variant.
initialInstanceCountoptionalnumberinitial_instance_countoptionalint | floatinitialInstanceCountoptionalNumberInitialInstanceCountoptionaldoubleInitialInstanceCountoptional*float64 = 1 #Number of instances to launch initially.
initialVariantWeightoptionalnumberinitial_variant_weightoptionalint | floatinitialVariantWeightoptionalNumberInitialVariantWeightoptionaldoubleInitialVariantWeightoptional*float64 = 1.0 #Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.
instanceTypeInstanceTypeinstance_typeInstanceTypeinstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceTypeInstanceType required #The ML compute instance type.
The name of the model that you want to host.
This is the name that you specified when creating the model.
The name of the production variant.