UNPKG

briareus

Version:

Briareus assists with Feature Branch deploys to ECS

25 lines (19 loc) 618 B
'use strict' const AWS = require('aws-sdk'); const _ = require('lodash'); let action = module.exports = function (pipeline, payload, cb) { var elbv2 = new AWS.ELBv2(); // Return if we have no ALB Rule if (!payload.assets.albRule || payload.assets.albRule.destroyed) return cb(null, []); var params = { RuleArn: payload.assets.albRule.arn }; elbv2.deleteRule(params, (err, data) => { if (err) return cb(err); cb(null, [ { op: 'add', path: '/assets/albRule/destroyed', value: true }, ]); }); } action.waiting = 'Destroying ALB Rule'; action.done = 'ALB Rule has been destroyed';