mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
feat(ec2): return an empty set for DescribeVpnGateways (#1975)
* feat(ec2): return an empty set for DescribeVpnGateways There is no VPN gateway model, so an empty vpnGatewaySet is AWS-accurate for an account without VPN gateways. Unblocks the CDK CLI's VPC context provider (Vpc.fromLookup), which always issues this describe and aborts the whole lookup on UnsupportedOperation. Fixes #1974 * test(ec2): assert the vpn gateway set is empty, not merely present The substring check passed for any response containing <vpnGatewaySet, including a non-empty one, so it did not pin the empty-result contract. Uses the item count, matching the other empty EC2 collection tests.
This commit is contained in:
1 parent
a01b707bdc
commit
3baf4f4849
2 files changed
+31
No files matched your search
@@ -111,6 +111,11 @@ public class Ec2QueryHandler {
|
||||
case "DeleteInternetGateway" -> handleDeleteInternetGateway(params, region);
|
||||
case "AttachInternetGateway" -> handleAttachInternetGateway(params, region);
|
||||
case "DetachInternetGateway" -> handleDetachInternetGateway(params, region);
|
||||
// VPN Gateways. There is no VPN gateway model; an empty set is
|
||||
// AWS-accurate for an account without VPN gateways and unblocks the
|
||||
// CDK VPC context provider, which always issues this describe.
|
||||
case "DescribeVpnGateways" -> handleDescribeVpnGateways();
|
||||
|
||||
// Route Tables
|
||||
case "CreateRouteTable" -> handleCreateRouteTable(params, region);
|
||||
case "DescribeRouteTables" -> handleDescribeRouteTables(params, region);
|
||||
@@ -1435,6 +1440,16 @@ public class Ec2QueryHandler {
|
||||
return xmlResponse(xml.build());
|
||||
}
|
||||
|
||||
private Response handleDescribeVpnGateways() {
|
||||
XmlBuilder xml = new XmlBuilder()
|
||||
.start("DescribeVpnGatewaysResponse", AwsNamespaces.EC2)
|
||||
.elem("requestId", UUID.randomUUID().toString())
|
||||
.start("vpnGatewaySet")
|
||||
.end("vpnGatewaySet")
|
||||
.end("DescribeVpnGatewaysResponse");
|
||||
return xmlResponse(xml.build());
|
||||
}
|
||||
|
||||
private Response handleDescribeRouteTables(MultivaluedMap<String, String> p, String region) {
|
||||
List<String> ids = getList(p, "RouteTableId");
|
||||
Map<String, List<String>> filters = getFilters(p);
|
||||
|
||||
Reference in new issue
Block a user