Skip to content

Instantly share code, notes, and snippets.

@non7top
Forked from ojacques/aws-sagemaker-delete-apps.sh
Last active November 22, 2024 07:31
Show Gist options
  • Save non7top/236bc900ef0bb5d61135922251e5e281 to your computer and use it in GitHub Desktop.
Save non7top/236bc900ef0bb5d61135922251e5e281 to your computer and use it in GitHub Desktop.
List and delete all Amazon SageMaker KernelGateway apps which are still running
aws sagemaker list-apps --query "Apps[?Status=='InService']" | jq -r '.[] | "\(.AppName) \(.DomainId) \(.UserProfileName) \(.AppType)"' | \
while read AppName DomainId UserProfileName AppType; do \
echo Deleting $AppName for user $UserProfileName ... && \
aws sagemaker delete-app --domain-id $DomainId --app-type $AppType --app-name $AppName --user-profile $UserProfileName; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment