mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(elbv2): add listener attribute and capacity reservation actions (#1021)
@pulumi/aws 6.66+ calls DescribeListenerAttributes and DescribeCapacityReservation when refreshing Listener and LoadBalancer resources. Floci returned UnsupportedOperation for both, which crashes the AWS provider. Implement DescribeListenerAttributes and ModifyListenerAttributes (mirroring the existing load balancer / target group attribute handlers, backed by the Listener.attributes map) and DescribeCapacityReservation (reports an empty reservation, since Floci does not reserve load balancer capacity). Add integration coverage for all three actions and their not-found error paths.
This commit is contained in:
1 parent
8af3611d7a
commit
1dfa7bfcab
3 files changed
+167
No files matched your search
@@ -136,6 +136,37 @@ class ElbV2IntegrationTest {
|
||||
equalTo("deletion_protection.enabled"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(7)
|
||||
void describeCapacityReservationReturnsEmptyForLbWithoutReservation() {
|
||||
given()
|
||||
.formParam("Action", "DescribeCapacityReservation")
|
||||
.formParam("LoadBalancerArn", lbArn)
|
||||
.header("Authorization", AUTH)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.contentType("application/xml")
|
||||
.body("DescribeCapacityReservationResponse.ResponseMetadata.RequestId",
|
||||
not(emptyOrNullString()));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(8)
|
||||
void describeCapacityReservationUnknownLbThrows() {
|
||||
given()
|
||||
.formParam("Action", "DescribeCapacityReservation")
|
||||
.formParam("LoadBalancerArn",
|
||||
"arn:aws:elasticloadbalancing:us-east-1:000000000000:loadbalancer/app/missing/0123456789abcdef")
|
||||
.header("Authorization", AUTH)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body("ErrorResponse.Error.Code", equalTo("LoadBalancerNotFound"));
|
||||
}
|
||||
|
||||
// ── Target Groups ─────────────────────────────────────────────────────────
|
||||
|
||||
@Test
|
||||
@@ -311,6 +342,55 @@ class ElbV2IntegrationTest {
|
||||
.body("ErrorResponse.Error.Code", equalTo("DuplicateListener"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(33)
|
||||
void modifyListenerAttributes() {
|
||||
given()
|
||||
.formParam("Action", "ModifyListenerAttributes")
|
||||
.formParam("ListenerArn", listenerArn)
|
||||
.formParam("Attributes.member.1.Key", "tcp.idle_timeout.seconds")
|
||||
.formParam("Attributes.member.1.Value", "400")
|
||||
.header("Authorization", AUTH)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("ModifyListenerAttributesResponse.ModifyListenerAttributesResult.Attributes.member.Key",
|
||||
equalTo("tcp.idle_timeout.seconds"))
|
||||
.body("ModifyListenerAttributesResponse.ModifyListenerAttributesResult.Attributes.member.Value",
|
||||
equalTo("400"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(34)
|
||||
void describeListenerAttributes() {
|
||||
given()
|
||||
.formParam("Action", "DescribeListenerAttributes")
|
||||
.formParam("ListenerArn", listenerArn)
|
||||
.header("Authorization", AUTH)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("DescribeListenerAttributesResponse.DescribeListenerAttributesResult.Attributes.member.Key",
|
||||
equalTo("tcp.idle_timeout.seconds"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(35)
|
||||
void describeListenerAttributesUnknownListenerThrows() {
|
||||
given()
|
||||
.formParam("Action", "DescribeListenerAttributes")
|
||||
.formParam("ListenerArn",
|
||||
"arn:aws:elasticloadbalancing:us-east-1:000000000000:listener/app/missing/0123456789abcdef/0123456789abcdef")
|
||||
.header("Authorization", AUTH)
|
||||
.when()
|
||||
.post("/")
|
||||
.then()
|
||||
.statusCode(400)
|
||||
.body("ErrorResponse.Error.Code", equalTo("ListenerNotFound"));
|
||||
}
|
||||
|
||||
// ── Rules ─────────────────────────────────────────────────────────────────
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user