Sha256: ac53fe6faa50f629f342a1adb5a1db9417a4aaa5f00c332019e57f87f1442e8e

Contents?: true

Size: 585 Bytes

Versions: 6

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

require 'aws-sdk-cloudwatchlogs'

module ContainerShip
  module Command
    module Modules
      module Cloudwatch
        def show_log(task_definition, task_arn)
          return if task_definition.log_group_name.nil? || task_definition.log_stream_name(task_arn).nil?

          Aws::CloudWatchLogs::Client.new.get_log_events(
            log_group_name: task_definition.log_group_name,
            log_stream_name: task_definition.log_stream_name(task_arn)
          ).events.map(&:message).each(&method(:puts))
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
container_ship-0.1.6 lib/container_ship/command/modules/cloudwatch.rb
container_ship-0.1.5 lib/container_ship/command/modules/cloudwatch.rb
container_ship-0.1.4 lib/container_ship/command/modules/cloudwatch.rb
container_ship-0.1.3 lib/container_ship/command/modules/cloudwatch.rb
container_ship-0.1.2 lib/container_ship/command/modules/cloudwatch.rb
container_ship-0.1.1 lib/container_ship/command/modules/cloudwatch.rb