Skip to content

Commit 5743c76

Browse files
committed
attempting to normalize ES config w/ that of the submission API
1 parent f6fbc6f commit 5743c76

File tree

3 files changed

+109
-3
lines changed

3 files changed

+109
-3
lines changed

config/default.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/**
22
* The configuration file.
33
*/
4+
const AWS = require('aws-sdk')
5+
const httpAWSes = require('http-aws-es')
6+
47
module.exports = {
58
LOG_LEVEL: process.env.LOG_LEVEL || 'debug',
69

@@ -17,7 +20,13 @@ module.exports = {
1720
// see https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/configuration.html
1821
// for full config details, for SSL connection, see the ssl field details in above page
1922
ELASTICSEARCH_CONFIG: {
20-
host: process.env.ELASTICSEARCH_HOST || 'localhost:9200'
23+
apiVersion: process.env.ES_API_VERSION || '6.3',
24+
host: process.env.ELASTICSEARCH_HOST || 'localhost:9200',
25+
connectionClass: httpAWSes,
26+
amazonES: {
27+
region: process.env.AWS_REGION || 'us-east-1',
28+
credentials: new AWS.EnvironmentCredentials('AWS')
29+
}
2130
},
2231

2332
ELASTICSEARCH_INDEX: process.env.ELASTICSEARCH_INDEX || 'submission-index',

package-lock.json

Lines changed: 97 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
"uuid": "^3.3.2"
2121
},
2222
"dependencies": {
23+
"aws-sdk": "^2.286.2",
2324
"bluebird": "^3.5.1",
2425
"co": "^4.6.0",
2526
"config": "^1.21.0",
2627
"elasticsearch": "^15.1.1",
2728
"get-parameter-names": "^0.3.0",
29+
"http-aws-es": "^6.0.0",
2830
"joi": "^9.0.4",
2931
"lodash": "^4.17.10",
3032
"no-kafka": "^3.2.4",

0 commit comments

Comments
 (0)