【发布时间】:2020-11-28 04:25:49
【问题描述】:
我是亚马逊网络服务的新手。 我将域配置为在 AWS(Amazon Web Services)控制台中使用 ElasticSearch。确认使用 Http 请求。 经历了从创建 ElasticSearch 客户端的文档 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")
));
对我来说很好(响应为 200) 但是,当我尝试像这样配置身份验证凭据并将配置传递给客户端构造函数时,我需要有“cloudId”,但我在 AWS 上找不到我在哪里搜索它?或者我必须做什么?
我的客户代码:
BasicAuthenticationCredentials credentials = new BasicAuthenticationCredentials("UserName", "Password");
var config = new ConnectionSettings("cloudId???", credentials);
var client = new ElasticClient(config);
var response = client.Ping();
【问题讨论】:
标签: c# .net amazon-web-services http elasticsearch