Skip to main content
← Back to list
01Issue
FeatureOpenExtensions
AssigneesNone

Relationships

#1637 Add a list/discover method to the generated @swamp/aws types — no way to enumerate resources in a region

Opened by aaronge · 8/13/2026

Every generated @swamp/aws/* type exposes only single-resource CRUD, so there is no supported way to answer "what exists in this region". Any inventory, audit, topology, compliance or cost task has to start by enumerating resources, and today that requires leaving the official extensions.

(Re-submitted with --no-redact: the automatic redactor rewrote CloudFormation type names such as AWS-colon-colon-EC2-colon-colon-VPC into AWS[IP-1]::VPC, apparently reading the double-colon separator as compressed IPv6. Filed separately. Type names below are written with ~ in place of the double colon to survive redaction.)

Measured scope

Across the 6 pulled AWS extensions (ec2, ecs, eks, lambda, elasticloadbalancingv2, autoscaling) — 152 installed types:

method set count
create, delete, get, sync, update 118
create, delete, get, sync 30
create, delete, get, sync, update, discover 4 (added locally by us, not official)

So 148 official types, none with list, search or discover. get and delete both require an identifier that there is no supported way to obtain.

The obvious workaround does not work

@swamp/aws/resourceexplorer2 looks like the answer but only wraps Resource Explorer own configuration resources, all CRUD:

@swamp/aws/resourceexplorer2/index:                    create,get,update,delete,sync
@swamp/aws/resourceexplorer2/view:                     create,get,update,delete,sync
@swamp/aws/resourceexplorer2/default-view-association: create,get,update,delete,sync

The Resource Explorer Search API itself is not exposed.

Proposal

Add a list (or discover) method to the code generator so every type gets one, backed by CloudControl ListResources — already the dependency the family uses (npm:@aws-sdk/client-cloudcontrol@3.1090.0 in models/_lib/aws.ts), so this needs no new client surface.

Implementation notes from having built it

We implemented this over four types via export const extension and published it as @adernley/aws-disco. Findings that would apply to a generated version:

  1. ListResources is thin. For many types it returns nothing but the primary identifier — AWS~EC2~VPC yields {VpcId} only, no CidrBlock or Tags. Same for RouteTable, SecurityGroup, InternetGateway, NatGateway, VPCPeeringConnection, NetworkAcl. Others (Subnet, NetworkInterface, VPCEndpoint, PrefixList) come back rich. A usable list needs an opt-in GetResource hydration pass; ours runs at concurrency 4.
  2. Some children will not list without their parent. AWS~EC2~Route needs ResourceModel: {RouteTableId}, AWS~ECS~Service needs {Cluster}, AWS~EKS~Nodegroup needs {ClusterName}, AWS~ElasticLoadBalancingV2~Listener needs {LoadBalancerArn}. A generated method would need to know its parent key, or expose resourceModel as an argument.
  3. Parent-scoped listing returns duplicates. Asking each of 47 route tables for its subnet associations returned the same 62 associations 47 times — 2914 rows. Dedupe on type + identifier.
  4. Not everything is listable. AWS~EC2~NetworkAclEntry has no LIST handler and raises UnsupportedActionException. Worth tolerating and reporting per type rather than failing the call.
  5. Throttling arrives as a bare message. CloudControl returns Rate exceeded with no distinctive exception name in some cases; matching only on ThrottlingException misses it and aborts the run.
  6. Cardinality traps. AWS~ECS~TaskDefinition lists every historical revision, which dominates runtime on a long-lived account. Some form of cap or filter, plus honest truncation reporting, is needed.
  7. Pagination needs a ceiling and honest reporting. We cap pages and set a truncated flag; a capped listing that looks complete is worse than one that admits the gap.

Why it matters

Filing per the extension guide, which instructs raising a feature request when an official type covers the domain but lacks a needed method. This is the gap that made a custom extension necessary for what is otherwise a routine ask: draw the architecture of a region.

Environment

swamp 20260809.004828.0-sha.b61c9de2, @swamp/aws/ec2 2026.08.07.1, macOS (darwin arm64)

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

8/13/2026, 10:05:41 AM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.