Sha256: 9e12868893b8b36fa03fd9506025595655c613dad0d84530c864956e9eaef0bd

Contents?: true

Size: 1.15 KB

Versions: 28

Compression:

Stored size: 1.15 KB

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, 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)
      if pattern.nil?
        return true if ret.filter_name == filter_name
      else
        return false unless ret.filter_pattern == pattern
      end
      return true if ret.filter_name == filter_name
    end

    def has_tag?(tag_key, tag_value)
      find_tags_by_log_group_name(resource_via_client.log_group_name).find do |key, value|
        key == tag_key && value == tag_value
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 3 rubygems

Version Path
awspec-1.24.3 lib/awspec/type/cloudwatch_logs.rb
awspec-1.24.2 lib/awspec/type/cloudwatch_logs.rb
awspec-1.24.1 lib/awspec/type/cloudwatch_logs.rb
awspec-1.24.0 lib/awspec/type/cloudwatch_logs.rb
awspec-1.23.0 lib/awspec/type/cloudwatch_logs.rb
awspec-1.22.1 lib/awspec/type/cloudwatch_logs.rb
awspec-1.22.0 lib/awspec/type/cloudwatch_logs.rb
awspec-1.21.1 lib/awspec/type/cloudwatch_logs.rb
awspec-1.21.0 lib/awspec/type/cloudwatch_logs.rb
awspec-1.20.0 lib/awspec/type/cloudwatch_logs.rb
awspec-1.19.2 lib/awspec/type/cloudwatch_logs.rb
awspec-1.19.1 lib/awspec/type/cloudwatch_logs.rb
awspec-1.19.0 lib/awspec/type/cloudwatch_logs.rb
cthiesfork-awspec-1.2.4 lib/awspec/type/cloudwatch_logs.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/type/cloudwatch_logs.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/type/cloudwatch_logs.rb
awspec-1.18.6 lib/awspec/type/cloudwatch_logs.rb
cthiesfork-awspec-1.2.2 lib/awspec/type/cloudwatch_logs.rb
cthiesfork-awspec-1.2.1 lib/awspec/type/cloudwatch_logs.rb
awspec-1.18.5 lib/awspec/type/cloudwatch_logs.rb