Environment variable to ProcessingJob in AWS Step function

0

I want to use pass variables to Sagemaker processsing job step in Step Functions.

This is the step function:

{
  "StartAt": "SageMaker CreateProcessingJob",
  "States": {
    "SageMaker CreateProcessingJob": {
      "Resource": "arn:aws:states:::sagemaker:createProcessingJob.sync",
      "Parameters": {
        "ProcessingResources": {
          "ClusterConfig": {
            "InstanceCount": 1,
            "InstanceType": "ml.m5.xlarge",
            "VolumeSizeInGB": 10
          }
        },
        "Environment": {
          "deviceENV": "retailWebplayer"
        },
        "AppSpecification": {
          "ImageUri": "<>.amazonaws.com/ecr-custom-image:latest",
          "ContainerEntrypoint": [
            "python3",
            "/opt/ml/processing/input/code/train-device-env.py"
          ]
        },
        "ProcessingInputs": [
          {
            "InputName": "code",
            "S3Input": {
              "S3Uri": "s3://<>/train-device-env.py",
              "LocalPath": "/opt/ml/processing/input/code",
              "S3DataType": "S3Prefix",
              "S3InputMode": "File",
              "S3DataDistributionType": "FullyReplicated",
              "S3CompressionType": "None"
            }
          }
        ],
        "StoppingCondition": {
          "MaxRuntimeInSeconds": 300
        },
        "RoleArn": "<>",
        "ProcessingJobName.$": "$$.Execution.Name"
      },
      "Type": "Task",
      "End": true
    }
  }
}

Is it better to use environment variables or parameters? Can we use parameters in this case and how?

No Answers

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