Skip to content

Commit

Permalink
fix(elasticloadbalancingv2): always set stickiness (#17111)
Browse files Browse the repository at this point in the history
CloudFormation does not process the removal of the stickiness attribute from the template as a delta that needs to be processed.

This results in scenarios where if a property was set in an application, that removing it would have no effect.

The fix to this is to always explicitly set the property so that a delta is always processed.

Fixes #16620


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
iRoachie authored Oct 29, 2021
1 parent 888e5a0 commit 0a23953
Show file tree
Hide file tree
Showing 23 changed files with 217 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@
"productionenvironmentvpcPublicSubnet1NATGateway6075E4CA": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089"
},
"AllocationId": {
"Fn::GetAtt": [
"productionenvironmentvpcPublicSubnet1EIP54BA88DB",
"AllocationId"
]
},
"SubnetId": {
"Ref": "productionenvironmentvpcPublicSubnet1Subnet8D92C089"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -199,15 +199,15 @@
"productionenvironmentvpcPublicSubnet2NATGatewayE1850FCC": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31"
},
"AllocationId": {
"Fn::GetAtt": [
"productionenvironmentvpcPublicSubnet2EIP14CA46AA",
"AllocationId"
]
},
"SubnetId": {
"Ref": "productionenvironmentvpcPublicSubnet2Subnet298E6C31"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -296,15 +296,15 @@
"productionenvironmentvpcPublicSubnet3NATGateway94604057": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D"
},
"AllocationId": {
"Fn::GetAtt": [
"productionenvironmentvpcPublicSubnet3EIP53405AED",
"AllocationId"
]
},
"SubnetId": {
"Ref": "productionenvironmentvpcPublicSubnet3SubnetC7B5665D"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -2391,6 +2391,10 @@
{
"Key": "deregistration_delay.timeout_seconds",
"Value": "10"
},
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"/",
{
"Ref": "AssetParametersb537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8S3Bucket60C7B412"
"Ref": "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3Bucket85F9E22A"
},
"/",
{
Expand All @@ -27,7 +27,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersb537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8S3VersionKey6900DC52"
"Ref": "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3VersionKey8103F967"
}
]
}
Expand All @@ -40,7 +40,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersb537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8S3VersionKey6900DC52"
"Ref": "AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3VersionKey8103F967"
}
]
}
Expand Down Expand Up @@ -163,6 +163,10 @@
{
"Key": "deregistration_delay.timeout_seconds",
"Value": "10"
},
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
Expand Down Expand Up @@ -358,17 +362,17 @@
}
},
"Parameters": {
"AssetParametersb537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8S3Bucket60C7B412": {
"AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3Bucket85F9E22A": {
"Type": "String",
"Description": "S3 bucket for asset \"b537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8\""
"Description": "S3 bucket for asset \"e2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886\""
},
"AssetParametersb537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8S3VersionKey6900DC52": {
"AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886S3VersionKey8103F967": {
"Type": "String",
"Description": "S3 key for asset version \"b537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8\""
"Description": "S3 key for asset version \"e2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886\""
},
"AssetParametersb537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8ArtifactHash5EEB924C": {
"AssetParameterse2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886ArtifactHash6FA4ABA8": {
"Type": "String",
"Description": "Artifact hash for asset \"b537a3d3462b62d59d4661ff456403d270823b5c9974ea4f4264ff95683a8ba8\""
"Description": "Artifact hash for asset \"e2fc78c01b63f40b6bbcc8ce3c0eaccd3bf8f0aa6196b65f8ee87fb97e343886\""
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@
"VPCPublicSubnet1NATGatewayE0556630": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "VPCPublicSubnet1SubnetB4246D30"
},
"AllocationId": {
"Fn::GetAtt": [
"VPCPublicSubnet1EIP6AD938E8",
"AllocationId"
]
},
"SubnetId": {
"Ref": "VPCPublicSubnet1SubnetB4246D30"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -192,15 +192,15 @@
"VPCPublicSubnet2NATGateway3C070193": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "VPCPublicSubnet2Subnet74179F39"
},
"AllocationId": {
"Fn::GetAtt": [
"VPCPublicSubnet2EIP4947BC00",
"AllocationId"
]
},
"SubnetId": {
"Ref": "VPCPublicSubnet2Subnet74179F39"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -289,15 +289,15 @@
"VPCPublicSubnet3NATGatewayD3048F5C": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "VPCPublicSubnet3Subnet631C5E25"
},
"AllocationId": {
"Fn::GetAtt": [
"VPCPublicSubnet3EIPAD4BC883",
"AllocationId"
]
},
"SubnetId": {
"Ref": "VPCPublicSubnet3Subnet631C5E25"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -596,6 +596,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"VpcId": {
"Ref": "VPCB9E5F0B4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@
"VPCPublicSubnet1NATGatewayE0556630": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "VPCPublicSubnet1SubnetB4246D30"
},
"AllocationId": {
"Fn::GetAtt": [
"VPCPublicSubnet1EIP6AD938E8",
"AllocationId"
]
},
"SubnetId": {
"Ref": "VPCPublicSubnet1SubnetB4246D30"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -192,15 +192,15 @@
"VPCPublicSubnet2NATGateway3C070193": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "VPCPublicSubnet2Subnet74179F39"
},
"AllocationId": {
"Fn::GetAtt": [
"VPCPublicSubnet2EIP4947BC00",
"AllocationId"
]
},
"SubnetId": {
"Ref": "VPCPublicSubnet2Subnet74179F39"
},
"Tags": [
{
"Key": "Name",
Expand Down Expand Up @@ -671,6 +671,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "instance",
"VpcId": {
"Ref": "VPCB9E5F0B4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "instance",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand All @@ -965,6 +971,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "instance",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "EcsDefaultClusterMnL3mNNYNVpc7788A521"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,12 @@
"Properties": {
"Port": 80,
"Protocol": "HTTP",
"TargetGroupAttributes": [
{
"Key": "stickiness.enabled",
"Value": "false"
}
],
"TargetType": "ip",
"VpcId": {
"Ref": "Vpc8378EB38"
Expand Down
Loading

0 comments on commit 0a23953

Please sign in to comment.