diff --git a/_clients/ruby.md b/_clients/ruby.md index 34167907..9ecbd178 100644 --- a/_clients/ruby.md +++ b/_clients/ruby.md @@ -525,4 +525,26 @@ puts 'Deleting the index:' response = client.indices.delete(index: index_name) puts MultiJson.dump(response, pretty: "true") -``` \ No newline at end of file +``` + +# Ruby AWS Sigv4 Client + +The [opensearch-aws-sigv4](https://github.com/opensearch-project/opensearch-ruby/tree/main/opensearch-aws-sigv4) gem provides the `OpenSearch::Aws::Sigv4Client` class, which has all features of `OpenSearch::Client`. The only difference between these two clients is that `OpenSearch::Aws::Sigv4Client` requires an instance of `Aws::Sigv4::Signer` during instantiation to authenticate with AWS: + +```ruby +require 'opensearch-aws-sigv4' +require 'aws-sigv4' + +signer = Aws::Sigv4::Signer.new(service: 'es', + region: 'us-west-2', + access_key_id: 'key_id', + secret_access_key: 'secret') + +client = OpenSearch::Aws::Sigv4Client.new({ log: true }, signer) + +client.cluster.health + +client.transport.reload_connections! + +client.search q: 'test' +```