Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

349
Vistas
How to configure client? AWS Elasticsearch request C#

I am new to Amazon Web Services. I configured domain to use ElasticSearch in AWS(Amazon Web Services) console. Confirured usage of Http Requests. Went through documantation of creating ElasticSearch client from https://www.elastic.co/guide/en/elasticsearch/client/net-api/1.x/security.html

var response = client.RootNodeInfo(c => c
    .RequestConfiguration(rc => rc
        .BasicAuthentication("UserName", "Password")
    ));

Works fine to me (Response is 200) But when i try to configure authentication credentials like this and pass config to client constructor i need to have "cloudId" i didnt find in at AWS where sould i search for it? or what i have to do?

My client code:

BasicAuthenticationCredentials credentials = new BasicAuthenticationCredentials("UserName", "Password");

var config = new ConnectionSettings("cloudId???", credentials);

var client = new ElasticClient(config);
var response = client.Ping();
over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I recently did this but a different way. I used the Nuget package AwsSignatureVersion4 and an IAM user with appropriate permissions to the ElasticSearch service.

But basically, use the ImmutableCredentials and just do what I need to do via the REST calls and the C# HttpClient. I find it easier than using the .NET ElasticSearch library. I can then copy/paste back and forth from Kibana.

var credentials = new ImmutableCredentials("access_key", "secret_key", null);
HttpContent httpContent = new StringContent(JsonConvert.SerializeObject(someObjOrQuery), Encoding.UTF8);
httpContent.Headers.ContentType = new MediaTypeHeaderValue("application/json");
var resp = httpClient.PostAsync(es_url, 
    httpContent, 
    regionName: "us-east-1",
    serviceName: "es",
    credentials: credentials).GetAwaiter().GetResult();

if(resp.IsSuccessStatusCode) 
{
   //Good to go
}
else
{
  //this gets what ES sent back
  var content = response.Content.ReadAsStringAsync();
  dynamic respJson = JObject.Parse(content.Result());
  //Now you can access stuff by dot and it's dynamic respJson.something
}
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda