Class CfnAlgorithm

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IInspectable, IEnvironmentAware, IAlgorithmRef, ITaggableV2, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.138.0 (build 0ca7ee8)", date="2026-07-24T11:46:53.979Z") @Stability(Stable) public class CfnAlgorithm extends CfnResource implements IInspectable, IAlgorithmRef, ITaggableV2
Resource Type definition for AWS::SageMaker::Algorithm.

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.*;
 CfnAlgorithm cfnAlgorithm = CfnAlgorithm.Builder.create(this, "MyCfnAlgorithm")
         .algorithmName("algorithmName")
         .trainingSpecification(TrainingSpecificationProperty.builder()
                 .supportedTrainingInstanceTypes(List.of("supportedTrainingInstanceTypes"))
                 .trainingChannels(List.of(ChannelSpecificationProperty.builder()
                         .name("name")
                         .supportedContentTypes(List.of("supportedContentTypes"))
                         .supportedInputModes(List.of("supportedInputModes"))
                         // the properties below are optional
                         .description("description")
                         .isRequired(false)
                         .supportedCompressionTypes(List.of("supportedCompressionTypes"))
                         .build()))
                 .trainingImage("trainingImage")
                 // the properties below are optional
                 .metricDefinitions(List.of(MetricDefinitionProperty.builder()
                         .name("name")
                         .regex("regex")
                         .build()))
                 .supportedHyperParameters(List.of(HyperParameterSpecificationProperty.builder()
                         .name("name")
                         .type("type")
                         // the properties below are optional
                         .defaultValue("defaultValue")
                         .description("description")
                         .isRequired(false)
                         .isTunable(false)
                         .range(ParameterRangeProperty.builder()
                                 .categoricalParameterRangeSpecification(CategoricalParameterRangeSpecificationProperty.builder()
                                         .values(List.of("values"))
                                         .build())
                                 .continuousParameterRangeSpecification(ContinuousParameterRangeSpecificationProperty.builder()
                                         .maxValue("maxValue")
                                         .minValue("minValue")
                                         .build())
                                 .integerParameterRangeSpecification(IntegerParameterRangeSpecificationProperty.builder()
                                         .maxValue("maxValue")
                                         .minValue("minValue")
                                         .build())
                                 .build())
                         .build()))
                 .supportedTuningJobObjectiveMetrics(List.of(HyperParameterTuningJobObjectiveProperty.builder()
                         .metricName("metricName")
                         .type("type")
                         .build()))
                 .supportsDistributedTraining(false)
                 .trainingImageDigest("trainingImageDigest")
                 .build())
         // the properties below are optional
         .algorithmDescription("algorithmDescription")
         .certifyForMarketplace(false)
         .inferenceSpecification(InferenceSpecificationProperty.builder()
                 .containers(List.of(ModelPackageContainerDefinitionProperty.builder()
                         .image("image")
                         // the properties below are optional
                         .containerHostname("containerHostname")
                         .environment(Map.of(
                                 "environmentKey", "environment"))
                         .framework("framework")
                         .frameworkVersion("frameworkVersion")
                         .imageDigest("imageDigest")
                         .isCheckpoint(false)
                         .modelInput(ModelInputProperty.builder()
                                 .dataInputConfig("dataInputConfig")
                                 .build())
                         .nearestModelName("nearestModelName")
                         .build()))
                 // the properties below are optional
                 .supportedContentTypes(List.of("supportedContentTypes"))
                 .supportedRealtimeInferenceInstanceTypes(List.of("supportedRealtimeInferenceInstanceTypes"))
                 .supportedResponseMimeTypes(List.of("supportedResponseMimeTypes"))
                 .supportedTransformInstanceTypes(List.of("supportedTransformInstanceTypes"))
                 .build())
         .tags(List.of(CfnTag.builder()
                 .key("key")
                 .value("value")
                 .build()))
         .build();
 

See Also:
  • Field Details

    • CFN_RESOURCE_TYPE_NAME

      @Stability(Stable) public static final String CFN_RESOURCE_TYPE_NAME
      The CloudFormation resource type name for this resource class.
  • Constructor Details

    • CfnAlgorithm

      protected CfnAlgorithm(software.amazon.jsii.JsiiObjectRef objRef)
    • CfnAlgorithm

      protected CfnAlgorithm(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • CfnAlgorithm

      @Stability(Stable) public CfnAlgorithm(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnAlgorithmProps props)
      Create a new AWS::SageMaker::Algorithm.

      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

    • arnForAlgorithm

      @Stability(Stable) @NotNull public static String arnForAlgorithm(@NotNull IAlgorithmRef resource)
      Parameters:
      resource - This parameter is required.
    • isCfnAlgorithm

      @Stability(Stable) @NotNull public static Boolean isCfnAlgorithm(@NotNull Object x)
      Checks whether the given object is a CfnAlgorithm.

      Parameters:
      x - This parameter is required.
    • inspect

      @Stability(Stable) public void inspect(@NotNull TreeInspector inspector)
      Examines the CloudFormation resource and discloses attributes.

      Specified by:
      inspect in interface IInspectable
      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 class CfnResource
      Parameters:
      props - This parameter is required.
    • getAlgorithmRef

      @Stability(Stable) @NotNull public AlgorithmReference getAlgorithmRef()
      A reference to a Algorithm resource.
      Specified by:
      getAlgorithmRef in interface IAlgorithmRef
    • getAttrAlgorithmArn

      @Stability(Stable) @NotNull public String getAttrAlgorithmArn()
      The Amazon Resource Name (ARN) of the algorithm.
    • getAttrCreationTime

      @Stability(Stable) @NotNull public String getAttrCreationTime()
      A timestamp specifying when the algorithm was created.
    • getCdkTagManager

      @Stability(Stable) @NotNull public TagManager getCdkTagManager()
      Tag Manager which manages the tags for this resource.
      Specified by:
      getCdkTagManager in interface ITaggableV2
    • getCfnProperties

      @Stability(Stable) @NotNull protected Map<String,Object> getCfnProperties()
      Overrides:
      getCfnProperties in class CfnResource
    • getCfnPropertyNames

      @Stability(Stable) @NotNull protected Map<String,String> getCfnPropertyNames()
      Overrides:
      getCfnPropertyNames in class CfnResource
    • getAlgorithmName

      @Stability(Stable) @NotNull public String getAlgorithmName()
      The name of the algorithm.
    • setAlgorithmName

      @Stability(Stable) public void setAlgorithmName(@NotNull String value)
      The name of the algorithm.
    • getTrainingSpecification

      @Stability(Stable) @NotNull public Object getTrainingSpecification()
    • setTrainingSpecification

      @Stability(Stable) public void setTrainingSpecification(@NotNull IResolvable value)
    • setTrainingSpecification

      @Stability(Stable) public void setTrainingSpecification(@NotNull CfnAlgorithm.TrainingSpecificationProperty value)
    • getAlgorithmDescription

      @Stability(Stable) @Nullable public String getAlgorithmDescription()
      A description of the algorithm.
    • setAlgorithmDescription

      @Stability(Stable) public void setAlgorithmDescription(@Nullable String value)
      A description of the algorithm.
    • getCertifyForMarketplace

      @Stability(Stable) @Nullable public Object getCertifyForMarketplace()
      Whether to certify the algorithm so that it can be listed in AWS Marketplace.

      Returns union: either Boolean or IResolvable

    • setCertifyForMarketplace

      @Stability(Stable) public void setCertifyForMarketplace(@Nullable Boolean value)
      Whether to certify the algorithm so that it can be listed in AWS Marketplace.
    • setCertifyForMarketplace

      @Stability(Stable) public void setCertifyForMarketplace(@Nullable IResolvable value)
      Whether to certify the algorithm so that it can be listed in AWS Marketplace.
    • getInferenceSpecification

      @Stability(Stable) @Nullable public Object getInferenceSpecification()
    • setInferenceSpecification

      @Stability(Stable) public void setInferenceSpecification(@Nullable IResolvable value)
    • setInferenceSpecification

      @Stability(Stable) public void setInferenceSpecification(@Nullable CfnAlgorithm.InferenceSpecificationProperty value)
    • getTags

      @Stability(Stable) @Nullable public List<CfnTag> getTags()
      An array of key-value pairs to apply to this resource.
    • setTags

      @Stability(Stable) public void setTags(@Nullable List<CfnTag> value)
      An array of key-value pairs to apply to this resource.