def clean_dynamo_tables() -> list:
    """Main ordering for cleaning dynamo tables.

    Returns:
        A list of all terminated dynamo tables
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    dynamo_client = boto3.client(BOTO3_NAME)
    dynamo_tables = get_dynamo_tables(dynamo_client)
    terminated_dynamo_tables = delete_dynamo(dynamo_client, dynamo_tables)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_dynamo_tables)
    return terminated_dynamo_tables
def clean_resource() -> list:
    """Main ordering for cleaning resources.

    Returns:
        A list of all terminated resources
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    resource_client = boto3.client(BOTO3_NAME)
    resources = get_resources(resource_client)
    terminated_items = delete_resources(resource_client, resources)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_items)
    return terminated_items
def clean_ec2_instances() -> list:
    """Main ordering for cleaning instances.

    Returns:
        A list of all terminated instances
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    ec2_client = boto3.client(BOTO3_NAME)
    instances = get_instances(ec2_client)
    terminated_instances = delete_instances(instances)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_instances)
    return terminated_instances
def clean_dynamo_tables() -> list:
    """Main ordering for cleaning dynamo tables.

    Returns:
        A list of all terminated dynamo tables
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    dynamo_client = boto3.client(BOTO3_NAME)
    dynamo_tables = get_dynamo_tables(dynamo_client)
    terminated_dynamo_tables = delete_dynamo(dynamo_client, dynamo_tables)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_dynamo_tables)
    return terminated_dynamo_tables
예제 #5
0
def clean_redshift_clusters() -> list:
    """Main ordering for cleaning redshift clusters.

    Returns:
        A list of all terminated redshift resources
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    redshift_cluster = boto3.client(BOTO3_NAME)
    buckets = get_redshift_clusters(redshift_cluster)
    terminated_items = delete_redshift_clusters(redshift_cluster, buckets)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_items)
    return terminated_items
def clean_rds_instances() -> list:
    """Main ordering for cleaning rds_instances.

    Returns:
        A list of all terminated rds_instances
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    rds_client = boto3.client(BOTO3_NAME)
    rds_instances = get_rds(rds_client)
    terminated_rds_instances = delete_rds(rds_client, rds_instances)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_rds_instances)
    return terminated_rds_instances
def clean_lambda_functions() -> list:
    """Main ordering for cleaning lambda functions.

    Returns:
        A list of all terminated functions
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    lambda_client = boto3.client(BOTO3_NAME)
    functions = get_functions(lambda_client)
    terminated_functions = delete_functions(lambda_client, functions)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_functions)
    return terminated_functions
예제 #8
0
def clean_efs() -> list:
    """Main ordering for cleaning resources.

    Returns:
        A list of all terminated resources
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    efs_client = boto3.client(BOTO3_NAME)
    file_systems = get_file_systems(efs_client)
    terminated_file_systems = delete_file_systems(efs_client, file_systems)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_file_systems)
    return terminated_file_systems
예제 #9
0
def clean_efs() -> list:
    """Main ordering for cleaning resources.

    Returns:
        A list of all terminated resources
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    efs_client = boto3.client(BOTO3_NAME)
    file_systems = get_file_systems(efs_client)
    terminated_file_systems = delete_file_systems(efs_client, file_systems)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_file_systems)
    return terminated_file_systems
예제 #10
0
def clean_buckets() -> list:
    """Main ordering for cleaning s3 buckets.

    Returns:
        A list of all terminated buckets
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    s3_client = boto3.client(BOTO3_NAME)
    buckets = get_buckets(s3_client)
    terminated_items = delete_buckets(buckets)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_items)
    return terminated_items
def clean_ecs_clusters() -> list:
    """Main ordering for cleaning clusters.

    Returns:
        A list of all terminated clusters
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    ecs_client = boto3.client(BOTO3_NAME)
    clusters = get_ecs_clusters(ecs_client)
    terminated_clusters = delete_ecs_clusters(ecs_client, clusters)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_clusters)
    return terminated_clusters
예제 #12
0
def clean_ecs_clusters() -> list:
    """Main ordering for cleaning clusters.

    Returns:
        A list of all terminated clusters
    """
    helpers.starting_clean_print(RESOURCE_NAME)
    ecs_client = boto3.client(BOTO3_NAME)
    clusters = get_ecs_clusters(ecs_client)
    terminated_clusters = delete_ecs_clusters(ecs_client, clusters)
    helpers.finished_clean_print(RESOURCE_NAME, terminated_clusters)
    return terminated_clusters