def lambda_handler()

in Starter-Code/clean-sm-resources.py [0:0]


def lambda_handler(event, context):

    client = boto3.client('sagemaker')
    
    endpoint_names = get_endpoint_names(client)
    
    delete_endpoints(client, endpoint_names)

    notebook_names = get_notebook_names(client, 'InService')

    stop_notebook_instances(client, notebook_names)

    return {
        'statusCode': 200,
        'body': json.dumps('Completed lambda function to clean workshop.')
    }