Fix missing valid_attrs (issue 4529) (#4530)

This commit is contained in:
Julio Cesar 2021-11-06 09:37:19 -03:00 committed by GitHub
parent e379ac1cec
commit 1e85e16f0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 0 deletions

View File

@ -425,6 +425,8 @@ class FakeLoadBalancer(CloudFormationModel):
"access_logs.s3.prefix",
"deletion_protection.enabled",
"idle_timeout.timeout_seconds",
"routing.http2.enabled",
"routing.http.drop_invalid_header_fields.enabled",
}
def __init__(

View File

@ -1146,6 +1146,50 @@ def test_modify_load_balancer_attributes_idle_timeout():
idle_timeout["Value"].should.equal("600")
@mock_elbv2
@mock_ec2
def test_modify_load_balancer_attributes_routing_http2_enabled():
response, _, _, _, _, client = create_load_balancer()
arn = response["LoadBalancers"][0]["LoadBalancerArn"]
client.modify_load_balancer_attributes(
LoadBalancerArn=arn,
Attributes=[{"Key": "routing.http2.enabled", "Value": "false"}],
)
response = client.describe_load_balancer_attributes(LoadBalancerArn=arn)
routing_http2_enabled = list(
filter(
lambda item: item["Key"] == "routing.http2.enabled", response["Attributes"],
)
)[0]
routing_http2_enabled["Value"].should.equal("false")
@mock_elbv2
@mock_ec2
def test_modify_load_balancer_attributes_routing_http_drop_invalid_header_fields_enabled():
response, _, _, _, _, client = create_load_balancer()
arn = response["LoadBalancers"][0]["LoadBalancerArn"]
client.modify_load_balancer_attributes(
LoadBalancerArn=arn,
Attributes=[
{"Key": "routing.http.drop_invalid_header_fields.enabled", "Value": "false"}
],
)
response = client.describe_load_balancer_attributes(LoadBalancerArn=arn)
routing_http_drop_invalid_header_fields_enabled = list(
filter(
lambda item: item["Key"]
== "routing.http.drop_invalid_header_fields.enabled",
response["Attributes"],
)
)[0]
routing_http_drop_invalid_header_fields_enabled["Value"].should.equal("false")
@mock_elbv2
@mock_ec2
@mock_acm