Esempio n. 1
0
def run(dry_run=False,
        thread_pool_size=10,
        disable_service_account_keys=False,
        defer=None):
    accounts = queries.get_aws_accounts()
    settings = queries.get_app_interface_settings()
    aws = AWSApi(thread_pool_size, accounts, settings=settings)
    keys_to_delete = get_keys_to_delete(accounts)
    working_dirs = init_tf_working_dirs(accounts, thread_pool_size, settings)
    defer(lambda: cleanup(working_dirs))
    error = aws.delete_keys(dry_run, keys_to_delete, working_dirs,
                            disable_service_account_keys)
    if error:
        sys.exit(1)
def run(dry_run=False, thread_pool_size=10, enable_deletion=False):
    aws = AWSApi(thread_pool_size)
    keys_to_delete = fetch_keys_to_delete()
    aws.delete_keys(dry_run, keys_to_delete)