Sha256: 3bbc9a8dce9519552ba77be3fd49d8d71d15b1e316f7442017af3547c0dd16fe

Contents?: true

Size: 887 Bytes

Versions: 5

Compression:

Stored size: 887 Bytes

Contents

module Awspec::Type
  class CloudwatchLogs < ResourceBase
    def resource_via_client
      @resource_via_client ||= find_cloudwatch_logs_group(@display_name)
    end

    def id
      @id ||= resource_via_client.log_group_name if resource_via_client
    end

    def has_log_stream?(stream_name)
      ret = find_cloudwatch_logs_stream_by_log_group_name(@id).log_stream_name
      return true if ret == stream_name
    end

    def has_metric_filter?(filter_name)
      ret = find_cloudwatch_logs_metric_fileter_by_log_group_name(@id, filter_name).filter_name
      return true if ret == filter_name
    end

    def has_subscription_filter?(filter_name, pattern = nil)
      ret = find_cloudwatch_logs_subscription_fileter_by_log_group_name(@id, filter_name)
      return false unless ret.filter_pattern == pattern
      return true if ret.filter_name == filter_name
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
awspec-0.73.1 lib/awspec/type/cloudwatch_logs.rb
awspec-0.73.0 lib/awspec/type/cloudwatch_logs.rb
awspec-0.72.0 lib/awspec/type/cloudwatch_logs.rb
awspec-0.71.0 lib/awspec/type/cloudwatch_logs.rb
awspec-0.70.0 lib/awspec/type/cloudwatch_logs.rb