Sha256: e920e5df0a1c8a49eb43ba68cb7be2d6b794c544b0f52d901e2fc1cdc1dfcab8

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

require_relative 'aws_log_cleaner/cloud_watch_logs'
require_relative 'aws_log_cleaner/log_group_cleaner'
require_relative 'aws_log_cleaner/api_gateway'
require_relative 'aws_log_cleaner/api_gateway_retriever'
require_relative 'aws_log_cleaner/log_group_filterer'
require_relative 'aws_log_cleaner/aws_credentials'
require_relative 'aws_log_cleaner/version'

module AwsLogCleaner
  class AwsLogCleaner
    def initialize(credentials_args, like, clean_orphans)
      credentials = AwsCredentials.new(credentials_args)
      cloud_watch_logs = CloudWatchLogs.new(credentials)
      api_gateway = ApiGateway.new(credentials)

      api_retriever = ApiGatewayRetriever.new(api_gateway)
      log_group_filterer = LogGroupFilterer.new(cloud_watch_logs)

      @log_cleaner = LogGroupCleaner.new(
        cloud_watch_logs,
        api_retriever,
        log_group_filterer,
        like,
        clean_orphans
      )
    end

    def plan
      @log_cleaner.plan
    end

    def delete
      @log_cleaner.delete
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws_log_cleaner-0.2.1 lib/aws_log_cleaner.rb
aws_log_cleaner-0.2.0 lib/aws_log_cleaner.rb
aws_log_cleaner-0.1.8 lib/aws_log_cleaner.rb