mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
[http-aws-es] type awsConfig as AWS.Config instead of handcrafted subset
This commit is contained in:
@@ -1,42 +1,43 @@
|
||||
import { EnvironmentCredentials } from "aws-sdk/lib/core";
|
||||
import * as AWS from "aws-sdk";
|
||||
import { Client } from "elasticsearch";
|
||||
import HttpAmazonESConnector = require("http-aws-es");
|
||||
|
||||
new Client({
|
||||
awsConfig: {
|
||||
accessKey: "AKID",
|
||||
awsConfig: new AWS.Config({
|
||||
accessKeyId: "AKID",
|
||||
region: "us-east-1",
|
||||
secretKey: "secret",
|
||||
},
|
||||
secretAccessKey: "secret",
|
||||
}),
|
||||
connectionClass: HttpAmazonESConnector,
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
|
||||
new Client({
|
||||
awsConfig: {
|
||||
accessKey: "AKID",
|
||||
awsConfig: new AWS.Config({
|
||||
accessKeyId: "AKID",
|
||||
region: "us-east-1",
|
||||
secretKey: "secret",
|
||||
},
|
||||
secretAccessKey: "secret",
|
||||
}),
|
||||
connectionClass: require("http-aws-es"),
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
|
||||
const myCredentials = new EnvironmentCredentials("AWS");
|
||||
const myCredentials = new AWS.EnvironmentCredentials("AWS");
|
||||
|
||||
new Client({
|
||||
awsConfig: {
|
||||
awsConfig: new AWS.Config({
|
||||
credentials: myCredentials,
|
||||
region: "us-east-1",
|
||||
},
|
||||
}),
|
||||
connectionClass: HttpAmazonESConnector,
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
|
||||
new Client({
|
||||
awsConfig: {
|
||||
awsConfig: new AWS.Config({
|
||||
credentials: myCredentials,
|
||||
region: "us-east-1",
|
||||
},
|
||||
}),
|
||||
connectionClass: require("http-aws-es"),
|
||||
host: "https://amazon-es-host.us-east-1.es.amazonaws.com",
|
||||
});
|
||||
|
||||
Vendored
+2
-9
@@ -7,18 +7,11 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as e from "elasticsearch";
|
||||
import { Credentials } from "aws-sdk/lib/core";
|
||||
import * as AWS from "aws-sdk";
|
||||
|
||||
declare module "elasticsearch" {
|
||||
interface AmazonESOptions {
|
||||
accessKey?: string;
|
||||
credentials?: Credentials;
|
||||
region: string;
|
||||
secretKey?: string;
|
||||
}
|
||||
|
||||
interface ConfigOptions {
|
||||
awsConfig?: AmazonESOptions;
|
||||
awsConfig?: AWS.Config;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user