Skip to content

Commit

Permalink
AWS::ElasticLoadBalancingV2::TargetGroup.TargetType (#1968)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerry153fish authored Oct 29, 2021
1 parent cefa899 commit 15ca294
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/test_elasticloadbalancerv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_invalid_targettype_is_rejected(self):
VpcId="unknown",
).to_dict()
self.assertEqual(
'TargetGroup.TargetType must be one of: "instance, ip, lambda"',
'TargetGroup.TargetType must be one of: "alb, instance, ip, lambda"',
str(valueError.exception),
)

Expand Down
8 changes: 7 additions & 1 deletion troposphere/elasticloadbalancingv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,19 @@ class ListenerRule(AWSObject):
}


TARGET_TYPE_ALB = "alb"
TARGET_TYPE_INSTANCE = "instance"
TARGET_TYPE_IP = "ip"
TARGET_TYPE_LAMBDA = "lambda"


def validate_target_type(target_type):
valid_types = [TARGET_TYPE_INSTANCE, TARGET_TYPE_IP, TARGET_TYPE_LAMBDA]
valid_types = [
TARGET_TYPE_ALB,
TARGET_TYPE_INSTANCE,
TARGET_TYPE_IP,
TARGET_TYPE_LAMBDA,
]
if target_type not in valid_types:
raise ValueError(
'TargetGroup.TargetType must be one of: "%s"' % ", ".join(valid_types)
Expand Down

0 comments on commit 15ca294

Please sign in to comment.