Skip to content

Instantly share code, notes, and snippets.

@potter0815
Created November 25, 2019 13:55
Show Gist options
  • Save potter0815/2ca8e3b9cd86e68dc86a36859461392f to your computer and use it in GitHub Desktop.
Save potter0815/2ca8e3b9cd86e68dc86a36859461392f to your computer and use it in GitHub Desktop.
shutdown a sagemaker notebook instance from within a Jupyter notebook
# in a code block
%%sh
NOTEBOOK_NAME=$(jq '.ResourceName' /opt/ml/metadata/resource-metadata.json --raw-output)
aws sagemaker stop-notebook-instance --notebook-instance-name $NOTEBOOK_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment