Skip to content

Commit

Permalink
Randomizing base number for LB rule to allow for updates
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPreston committed Dec 12, 2023
1 parent 5ca725a commit 4c1d95f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ecs_composex/elbv2/elbv2_stack/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

from __future__ import annotations

import random
from typing import TYPE_CHECKING

if TYPE_CHECKING:
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 4c1d95f

Please sign in to comment.