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?

Keine Antworten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen