Skip to content

Commit

Permalink
Uniqfy rules with the priority count (#681)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnPreston committed Aug 3, 2023
1 parent 46e6594 commit d288d52
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ecs_composex/elbv2/elbv2_stack/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,12 @@ def define_listener_rules_actions(listener, left_services) -> list:
"""
rules = []
for count, service_def in enumerate(left_services):
priority = count + 1
rule = ListenerRule(
f"{listener.title}{NONALPHANUM.sub('', service_def['name'])}Rule",
f"{listener.title}{NONALPHANUM.sub('', service_def['name'])}Rule{count}",
ListenerArn=Ref(listener),
Actions=define_actions(listener, service_def, True),
Priority=(count + 1),
Priority=priority,
Conditions=define_target_conditions(service_def),
)
rules.append(rule)
Expand Down

0 comments on commit d288d52

Please sign in to comment.