From f3d2eac3fe16b90549b02df819fc087cd0e48087 Mon Sep 17 00:00:00 2001 From: tmshkr Date: Tue, 2 Jan 2024 22:59:18 +0000 Subject: [PATCH] Update dist file --- dist/index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 74f3ed6..fe6843b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -234104,7 +234104,7 @@ function updateTargetGroups(inputs) { var _a, _b, _c; return updateListenerRules_awaiter(this, void 0, void 0, function* () { const { prodEnv, stagingEnv } = yield getEnvironments(inputs); - const environments = [prodEnv, stagingEnv].filter((env) => !!env); + const environments = [prodEnv, stagingEnv].filter((env) => (env === null || env === void 0 ? void 0 : env.Status) === "Ready"); const resources = yield getEnvironmentResources(environments); const rules = yield getRules(resources); const targetGroupARNs = yield findTargetGroupArns(inputs, environments, resources); @@ -234215,14 +234215,11 @@ function getRules(resources) { if (loadBalancerArns.size > 1) { throw new Error("Environments must use the same load balancer"); } - const loadBalancerArn = Array.from(loadBalancerArns)[0]; - const listeners = []; - yield elbv2Client.send(new client_elastic_load_balancing_v2_dist_cjs.DescribeListenersCommand({ - LoadBalancerArn: loadBalancerArn, - })) - .then(({ Listeners }) => listeners.push(...Listeners)); + const { Listeners } = yield elbv2Client.send(new client_elastic_load_balancing_v2_dist_cjs.DescribeListenersCommand({ + LoadBalancerArn: Array.from(loadBalancerArns)[0], + })); const rules = []; - for (const { ListenerArn } of listeners) { + for (const { ListenerArn } of Listeners) { yield elbv2Client.send(new client_elastic_load_balancing_v2_dist_cjs.DescribeRulesCommand({ ListenerArn: ListenerArn })) .then(({ Rules }) => { for (const rule of Rules) {