Skip to content

Instantly share code, notes, and snippets.

@ojacques
Created October 3, 2023 17:03
Show Gist options
  • Save ojacques/7992f17d6a32afd9dabbd3526f305bf4 to your computer and use it in GitHub Desktop.
Save ojacques/7992f17d6a32afd9dabbd3526f305bf4 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[?AppType=='KernelGateway' && Status=='InService']" | jq -r '.[] | "\(.AppName) \(.DomainId) \(.UserProfileName)"' | while read AppName DomainId UserProfileName; do echo Deleting $AppName for user $UserProfileName ... && aws sagemaker delete-app --domain-id $DomainId --app-type KernelGateway --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