SageMaker Training Job CloudFormation Issue

0

Hi AWS,

I have the cloudformation code for AWS SageMaker Training Job which is provided below:

TensorFlowTrainingJob:
    Type: AWS::SageMaker::TrainingJob
    Properties:
      TrainingJobName: my-tensorflow-training-job
      AlgorithmSpecification:
        TrainingImage: <ecr-uri>
        TrainingInputMode: File
      RoleArn: SageMakerRole.Arn
      InputDataConfig:
        - ChannelName: train_normal
          DataSource:
            S3DataSource:
              S3DataType: S3Prefix
              S3Uri: <s3-uri>
        - ChannelName: train_pneumonia
          DataSource:
            S3DataSource:
              S3DataType: S3Prefix
              S3Uri: <s3-uri>
      OutputDataConfig:
        S3OutputPath: <s3-uri>
      ResourceConfig:
        InstanceCount: 1
        InstanceType: ml.m4.xlarge
        VolumeSizeInGB: 50
      StoppingCondition:
        MaxRuntimeInSeconds: 3600
      HyperParameters:
        epochs: "50"
        learning_rate: "0.001"

But I am experiencing this issue:

[cfn-lint] E3001: Invalid or unsupported Type AWS::SageMaker::TrainingJob for resource TensorFlowTrainingJob in us-east-1

The linter version I am using is cfn-lint 0.70.1

Can you please suggest what should be the quickfix as I have checked a lot of things on internet but have not found any valid solution for the same.

1 Answer
0

I don't believe Training jobs are a supported resource in CloudFormation (which is why you're seeing the unsupported type error). This here is the list of supported SageMaker resources - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/AWS_SageMaker.html

If it is essential for you to create the job through CloudFormation, you could probably create a Lambda custom resource and use the boto3 SDK to create a training job. Reference - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources-lambda.html

AWS
Durga_S
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions