# InferenceComponentSpecificationProperty

Details about the resources to deploy with this inference component, including the model, container, and compute resources.

- Source: Generated at build time
- Type last changed: v2.268.0 · 2 Sep 2026

## Example

TypeScript:

```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 inferenceComponentSpecificationProperty: sagemaker.CfnInferenceComponent.InferenceComponentSpecificationProperty = {
  baseInferenceComponentName: 'baseInferenceComponentName',
  computeResourceRequirements: {
    maxMemoryRequiredInMb: 123,
    minMemoryRequiredInMb: 123,
    numberOfAcceleratorDevicesRequired: 123,
    numberOfCpuCoresRequired: 123,
  },
  container: {
    artifactUrl: 'artifactUrl',
    containerMetricsConfig: {
      metricsEndpoints: [{
        metricsEndpointPath: 'metricsEndpointPath',

        // the properties below are optional
        metricPublishFrequencyInSeconds: 123,
      }],
    },
    deployedImage: {
      resolutionTime: 'resolutionTime',
      resolvedImage: 'resolvedImage',
      specifiedImage: 'specifiedImage',
    },
    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:

```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_property = sagemaker.CfnInferenceComponent.InferenceComponentSpecificationProperty(
    base_inference_component_name="baseInferenceComponentName",
    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.InferenceComponentContainerSpecificationProperty(
        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
            )]
        ),
        deployed_image=sagemaker.CfnInferenceComponent.DeployedImageProperty(
            resolution_time="resolutionTime",
            resolved_image="resolvedImage",
            specified_image="specifiedImage"
        ),
        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:

```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.*;

InferenceComponentSpecificationProperty inferenceComponentSpecificationProperty = InferenceComponentSpecificationProperty.builder()
        .baseInferenceComponentName("baseInferenceComponentName")
        .computeResourceRequirements(InferenceComponentComputeResourceRequirementsProperty.builder()
                .maxMemoryRequiredInMb(123)
                .minMemoryRequiredInMb(123)
                .numberOfAcceleratorDevicesRequired(123)
                .numberOfCpuCoresRequired(123)
                .build())
        .container(InferenceComponentContainerSpecificationProperty.builder()
                .artifactUrl("artifactUrl")
                .containerMetricsConfig(ContainerMetricsConfigProperty.builder()
                        .metricsEndpoints(List.of(MetricsEndpointProperty.builder()
                                .metricsEndpointPath("metricsEndpointPath")

                                // the properties below are optional
                                .metricPublishFrequencyInSeconds(123)
                                .build()))
                        .build())
                .deployedImage(DeployedImageProperty.builder()
                        .resolutionTime("resolutionTime")
                        .resolvedImage("resolvedImage")
                        .specifiedImage("specifiedImage")
                        .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();
```

C# / .NET:

```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 inferenceComponentSpecificationProperty = new InferenceComponentSpecificationProperty {
    BaseInferenceComponentName = "baseInferenceComponentName",
    ComputeResourceRequirements = new InferenceComponentComputeResourceRequirementsProperty {
        MaxMemoryRequiredInMb = 123,
        MinMemoryRequiredInMb = 123,
        NumberOfAcceleratorDevicesRequired = 123,
        NumberOfCpuCoresRequired = 123
    },
    Container = new InferenceComponentContainerSpecificationProperty {
        ArtifactUrl = "artifactUrl",
        ContainerMetricsConfig = new ContainerMetricsConfigProperty {
            MetricsEndpoints = new [] { new MetricsEndpointProperty {
                MetricsEndpointPath = "metricsEndpointPath",

                // the properties below are optional
                MetricPublishFrequencyInSeconds = 123
            } }
        },
        DeployedImage = new DeployedImageProperty {
            ResolutionTime = "resolutionTime",
            ResolvedImage = "resolvedImage",
            SpecifiedImage = "specifiedImage"
        },
        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
    }
};
```

Golang:

```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"

inferenceComponentSpecificationProperty := &InferenceComponentSpecificationProperty{
	BaseInferenceComponentName: jsii.String("baseInferenceComponentName"),
	ComputeResourceRequirements: &InferenceComponentComputeResourceRequirementsProperty{
		MaxMemoryRequiredInMb: jsii.Number(123),
		MinMemoryRequiredInMb: jsii.Number(123),
		NumberOfAcceleratorDevicesRequired: jsii.Number(123),
		NumberOfCpuCoresRequired: jsii.Number(123),
	},
	Container: &InferenceComponentContainerSpecificationProperty{
		ArtifactUrl: jsii.String("artifactUrl"),
		ContainerMetricsConfig: &ContainerMetricsConfigProperty{
			MetricsEndpoints: []interface{}{
				&MetricsEndpointProperty{
					MetricsEndpointPath: jsii.String("metricsEndpointPath"),

					// the properties below are optional
					MetricPublishFrequencyInSeconds: jsii.Number(123),
				},
			},
		},
		DeployedImage: &DeployedImageProperty{
			ResolutionTime: jsii.String("resolutionTime"),
			ResolvedImage: jsii.String("resolvedImage"),
			SpecifiedImage: jsii.String("specifiedImage"),
		},
		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

- `baseInferenceComponentName`: string — The name of an existing inference component that is to contain the inference component that you're creating with your request.

  Specify this parameter only if your request is meant to create an adapter inference component. An adapter inference component contains the path to an adapter model. The purpose of the adapter model is to tailor the inference output of a base foundation model, which is hosted by the base inference component. The adapter inference component uses the compute resources that you assigned to the base inference component.

  When you create an adapter inference component, use the `Container` parameter to specify the location of the adapter artifacts. In the parameter value, use the `ArtifactUrl` parameter of the `InferenceComponentContainerSpecification` data type.

  Before you can create an adapter inference component, you must have an existing inference component that contains the foundation model that you want to adapt.

- `computeResourceRequirements`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInferenceComponent.InferenceComponentComputeResourceRequirementsProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnInferenceComponent.InferenceComponentComputeResourceRequirementsProperty.html) — The compute resources allocated to run the model, plus any adapter models, that you assign to the inference component.

  Omit this parameter if your request is meant to create an adapter inference component. An adapter inference component is loaded by a base inference component, and it uses the compute resources of the base inference component.

- `container`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInferenceComponent.InferenceComponentContainerSpecificationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnInferenceComponent.InferenceComponentContainerSpecificationProperty.html) — Defines a container that provides the runtime environment for a model that you deploy with an inference component.

- `currentDataCacheConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInferenceComponent.InferenceComponentDataCacheConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnInferenceComponent.InferenceComponentDataCacheConfigProperty.html) — Settings that affect how the inference component caches data.

- `dataCacheConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInferenceComponent.InferenceComponentDataCacheConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnInferenceComponent.InferenceComponentDataCacheConfigProperty.html) — Settings that affect how the inference component caches data.

- `modelName`: string — The name of an existing SageMaker AI model object in your account that you want to deploy with the inference component.

- `schedulingConfig`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInferenceComponent.InferenceComponentSchedulingConfigProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnInferenceComponent.InferenceComponentSchedulingConfigProperty.html) — The scheduling configuration that determines how inference component copies are placed across available instances.

- `startupParameters`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnInferenceComponent.InferenceComponentStartupParametersProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_sagemaker.CfnInferenceComponent.InferenceComponentStartupParametersProperty.html) — Settings that take effect while the model container starts up.
