diff --git a/sagemaker-datawrangler/timeseries-dataflow/TS-Workshop-Cleanup.ipynb b/sagemaker-datawrangler/timeseries-dataflow/TS-Workshop-Cleanup.ipynb deleted file mode 100644 index 9e960744dd..0000000000 --- a/sagemaker-datawrangler/timeseries-dataflow/TS-Workshop-Cleanup.ipynb +++ /dev/null @@ -1,168 +0,0 @@ -{ - "cells": [ - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "# This notebook removes cost incurring resources\n", - "
💡This is a very important notebook
\n", - "\n", - "Run this notebook after you completed Data Wrangler time series lab. If you do this workshop in your own account, you must clean up used resources to avoid charges.\n", - "\n", - "Before closing this workshop you have to stop Data Wrangler instance, stop Studio kernel and remove S3 bucket to prevent unexpected charges. " - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Stop Data Wrangler and Studio compute instance\n", - "To stop DataWrangler and Studio kernels:\n", - "1. Click on \"Running termanals and kernerls\" button on a left plane \\\n", - "![kernelButton](./pictures/kernelButton.png)\n", - "1. Click on \"Shut down\" buttons next to running instances. \n", - "![runningInstances](./pictures/runningInstances.png)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Remove workshop S3 bucket\n", - "Now it is a time to remove S3 bucket we created for the workshop and all files in it. \n", - "\n", - "
💡This is a destructive operation. All data in the S3 bucket will be deleted!
" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": {}, - "outputs": [], - "source": [ - "%store -r bucket_name\n", - "\n", - "try:\n", - " bucket_name\n", - "except NameError:\n", - " print(f'there is no S3 bucket name stored. ')" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "The all content and the bucket s3://906545278380-us-east-1-datawranglertimeseries-1284 will be deleted. Are you sure (y/n)?\n" - ] - }, - { - "name": "stdin", - "output_type": "stream", - "text": [ - " n\n" - ] - } - ], - "source": [ - "import boto3\n", - "\n", - "# Last step is to remove data in S3 bucket. \n", - "print(f'The all content and the bucket s3://{bucket_name} will be deleted. Are you sure (y/n)?')\n", - "\n", - "choice = input()\n", - "if choice == 'y':\n", - " print(f'deleting the bucket s3://{bucket_name}')\n", - " s3 = boto3.resource('s3')\n", - " bucket = s3.Bucket(bucket_name)\n", - " bucket.objects.all().delete()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Shut down the notebook kernel" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - "

Shutting down your kernel for this notebook to release resources.

\n", - "\n", - " \n", - "\n" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "%%html\n", - "\n", - "

Shutting down your kernel for this notebook to release resources.

\n", - "\n", - " \n", - "" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (Data Science)", - "language": "python", - "name": "python3__SAGEMAKER_INTERNAL__arn:aws:sagemaker:us-east-1:081325390199:image/datascience-1.0" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.7.10" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -}