InferenceComponentSpecificationForInstanceTypeProperty Struct
A specification for one instance type, for use in Specifications.
InstanceType is required here, and is not accepted on the singular Specification. BaseInferenceComponentName is not accepted here either: adapter inference components are supported only on the singular Specification.
| Source | |
|---|---|
| Type last changed |
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 inferenceComponentSpecificationForInstanceTypeProperty: sagemaker.CfnInferenceComponent.InferenceComponentSpecificationForInstanceTypeProperty = {
instanceType: 'instanceType',
// the properties below are optional
computeResourceRequirements: {
maxMemoryRequiredInMb: 123,
minMemoryRequiredInMb: 123,
numberOfAcceleratorDevicesRequired: 123,
numberOfCpuCoresRequired: 123,
},
container: {
artifactUrl: 'artifactUrl',
containerMetricsConfig: {
metricsEndpoints: [{
metricsEndpointPath: 'metricsEndpointPath',
// the properties below are optional
metricPublishFrequencyInSeconds: 123,
}],
},
environment: {
environmentKey: 'environment',
},
image: 'image',
},
currentDataCacheConfig: {
enableCaching: false,
},
dataCacheConfig: {
enableCaching: false,
},
modelName: 'modelName',
schedulingConfig: {
availabilityZoneBalance: {
enforcementMode: 'enforcementMode',
// the properties below are optional
maxImbalance: 123,
},
placementStrategy: 'placementStrategy',
},
startupParameters: {
containerStartupHealthCheckTimeoutInSeconds: 123,
modelDataDownloadTimeoutInSeconds: 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_sagemaker as sagemaker
inference_component_specification_for_instance_type_property = sagemaker.CfnInferenceComponent.InferenceComponentSpecificationForInstanceTypeProperty(
instance_type="instanceType",
# the properties below are optional
compute_resource_requirements=sagemaker.CfnInferenceComponent.InferenceComponentComputeResourceRequirementsProperty(
max_memory_required_in_mb=123,
min_memory_required_in_mb=123,
number_of_accelerator_devices_required=123,
number_of_cpu_cores_required=123
),
container=sagemaker.CfnInferenceComponent.InferenceComponentContainerSpecificationForInstanceTypeProperty(
artifact_url="artifactUrl",
container_metrics_config=sagemaker.CfnInferenceComponent.ContainerMetricsConfigProperty(
metrics_endpoints=[sagemaker.CfnInferenceComponent.MetricsEndpointProperty(
metrics_endpoint_path="metricsEndpointPath",
# the properties below are optional
metric_publish_frequency_in_seconds=123
)]
),
environment={
"environment_key": "environment"
},
image="image"
),
current_data_cache_config=sagemaker.CfnInferenceComponent.InferenceComponentDataCacheConfigProperty(
enable_caching=False
),
data_cache_config=sagemaker.CfnInferenceComponent.InferenceComponentDataCacheConfigProperty(
enable_caching=False
),
model_name="modelName",
scheduling_config=sagemaker.CfnInferenceComponent.InferenceComponentSchedulingConfigProperty(
availability_zone_balance=sagemaker.CfnInferenceComponent.InferenceComponentAvailabilityZoneBalanceProperty(
enforcement_mode="enforcementMode",
# the properties below are optional
max_imbalance=123
),
placement_strategy="placementStrategy"
),
startup_parameters=sagemaker.CfnInferenceComponent.InferenceComponentStartupParametersProperty(
container_startup_health_check_timeout_in_seconds=123,
model_data_download_timeout_in_seconds=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.sagemaker.*;
InferenceComponentSpecificationForInstanceTypeProperty inferenceComponentSpecificationForInstanceTypeProperty = InferenceComponentSpecificationForInstanceTypeProperty.builder()
.instanceType("instanceType")
// the properties below are optional
.computeResourceRequirements(InferenceComponentComputeResourceRequirementsProperty.builder()
.maxMemoryRequiredInMb(123)
.minMemoryRequiredInMb(123)
.numberOfAcceleratorDevicesRequired(123)
.numberOfCpuCoresRequired(123)
.build())
.container(InferenceComponentContainerSpecificationForInstanceTypeProperty.builder()
.artifactUrl("artifactUrl")
.containerMetricsConfig(ContainerMetricsConfigProperty.builder()
.metricsEndpoints(List.of(MetricsEndpointProperty.builder()
.metricsEndpointPath("metricsEndpointPath")
// the properties below are optional
.metricPublishFrequencyInSeconds(123)
.build()))
.build())
.environment(Map.of(
"environmentKey", "environment"))
.image("image")
.build())
.currentDataCacheConfig(InferenceComponentDataCacheConfigProperty.builder()
.enableCaching(false)
.build())
.dataCacheConfig(InferenceComponentDataCacheConfigProperty.builder()
.enableCaching(false)
.build())
.modelName("modelName")
.schedulingConfig(InferenceComponentSchedulingConfigProperty.builder()
.availabilityZoneBalance(InferenceComponentAvailabilityZoneBalanceProperty.builder()
.enforcementMode("enforcementMode")
// the properties below are optional
.maxImbalance(123)
.build())
.placementStrategy("placementStrategy")
.build())
.startupParameters(InferenceComponentStartupParametersProperty.builder()
.containerStartupHealthCheckTimeoutInSeconds(123)
.modelDataDownloadTimeoutInSeconds(123)
.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 inferenceComponentSpecificationForInstanceTypeProperty = new InferenceComponentSpecificationForInstanceTypeProperty {
InstanceType = "instanceType",
// the properties below are optional
ComputeResourceRequirements = new InferenceComponentComputeResourceRequirementsProperty {
MaxMemoryRequiredInMb = 123,
MinMemoryRequiredInMb = 123,
NumberOfAcceleratorDevicesRequired = 123,
NumberOfCpuCoresRequired = 123
},
Container = new InferenceComponentContainerSpecificationForInstanceTypeProperty {
ArtifactUrl = "artifactUrl",
ContainerMetricsConfig = new ContainerMetricsConfigProperty {
MetricsEndpoints = new [] { new MetricsEndpointProperty {
MetricsEndpointPath = "metricsEndpointPath",
// the properties below are optional
MetricPublishFrequencyInSeconds = 123
} }
},
Environment = new Dictionary<string, string> {
{ "environmentKey", "environment" }
},
Image = "image"
},
CurrentDataCacheConfig = new InferenceComponentDataCacheConfigProperty {
EnableCaching = false
},
DataCacheConfig = new InferenceComponentDataCacheConfigProperty {
EnableCaching = false
},
ModelName = "modelName",
SchedulingConfig = new InferenceComponentSchedulingConfigProperty {
AvailabilityZoneBalance = new InferenceComponentAvailabilityZoneBalanceProperty {
EnforcementMode = "enforcementMode",
// the properties below are optional
MaxImbalance = 123
},
PlacementStrategy = "placementStrategy"
},
StartupParameters = new InferenceComponentStartupParametersProperty {
ContainerStartupHealthCheckTimeoutInSeconds = 123,
ModelDataDownloadTimeoutInSeconds = 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"
inferenceComponentSpecificationForInstanceTypeProperty := &InferenceComponentSpecificationForInstanceTypeProperty{
InstanceType: jsii.String("instanceType"),
// the properties below are optional
ComputeResourceRequirements: &InferenceComponentComputeResourceRequirementsProperty{
MaxMemoryRequiredInMb: jsii.Number(123),
MinMemoryRequiredInMb: jsii.Number(123),
NumberOfAcceleratorDevicesRequired: jsii.Number(123),
NumberOfCpuCoresRequired: jsii.Number(123),
},
Container: &InferenceComponentContainerSpecificationForInstanceTypeProperty{
ArtifactUrl: jsii.String("artifactUrl"),
ContainerMetricsConfig: &ContainerMetricsConfigProperty{
MetricsEndpoints: []interface{}{
&MetricsEndpointProperty{
MetricsEndpointPath: jsii.String("metricsEndpointPath"),
// the properties below are optional
MetricPublishFrequencyInSeconds: jsii.Number(123),
},
},
},
Environment: map[string]*string{
"environmentKey": jsii.String("environment"),
},
Image: jsii.String("image"),
},
CurrentDataCacheConfig: &InferenceComponentDataCacheConfigProperty{
EnableCaching: jsii.Boolean(false),
},
DataCacheConfig: &InferenceComponentDataCacheConfigProperty{
EnableCaching: jsii.Boolean(false),
},
ModelName: jsii.String("modelName"),
SchedulingConfig: &InferenceComponentSchedulingConfigProperty{
AvailabilityZoneBalance: &InferenceComponentAvailabilityZoneBalanceProperty{
EnforcementMode: jsii.String("enforcementMode"),
// the properties below are optional
MaxImbalance: jsii.Number(123),
},
PlacementStrategy: jsii.String("placementStrategy"),
},
StartupParameters: &InferenceComponentStartupParametersProperty{
ContainerStartupHealthCheckTimeoutInSeconds: jsii.Number(123),
ModelDataDownloadTimeoutInSeconds: jsii.Number(123),
},
}
Properties
computeResourceRequirementsoptionalIResolvable | CfnInferenceComponent.compute_resource_requirementsoptionaltyping.Union[IResolvable, InferenceComponentComputeResourceRequirementsProperty]computeResourceRequirementsoptionalIResolvableComputeResourceRequirementsoptionalIResolvableComputeResourceRequirementsoptionalinterface{} #containeroptionalIResolvable | CfnInferenceComponent.containeroptionaltyping.Union[IResolvable, InferenceComponentContainerSpecificationForInstanceTypeProperty]containeroptionalIResolvableContaineroptionalIResolvableContaineroptionalinterface{} #Container specification for one Specifications entry.
notes
Distinct from InferenceComponentContainerSpecification: DescribeInferenceComponent returns no per-entry DeployedImage (VERIFIED in us-west-2), so DeployedImage is intentionally omitted here and this definition can never be aggregated into a plural READ response. The singular InferenceComponentContainerSpecification keeps DeployedImage - the service DOES return it there.
currentDataCacheConfigoptionalIResolvable | CfnInferenceComponent.current_data_cache_configoptionaltyping.Union[IResolvable, InferenceComponentDataCacheConfigProperty]currentDataCacheConfigoptionalIResolvableCurrentDataCacheConfigoptionalIResolvableCurrentDataCacheConfigoptionalinterface{} #Settings that affect how the inference component caches data.
dataCacheConfigoptionalIResolvable | CfnInferenceComponent.data_cache_configoptionaltyping.Union[IResolvable, InferenceComponentDataCacheConfigProperty]dataCacheConfigoptionalIResolvableDataCacheConfigoptionalIResolvableDataCacheConfigoptionalinterface{} #Settings that affect how the inference component caches data.
instanceTypestringinstance_typestrinstanceTypeStringInstanceTypestringInstanceType*string required #An ML compute instance type.
modelNameoptionalstringmodel_nameoptionalstrmodelNameoptionalStringModelNameoptionalstringModelNameoptional*string #The name of the model to use with the inference component.
schedulingConfigoptionalIResolvable | CfnInferenceComponent.scheduling_configoptionaltyping.Union[IResolvable, InferenceComponentSchedulingConfigProperty]schedulingConfigoptionalIResolvableSchedulingConfigoptionalIResolvableSchedulingConfigoptionalinterface{} #The scheduling configuration that determines how inference component copies are placed across available instances.
startupParametersoptionalIResolvable | CfnInferenceComponent.startup_parametersoptionaltyping.Union[IResolvable, InferenceComponentStartupParametersProperty]startupParametersoptionalIResolvableStartupParametersoptionalIResolvableStartupParametersoptionalinterface{} #