Sha256: 10b3540dcc4a3ea8fec38eaf2a9b96d2876b4642e8a9ed49fba9f4484024842d

Contents?: true

Size: 1.11 KB

Versions: 32

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8
shared_context "setup plugin" do
  let(:temporary_directory) { Stud::Temporary.pathname }

  let(:bucket) { ENV["AWS_LOGSTASH_TEST_BUCKET"] }
  let(:access_key_id) {  ENV["AWS_ACCESS_KEY_ID"] }
  let(:secret_access_key) { ENV["AWS_SECRET_ACCESS_KEY"] }
  let(:size_file) { 100 }
  let(:time_file) { 100 }
  let(:tags) { [] }
  let(:prefix) { "home" }
  let(:region) { ENV['AWS_REGION'] }

  let(:main_options) do
    {
      "bucket" => bucket,
      "prefix" => prefix,
      "temporary_directory" => temporary_directory,
      "access_key_id" => access_key_id,
      "secret_access_key" => secret_access_key,
      "size_file" => size_file,
      "time_file" => time_file,
      "region" => region,
      "tags" => []
    }
  end

  let(:client_credentials) { Aws::Credentials.new(access_key_id, secret_access_key) }
  let(:bucket_resource) { Aws::S3::Bucket.new(bucket, { :credentials => client_credentials, :region => region }) }

  subject { LogStash::Outputs::S3.new(options) }
end

def clean_remote_files(prefix = "")
  bucket_resource.objects(:prefix => prefix).each do |object|
    object.delete
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
logstash-output-s3-4.3.7 spec/supports/helpers.rb
logstash-output-s3-4.3.6 spec/supports/helpers.rb
logstash-output-s3-4.3.5 spec/supports/helpers.rb
logstash-output-s3-4.3.4 spec/supports/helpers.rb
logstash-output-s3-4.3.3 spec/supports/helpers.rb
logstash-output-s3-4.3.2 spec/supports/helpers.rb
logstash-output-s3-4.3.1 spec/supports/helpers.rb
logstash-output-s3-4.3.0 spec/supports/helpers.rb
logstash-output-s3-4.2.0 spec/supports/helpers.rb
logstash-output-s3-4.1.10 spec/supports/helpers.rb
logstash-output-s3-4.1.9 spec/supports/helpers.rb
logstash-output-s3-4.1.8 spec/supports/helpers.rb
logstash-output-s3-4.1.7 spec/supports/helpers.rb
logstash-output-s3-4.1.6 spec/supports/helpers.rb
logstash-output-s3-4.1.5 spec/supports/helpers.rb
logstash-output-s3-4.1.4 spec/supports/helpers.rb
logstash-output-s3-4.1.3 spec/supports/helpers.rb
logstash-output-s3-4.1.2 spec/supports/helpers.rb
logstash-output-s3-4.1.1 spec/supports/helpers.rb
logstash-output-s3-4.1.0 spec/supports/helpers.rb