Skip to content

Expose lower level Elasticsearch::Client params for configuration

Description

Looking to use Amazon's elasticsearch service. Need to be able to use TLS on transport as well as sign each request with aws_signers_v4.

Currently in the UI the only options exposed are host and port. Which means we would be sending our code unencrypted over the public internet to reach AWS elasticsearch service. Without the ability to sign the requests you are also limited to only using IP based access controls and not IAM users/roles.

Proposal

Expose available Elasticsearch::Client configuration parameters to the gitlab.rb or UI.

Links / references

http://www.rubydoc.info/gems/elasticsearch-transport

require 'faraday_middleware/aws_signers_v4'

client = Elasticsearch::Client.new url: 'https://search-my-cluster-abc123....es.amazonaws.com' do |f|
  f.request :aws_signers_v4,
            credentials: Aws::Credentials.new(ENV['AWS_ACCESS_KEY'], ENV['AWS_SECRET_ACCESS_KEY']),
            service_name: 'es',
            region: 'us-east-1'
end