Search in sources :

Example 1 with AWS4Signer

use of com.amazonaws.auth.AWS4Signer in project vorto by eclipse.

the class ElasticSearchConfiguration method awsIndexingClient.

@Bean
@Profile({ "prod", "int" })
public RestHighLevelClient awsIndexingClient() {
    logger.info("Creating an elastic server client with config(serviceName=" + serviceName + " region=" + region + " aesEndpoint=" + aesEndpoint);
    AWS4Signer signer = new AWS4Signer();
    signer.setServiceName(serviceName);
    signer.setRegionName(region);
    HttpRequestInterceptor interceptor = new AWSRequestSigningApacheInterceptor(serviceName, signer, credentialsProvider);
    RestClientBuilder builder = RestClient.builder(HttpHost.create(aesEndpoint)).setHttpClientConfigCallback(httpClientConfig(getProxy(), interceptor));
    return new RestHighLevelClient(builder);
}
Also used : AWS4Signer(com.amazonaws.auth.AWS4Signer) HttpRequestInterceptor(org.apache.http.HttpRequestInterceptor) RestClientBuilder(org.elasticsearch.client.RestClientBuilder) AWSRequestSigningApacheInterceptor(com.amazonaws.http.AWSRequestSigningApacheInterceptor) RestHighLevelClient(org.elasticsearch.client.RestHighLevelClient) Profile(org.springframework.context.annotation.Profile) Bean(org.springframework.context.annotation.Bean)

Aggregations

AWS4Signer (com.amazonaws.auth.AWS4Signer)1 AWSRequestSigningApacheInterceptor (com.amazonaws.http.AWSRequestSigningApacheInterceptor)1 HttpRequestInterceptor (org.apache.http.HttpRequestInterceptor)1 RestClientBuilder (org.elasticsearch.client.RestClientBuilder)1 RestHighLevelClient (org.elasticsearch.client.RestHighLevelClient)1 Bean (org.springframework.context.annotation.Bean)1 Profile (org.springframework.context.annotation.Profile)1