UNPKG

briareus

Version:

Briareus assists with Feature Branch deploys to ECS

21 lines (17 loc) 622 B
'use strict' const AWS = require('aws-sdk'); const _ = require('lodash'); module.exports = function (payload, cb) { const elbv2 = new AWS.ELBv2(); const params = { LoadBalancerArn: payload.alb.arn }; elbv2.describeListeners(params, (err, data) => { if (err) return cb(err); let listener = _.find(data.Listeners, (listener) => listener.Protocol === 'HTTPS' && listener.Port === 443); if (!listener) return cb(new Error(`Could not find HTTPS listener for ${payload.alb.arn} on port 443`)); cb(null, [ { op: 'add', path: '/alb/listenerArn', value: listener.ListenerArn }, ]); }); }