From 4c1d95f010419240f973f3e463937a4878d6dad5 Mon Sep 17 00:00:00 2001 From: "John \"Preston\" Mille" Date: Tue, 12 Dec 2023 20:52:57 +0000 Subject: [PATCH] Randomizing base number for LB rule to allow for updates --- ecs_composex/elbv2/elbv2_stack/helpers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ecs_composex/elbv2/elbv2_stack/helpers.py b/ecs_composex/elbv2/elbv2_stack/helpers.py index c18df094..b7a23ecd 100644 --- a/ecs_composex/elbv2/elbv2_stack/helpers.py +++ b/ecs_composex/elbv2/elbv2_stack/helpers.py @@ -3,6 +3,7 @@ from __future__ import annotations +import random from typing import TYPE_CHECKING if TYPE_CHECKING: @@ -382,8 +383,9 @@ def define_listener_rules_actions( Function to identify the Target definition and create the resulting rule appropriately. """ rules = [] + offset = random.randint(1, 100) for count, service_def in enumerate(left_services): - priority = count + 1 + priority = count + 1 + offset rule = ListenerRule( f"{listener.title}{NONALPHANUM.sub('', service_def['name'])}Rule{count}", ListenerArn=Ref(listener),