Skip to content

Commit 9c0fecf

Browse files
authored
fix(ecs-patterns): ApplicationMultipleTargetGroupsEc2Service ignores load balancer name (#28394)
Fixes by adding the `loadBalancerName` property to the generated `ApplicationLoadBalancer`. Closes #23535. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c7dfd1d commit 9c0fecf

File tree

11 files changed

+67
-50
lines changed

11 files changed

+67
-50
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-application-load-balanced-ecs-service.js.snapshot/aws-ecs-integ-multiple-alb-healthchecks.template.json

+2
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@
661661
"myServicelb1FA8CBE12": {
662662
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
663663
"Properties": {
664+
"Name": "lb1",
664665
"LoadBalancerAttributes": [
665666
{
666667
"Key": "deletion_protection.enabled",
@@ -772,6 +773,7 @@
772773
"myServicelb2C84C7BCB": {
773774
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
774775
"Properties": {
776+
"Name": "lb2",
775777
"LoadBalancerAttributes": [
776778
{
777779
"Key": "deletion_protection.enabled",

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.healthchecks-multiple-application-load-balanced-ecs-service.js.snapshot/tree.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service-idle-timeout.js.snapshot/aws-ecs-integ-alb-idle-timeout.template.json

+31-29
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@
422422
}
423423
}
424424
},
425-
"ClusterDefaultAutoScalingGroupInstanceSecurityGroupfromawsecsintegalbidletimeoutmyServicelbSecurityGroupDA02006B327686553535B38FF6": {
425+
"ClusterDefaultAutoScalingGroupInstanceSecurityGroupfromawsecsintegalbidletimeoutmyServicelb1SecurityGroup378D68EF32768655356B9A3535": {
426426
"Type": "AWS::EC2::SecurityGroupIngress",
427427
"Properties": {
428428
"IpProtocol": "tcp",
@@ -436,7 +436,7 @@
436436
},
437437
"SourceSecurityGroupId": {
438438
"Fn::GetAtt": [
439-
"myServicelbSecurityGroup97C897CA",
439+
"myServicelb1SecurityGroup342C51EA",
440440
"GroupId"
441441
]
442442
},
@@ -896,9 +896,10 @@
896896
"ClusterDefaultAutoScalingGroupLifecycleHookDrainHookRole70201663"
897897
]
898898
},
899-
"myServicelb360A9ADD": {
899+
"myServicelb1FA8CBE12": {
900900
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
901901
"Properties": {
902+
"Name": "lb1",
902903
"LoadBalancerAttributes": [
903904
{
904905
"Key": "deletion_protection.enabled",
@@ -913,7 +914,7 @@
913914
"SecurityGroups": [
914915
{
915916
"Fn::GetAtt": [
916-
"myServicelbSecurityGroup97C897CA",
917+
"myServicelb1SecurityGroup342C51EA",
917918
"GroupId"
918919
]
919920
}
@@ -935,10 +936,10 @@
935936
"VpcPublicSubnet2RouteTableAssociationDD5762D8"
936937
]
937938
},
938-
"myServicelbSecurityGroup97C897CA": {
939+
"myServicelb1SecurityGroup342C51EA": {
939940
"Type": "AWS::EC2::SecurityGroup",
940941
"Properties": {
941-
"GroupDescription": "Automatically created Security Group for ELB awsecsintegalbidletimeoutmyServicelb9997A785",
942+
"GroupDescription": "Automatically created Security Group for ELB awsecsintegalbidletimeoutmyServicelb1D1305870",
942943
"SecurityGroupIngress": [
943944
{
944945
"CidrIp": "0.0.0.0/0",
@@ -953,12 +954,12 @@
953954
}
954955
}
955956
},
956-
"myServicelbSecurityGrouptoawsecsintegalbidletimeoutClusterDefaultAutoScalingGroupInstanceSecurityGroup9C8FC9DE3276865535B06FECE0": {
957+
"myServicelb1SecurityGrouptoawsecsintegalbidletimeoutClusterDefaultAutoScalingGroupInstanceSecurityGroup9C8FC9DE327686553594C8842C": {
957958
"Type": "AWS::EC2::SecurityGroupEgress",
958959
"Properties": {
959960
"GroupId": {
960961
"Fn::GetAtt": [
961-
"myServicelbSecurityGroup97C897CA",
962+
"myServicelb1SecurityGroup342C51EA",
962963
"GroupId"
963964
]
964965
},
@@ -974,19 +975,19 @@
974975
"ToPort": 65535
975976
}
976977
},
977-
"myServicelblistener1D7944F2": {
978+
"myServicelb1listener94ADDDDF": {
978979
"Type": "AWS::ElasticLoadBalancingV2::Listener",
979980
"Properties": {
980981
"DefaultActions": [
981982
{
982983
"TargetGroupArn": {
983-
"Ref": "myServicelblistenerECSTargetGroupweb80Group4ADFE4C4"
984+
"Ref": "myServicelb1listenerECSTargetGroupweb80Group6EDAD1E5"
984985
},
985986
"Type": "forward"
986987
}
987988
],
988989
"LoadBalancerArn": {
989-
"Ref": "myServicelb360A9ADD"
990+
"Ref": "myServicelb1FA8CBE12"
990991
},
991992
"Certificates": [
992993
{
@@ -998,7 +999,7 @@
998999
"SslPolicy": "ELBSecurityPolicy-TLS-1-2-Ext-2018-06"
9991000
}
10001001
},
1001-
"myServicelblistenerECSTargetGroupweb80Group4ADFE4C4": {
1002+
"myServicelb1listenerECSTargetGroupweb80Group6EDAD1E5": {
10021003
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
10031004
"Properties": {
10041005
"Port": 80,
@@ -1015,7 +1016,7 @@
10151016
}
10161017
}
10171018
},
1018-
"myServicelblistenerECSTargetGroupweb90Group4AA47881": {
1019+
"myServicelb1listenerECSTargetGroupweb90Group392113A5": {
10191020
"Type": "AWS::ElasticLoadBalancingV2::TargetGroup",
10201021
"Properties": {
10211022
"Port": 80,
@@ -1032,13 +1033,13 @@
10321033
}
10331034
}
10341035
},
1035-
"myServicelblistenerECSTargetGroupweb90Rule68215E8D": {
1036+
"myServicelb1listenerECSTargetGroupweb90Rule88D36BAE": {
10361037
"Type": "AWS::ElasticLoadBalancingV2::ListenerRule",
10371038
"Properties": {
10381039
"Actions": [
10391040
{
10401041
"TargetGroupArn": {
1041-
"Ref": "myServicelblistenerECSTargetGroupweb90Group4AA47881"
1042+
"Ref": "myServicelb1listenerECSTargetGroupweb90Group392113A5"
10421043
},
10431044
"Type": "forward"
10441045
}
@@ -1055,11 +1056,11 @@
10551056
],
10561057
"Priority": 10,
10571058
"ListenerArn": {
1058-
"Ref": "myServicelblistener1D7944F2"
1059+
"Ref": "myServicelb1listener94ADDDDF"
10591060
}
10601061
}
10611062
},
1062-
"myServiceDNSlb1E167074": {
1063+
"myServiceDNSlb1447CEC86": {
10631064
"Type": "AWS::Route53::RecordSet",
10641065
"Properties": {
10651066
"Name": "api.example.com.",
@@ -1072,7 +1073,7 @@
10721073
"dualstack.",
10731074
{
10741075
"Fn::GetAtt": [
1075-
"myServicelb360A9ADD",
1076+
"myServicelb1FA8CBE12",
10761077
"DNSName"
10771078
]
10781079
}
@@ -1081,7 +1082,7 @@
10811082
},
10821083
"HostedZoneId": {
10831084
"Fn::GetAtt": [
1084-
"myServicelb360A9ADD",
1085+
"myServicelb1FA8CBE12",
10851086
"CanonicalHostedZoneID"
10861087
]
10871088
}
@@ -1094,6 +1095,7 @@
10941095
"myServicelb2C84C7BCB": {
10951096
"Type": "AWS::ElasticLoadBalancingV2::LoadBalancer",
10961097
"Properties": {
1098+
"Name": "lb2",
10971099
"LoadBalancerAttributes": [
10981100
{
10991101
"Key": "deletion_protection.enabled",
@@ -1467,14 +1469,14 @@
14671469
"ContainerName": "web",
14681470
"ContainerPort": 80,
14691471
"TargetGroupArn": {
1470-
"Ref": "myServicelblistenerECSTargetGroupweb80Group4ADFE4C4"
1472+
"Ref": "myServicelb1listenerECSTargetGroupweb80Group6EDAD1E5"
14711473
}
14721474
},
14731475
{
14741476
"ContainerName": "web",
14751477
"ContainerPort": 90,
14761478
"TargetGroupArn": {
1477-
"Ref": "myServicelblistenerECSTargetGroupweb90Group4AA47881"
1479+
"Ref": "myServicelb1listenerECSTargetGroupweb90Group392113A5"
14781480
}
14791481
},
14801482
{
@@ -1498,10 +1500,10 @@
14981500
}
14991501
},
15001502
"DependsOn": [
1501-
"myServicelblistenerECSTargetGroupweb80Group4ADFE4C4",
1502-
"myServicelblistenerECSTargetGroupweb90Group4AA47881",
1503-
"myServicelblistenerECSTargetGroupweb90Rule68215E8D",
1504-
"myServicelblistener1D7944F2",
1503+
"myServicelb1listenerECSTargetGroupweb80Group6EDAD1E5",
1504+
"myServicelb1listenerECSTargetGroupweb90Group392113A5",
1505+
"myServicelb1listenerECSTargetGroupweb90Rule88D36BAE",
1506+
"myServicelb1listener94ADDDDF",
15051507
"myServicelb2listener2ECSTargetGroupweb443Group8FAB1268",
15061508
"myServicelb2listener2ECSTargetGroupweb80Group0590BDE6",
15071509
"myServicelb2listener2ECSTargetGroupweb80Rule2490715C",
@@ -1523,22 +1525,22 @@
15231525
}
15241526
},
15251527
"Outputs": {
1526-
"myServiceLoadBalancerDNSlbDE816AD2": {
1528+
"myServiceLoadBalancerDNSlb1341EE21A": {
15271529
"Value": {
15281530
"Fn::GetAtt": [
1529-
"myServicelb360A9ADD",
1531+
"myServicelb1FA8CBE12",
15301532
"DNSName"
15311533
]
15321534
}
15331535
},
1534-
"myServiceServiceURLlbhttps4348F098": {
1536+
"myServiceServiceURLlb1https6C9C5530": {
15351537
"Value": {
15361538
"Fn::Join": [
15371539
"",
15381540
[
15391541
"https://",
15401542
{
1541-
"Ref": "myServiceDNSlb1E167074"
1543+
"Ref": "myServiceDNSlb1447CEC86"
15421544
}
15431545
]
15441546
]

packages/@aws-cdk-testing/framework-integ/test/aws-ecs-patterns/test/ec2/integ.multiple-application-load-balanced-ecs-service-idle-timeout.js.snapshot/manifest.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)