How to Approve a SageMaker Model in AWS CLI


Sometimes you will need to manually approve a SageMaker model package from the AWS CLI.

Step 1 – Get a list of the available packages

aws sagemaker list-model-packages --model-package-group-name "the-model-package-group"

This will produce the following output:

{
  "ModelPackageSummaryList": [
    {
      "ModelPackageGroupName": "...",
      "ModelPackageVersion": "...",
      "ModelPackageArn": "the-arn-we-will-use-below",
      "ModelPackageDescription": "...",
      "CreationTime": "...",
      "ModelPackageStatus": "Completed",
      "ModelApprovalStatus": "PendingManualApproval"
    },
    ...
  ]
}

Step 2 – Approve the model

aws sagemaker update-model-package --model-package-arn <ARN-FROM-ABOVE> --model-approval-status Approved