Sha256: 5c9ab1e4ed38f4299a66eb1d6ddfd1f9e8a52c084fe8d16869d5b4ab7b3f9054

Contents?: true

Size: 880 Bytes

Versions: 3

Compression:

Stored size: 880 Bytes

Contents

require "logstash/devutils/rspec/spec_helper"
require "logstash/inputs/cloudwatch"
require "aws-sdk"

describe LogStash::Inputs::CloudWatch, :integration => true do

  let(:settings)  {  { "access_key_id" => ENV['AWS_ACCESS_KEY_ID'],
                       "secret_access_key" => LogStash::Util::Password.new(ENV['AWS_SECRET_ACCESS_KEY']),
                       "region" => ENV["AWS_REGION"] || "us-east-1",
                       "namespace" => "AWS/S3",
                       'filters' => { "BucketName" => "*"},
                       'metrics' => ["BucketSizeBytes","NumberOfObjects"]

  }}

  def metrics_for(settings)
    cw = LogStash::Inputs::CloudWatch.new(settings)
    cw.register
    cw.send('metrics_for', settings['namespace'])
  end

  #
  it "should not raise a type error when using a password" do
    expect{metrics_for(settings)}.not_to raise_error
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
logstash-input-cloudwatch-2.2.4 spec/integration/cloudwatch_spec.rb
logstash-input-cloudwatch-2.2.3 spec/integration/cloudwatch_spec.rb
logstash-input-cloudwatch-2.2.2 spec/integration/cloudwatch_spec.rb