Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { version as agentVersion } from '../../../package.json';
import { default as proxy } from 'proxy-agent';
import { default as https } from 'https';
const agentGroup = process.env.GTM_AGENT_GROUP || 'default';
AWS.config.update({ region: process.env.GTM_AWS_REGION });
let log = AgentLogger.log();
const EVENTS_TABLE = process.env.GTM_DYNAMO_TABLE_EVENTS;
let INITIAL_DATA = [];
let EventMetricStream;
let elastic;
if (process.env.GTM_ELASTIC_HOST && process.env.GTM_ELASTIC_PORT) {
elastic = new elasticsearch.Client({
host: `${process.env.GTM_ELASTIC_HOST}:${process.env.GTM_ELASTIC_PORT}`,
log: 'info'
});
}
if (process.env.IAM_ENABLED) {
AWS.config.update({
httpOptions: {
agent: proxy(process.env.HTTP_PROXY)
}
});
}
async function configureRoutes(app) {
let ddb;
if (process.env.GTM_DYNAMO_VPCE) {