From ae23bee1b97d6ead86d66214c80091caa49e0e3b Mon Sep 17 00:00:00 2001 From: Mark Peek Date: Wed, 6 Dec 2023 15:54:40 -0800 Subject: [PATCH] Prefer ECS::Service.LoadBalancer (Fixes #2206) ECS::TaskSet.LoadBalancer was being emitted but ECS::Service.LoadBalancer is a superset. This makes the minimal change to keep backward compatibility (although LoadBalancerName should not be used with TaskSet). --- scripts/patches/ecs.py | 5 +++++ troposphere/ecs.py | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/patches/ecs.py b/scripts/patches/ecs.py index 5faca2eb0..e382dffd1 100644 --- a/scripts/patches/ecs.py +++ b/scripts/patches/ecs.py @@ -64,6 +64,11 @@ "path": "/PropertyTypes/AWS::ECS::TaskSet.AwsVpcConfiguration", }, # backward compatibility + { + "op": "remove", + "path": "/PropertyTypes/AWS::ECS::TaskSet.LoadBalancer", + }, + # backward compatibility { "op": "move", "from": "/PropertyTypes/AWS::ECS::Service.AwsVpcConfiguration", diff --git a/troposphere/ecs.py b/troposphere/ecs.py index b6531ba20..aa5124772 100644 --- a/troposphere/ecs.py +++ b/troposphere/ecs.py @@ -245,12 +245,13 @@ class DeploymentController(AWSProperty): class LoadBalancer(AWSProperty): """ - `LoadBalancer `__ + `LoadBalancer `__ """ props: PropsDictType = { "ContainerName": (str, False), "ContainerPort": (validate_network_port, False), + "LoadBalancerName": (str, False), "TargetGroupArn": (str, False), }