Skip to content

Commit c2db254

Browse files
ELB: Allow secondary_ips.auto_assigned.per_subnet for modify_load_balancer_attributes
1 parent 192289f commit c2db254

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

moto/elbv2/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ class FakeLoadBalancer(CloudFormationModel):
582582
"routing.http2.enabled",
583583
"waf.fail_open.enabled",
584584
"zonal_shift.config.enabled",
585+
"secondary_ips.auto_assigned.per_subnet",
585586
}
586587

587588
def __init__(

tests/test_elbv2/test_elbv2.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1452,6 +1452,27 @@ def test_modify_load_balancer_attributes_routing_http_drop_invalid_header_fields
14521452
assert routing_http_drop_invalid_header_fields_enabled["Value"] == "false"
14531453

14541454

1455+
@mock_aws
1456+
def test_modify_load_balancer_attributes_secondary_ips_auto_assigned_per_subnet():
1457+
response, _, _, _, _, client = create_load_balancer("network")
1458+
arn = response["LoadBalancers"][0]["LoadBalancerArn"]
1459+
1460+
client.modify_load_balancer_attributes(
1461+
LoadBalancerArn=arn,
1462+
Attributes=[
1463+
{"Key": "secondary_ips.auto_assigned.per_subnet", "Value": "3"}
1464+
],
1465+
)
1466+
response = client.describe_load_balancer_attributes(LoadBalancerArn=arn)
1467+
routing_http_drop_invalid_header_fields_enabled = list(
1468+
filter(
1469+
lambda item: item["Key"] == "secondary_ips.auto_assigned.per_subnet",
1470+
response["Attributes"],
1471+
)
1472+
)[0]
1473+
assert routing_http_drop_invalid_header_fields_enabled["Value"] == "3"
1474+
1475+
14551476
@mock_aws
14561477
def test_describe_load_balancer_attributes_default():
14571478
response, _, _, _, _, client = create_load_balancer()

0 commit comments

Comments
 (0)