Repository navigation
Description
Found while trying to answer "which instances are not in a default VPC" from the graph.
What a VPC node looks like
ec2-multiregion-…-us-east-1::vpc physical=vpc-a5a41663
attrs = expAmiName, expDefaultSubnet1, expDefaultSubnet2, expDefaultVpcId,
expDefaultVpcInstanceId, expHttpPort, expInstanceId, expRoleName,
expStackName, expUnusedSecurityGroupId, expVpcId, expWebIp, …
Those are the stack's CloudFormation exports, and every node in the stack carries the same set. The VPC has no CidrBlock, no IsDefault, no InstanceTenancy — none of its own properties.
The same thing was true of snapshots before #1267, for the same reason: resolveTemplateAttrs resolves the stack's outputs and they get attached to every resource in it.
Why it matters
- "Is this the default VPC" is unanswerable. AWS returns
IsDefaultondescribe-vpcs; nothing carries it into the graph. An agent gets the right answer today by recognising the stringvpc-default, which is luck — it breaks on any estate where the default VPC is not conveniently named. - Every property question about a non-instance resource has the same hole. A subnet's
MapPublicIpOnLaunch, a route table's routes, a VPC's CIDR: the folds reach them through dependency observation (Observe the dependencies a declared estate references, not just what it manages #1273) or the deep path (Deep snapshots: record the property trees the folds need, not just identity #1267), and a plainattr:query on an observed node does not. - It bloats every node. 27 identical export attributes per node, repeated across the stack, in every graph dump an agent reads.
What the shape should be
A node's attrs should be that resource's own properties. Stack exports are stack-level and belong once, on the stack or the graph, not copied onto every member.
Both halves already exist elsewhere: observeDependencies (#1273) and observeAmbient (#1278) attach real per-resource payloads, and the deep path (#1267) records normalized property trees. What is missing is the managed thin path doing the same, instead of falling back to template outputs.
Bounding it
This is a change to what an observed node is, so it touches the overlay, graph --live, drift and behold. Worth deciding deliberately rather than adjusting resolveTemplateAttrs in place:
- do exports move to a stack-level field, or stay available under a prefix?
- does the thin path gain a per-resource read, or is that what deep depth is for?
- what does an existing snapshot's
attributesmean once the shape changes?
Not urgent
The benchmark tasks that touch it are answered today by other means, so nothing is blocked. It is the reason a whole class of attr: query silently returns nothing useful, which is worth fixing before someone relies on it.
Activity
feat(search): negate a term, and make a miss teach (#1280, #1265, #1279)
feat(search): a node carries its own properties, and says when --ambi…
fix(lifecycle): key order is not drift
fix(search): an unreadable query must not answer with an empty result
feat(observe): a resource records the region it was observed in
feat(graph): graph a recorded snapshot, so the estate need not be rea…
fix(search,graph): an unreadable estate names the recording it alread…
feat(search): say when an answer spans regions
fix(search): --show matches a column whatever case it was asked for
feat(aws): read the estate on the applier's transport, not the CLI (#…
fix(lifecycle): observed nodes carry their own properties, stack expo…