Class CfnInferenceComponent
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.CfnElement
software.amazon.awscdk.CfnRefElement
software.amazon.awscdk.CfnResource
software.amazon.awscdk.services.sagemaker.CfnInferenceComponent
- All Implemented Interfaces:
IInspectable
,ITaggableV2
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2025-01-15T21:09:26.752Z")
@Stability(Stable)
public class CfnInferenceComponent
extends CfnResource
implements IInspectable, ITaggableV2
Creates an inference component, which is a SageMaker AI hosting object that you can use to deploy a model to an endpoint.
In the inference component settings, you specify the model, the endpoint, and how the model utilizes the resources that the endpoint hosts. You can optimize resource utilization by tailoring how the required CPU cores, accelerators, and memory are allocated. You can deploy multiple inference components to an endpoint, where each inference component contains one model and the resource utilization needs for that individual model. After you deploy an inference component, you can directly invoke the associated model when you use the InvokeEndpoint API action.
Example:
// 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.*; CfnInferenceComponent cfnInferenceComponent = CfnInferenceComponent.Builder.create(this, "MyCfnInferenceComponent") .endpointName("endpointName") .specification(InferenceComponentSpecificationProperty.builder() .baseInferenceComponentName("baseInferenceComponentName") .computeResourceRequirements(InferenceComponentComputeResourceRequirementsProperty.builder() .maxMemoryRequiredInMb(123) .minMemoryRequiredInMb(123) .numberOfAcceleratorDevicesRequired(123) .numberOfCpuCoresRequired(123) .build()) .container(InferenceComponentContainerSpecificationProperty.builder() .artifactUrl("artifactUrl") .deployedImage(DeployedImageProperty.builder() .resolutionTime("resolutionTime") .resolvedImage("resolvedImage") .specifiedImage("specifiedImage") .build()) .environment(Map.of( "environmentKey", "environment")) .image("image") .build()) .modelName("modelName") .startupParameters(InferenceComponentStartupParametersProperty.builder() .containerStartupHealthCheckTimeoutInSeconds(123) .modelDataDownloadTimeoutInSeconds(123) .build()) .build()) // the properties below are optional .endpointArn("endpointArn") .inferenceComponentName("inferenceComponentName") .runtimeConfig(InferenceComponentRuntimeConfigProperty.builder() .copyCount(123) .currentCopyCount(123) .desiredCopyCount(123) .build()) .tags(List.of(CfnTag.builder() .key("key") .value("value") .build())) .variantName("variantName") .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnInferenceComponent
.static interface
Gets the Amazon EC2 Container Registry path of the docker image of the model that is hosted in this ProductionVariant .static interface
Defines the compute resources to allocate to run a model, plus any adapter models, that you assign to an inference component.static interface
Defines a container that provides the runtime environment for a model that you deploy with an inference component.static interface
Runtime settings for a model that is deployed with an inference component.static interface
Details about the resources to deploy with this inference component, including the model, container, and compute resources.static interface
Settings that take effect while the model container starts up.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggableV2
ITaggableV2.Jsii$Default, ITaggableV2.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnInferenceComponent
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnInferenceComponent
(software.amazon.jsii.JsiiObjectRef objRef) CfnInferenceComponent
(software.constructs.Construct scope, String id, CfnInferenceComponentProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe time when the inference component was created.The failure reason if the inference component is in a failed state.The Amazon Resource Name (ARN) of the inference component.The status of the inference component.The time when the inference component was last updated.The number of runtime copies of the model container that are currently deployed.The number of runtime copies of the model container that you requested to deploy with the inference component.Tag Manager which manages the tags for this resource.The Amazon Resource Name (ARN) of the endpoint that hosts the inference component.The name of the endpoint that hosts the inference component.The name of the inference component.The runtime config for the inference component.The specification for the inference component.getTags()
An array of tags to apply to the resource.The name of the production variant that hosts the inference component.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setEndpointArn
(String value) The Amazon Resource Name (ARN) of the endpoint that hosts the inference component.void
setEndpointName
(String value) The name of the endpoint that hosts the inference component.void
setInferenceComponentName
(String value) The name of the inference component.void
setRuntimeConfig
(IResolvable value) The runtime config for the inference component.void
The runtime config for the inference component.void
setSpecification
(IResolvable value) The specification for the inference component.void
The specification for the inference component.void
An array of tags to apply to the resource.void
setVariantName
(String value) The name of the production variant that hosts the inference component.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnInferenceComponent
protected CfnInferenceComponent(software.amazon.jsii.JsiiObjectRef objRef) -
CfnInferenceComponent
protected CfnInferenceComponent(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnInferenceComponent
@Stability(Stable) public CfnInferenceComponent(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnInferenceComponentProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrCreationTime
The time when the inference component was created. -
getAttrFailureReason
The failure reason if the inference component is in a failed state. -
getAttrInferenceComponentArn
The Amazon Resource Name (ARN) of the inference component. -
getAttrInferenceComponentStatus
The status of the inference component. -
getAttrLastModifiedTime
The time when the inference component was last updated. -
getAttrRuntimeConfigCurrentCopyCount
The number of runtime copies of the model container that are currently deployed. -
getAttrRuntimeConfigDesiredCopyCount
The number of runtime copies of the model container that you requested to deploy with the inference component. -
getAttrSpecificationContainerDeployedImage
-
getCdkTagManager
Tag Manager which manages the tags for this resource.- Specified by:
getCdkTagManager
in interfaceITaggableV2
-
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getEndpointName
The name of the endpoint that hosts the inference component. -
setEndpointName
The name of the endpoint that hosts the inference component. -
getSpecification
The specification for the inference component. -
setSpecification
The specification for the inference component. -
setSpecification
@Stability(Stable) public void setSpecification(@NotNull CfnInferenceComponent.InferenceComponentSpecificationProperty value) The specification for the inference component. -
getEndpointArn
The Amazon Resource Name (ARN) of the endpoint that hosts the inference component. -
setEndpointArn
The Amazon Resource Name (ARN) of the endpoint that hosts the inference component. -
getInferenceComponentName
The name of the inference component. -
setInferenceComponentName
The name of the inference component. -
getRuntimeConfig
The runtime config for the inference component. -
setRuntimeConfig
The runtime config for the inference component. -
setRuntimeConfig
@Stability(Stable) public void setRuntimeConfig(@Nullable CfnInferenceComponent.InferenceComponentRuntimeConfigProperty value) The runtime config for the inference component. -
getTags
An array of tags to apply to the resource. -
setTags
An array of tags to apply to the resource. -
getVariantName
The name of the production variant that hosts the inference component. -
setVariantName
The name of the production variant that hosts the inference component.
-