Skip to content

Commit

Permalink
Prefer ECS::Service.LoadBalancer (Fixes #2206)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
markpeek committed Dec 6, 2023
1 parent bcc7b50 commit ae23bee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions scripts/patches/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion troposphere/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,13 @@ class DeploymentController(AWSProperty):

class LoadBalancer(AWSProperty):
"""
`LoadBalancer <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskset-loadbalancer.html>`__
`LoadBalancer <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-service-loadbalancer.html>`__
"""

props: PropsDictType = {
"ContainerName": (str, False),
"ContainerPort": (validate_network_port, False),
"LoadBalancerName": (str, False),
"TargetGroupArn": (str, False),
}

Expand Down

0 comments on commit ae23bee

Please sign in to comment.