def delete_s3_bucket ( client , resource ) : if dbconfig . get ( 'enable_delete_s3_buckets' , NS_AUDITOR_REQUIRED_TAGS , False ) : client . delete_bucket ( Bucket = resource . id ) return ActionStatus . SUCCEED , resource . metrics ( )
python script to delete s3 files
Delete an S3 bucket
def delete_s3_bucket(client, resource):
    """Delete an S3 bucket

    This function will try to delete an S3 bucket

    Args:
        client (:obj:`boto3.session.Session.client`): A boto3 client object
        resource (:obj:`Resource`): The resource object to terminate

    Returns:
        `ActionStatus`
    """

    if dbconfig.get('enable_delete_s3_buckets', NS_AUDITOR_REQUIRED_TAGS, False):
        client.delete_bucket(Bucket=resource.id)
    return ActionStatus.SUCCEED, resource.metrics()