cherweg / logstash-input-s3-sns-sqs

logstash input downloading files from s3 Bucket by OjectKey from SNS/SQS
Other
29 stars 35 forks source link

need docs for config setting for aws endpoint work under localstack #61

Closed richard-mauri closed 2 years ago

richard-mauri commented 3 years ago

Either a first class config or via an ENV variable would be ok.

I have tried to set the endpoint in the s3_default_options but no luck.

input {
  s3snssqs {
    region                     => "us-east-1"
    access_key_id              => "local"
    secret_access_key          => "local"
    s3_default_options         => { "endpoint" => "http://localstack:4566/" }
    queue                      => "queue1"
    type                       => "s3-logs"
    tags                       => ["s3-sqs-test"]
    sqs_skip_delete            => false
    codec                      => json
    from_sns                   => false
  }
} 

See also: https://github.com/aws/aws-cli/issues/4454#issuecomment-854252369

richard-mauri commented 3 years ago

See: https://github.com/localstack/localstack/issues/1276#issuecomment-854902166

richard-mauri commented 3 years ago

I got it to connect ok using "endpoint" config. I wish the documentation for this.

Note to other people that are trying to connectfrom a docker logstash to a localstack running in docker, that you should have them in the same docker bridge network and you must set the env variable HOSTNAME_EXTERNAL for the localstack container to the name of the docker network (see: https://github.com/aws/aws-sdk-java/issues/2342)

input {
  s3snssqs {
    region                     => "us-east-1"
    endpoint                   => "http://localstack:4566/"
    access_key_id              => "test"
    secret_access_key          => "test"
    s3_default_options         => { "force_path_style" => true }
    queue                      => "queue1"
    type                       => "s3-logs"
    tags                       => ["s3-sqs-test"]
    sqs_skip_delete            => false
    codec                      => json
    from_sns                   => false
  }
}
cherweg commented 2 years ago

I‘ll update the documentation. Thank you