You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ec2: DescribeInstances and DescribeInstanceAttribute report no blockDeviceMapping #669
v0.103.0 (#666) made a launch's block device mappings observable by materializing real
volumes, so DescribeVolumes now answers "how large is this instance's root volume". It
deliberately stopped short of rendering the mappings on the instance itself.
Two surfaces are still silent:
DescribeInstances renders no blockDeviceMapping set, so a caller cannot learn a
device's volumeId or deleteOnTermination without going to DescribeVolumes and
filtering on attachment.instance-id. Real EC2 answers it directly.
DescribeInstanceAttribute still refuses blockDeviceMapping explicitly
(emulator/ec2_instanceattribute.go), which was correct when there was nothing to
render and is now a refusal of a question substrate can answer.
AWS's EbsInstanceBlockDevice — the shape both surfaces render per device — carries associatedResource, attachTime, deleteOnTermination, ebsCardIndex, operator, status, volumeId and volumeOwnerId, and no size. So neither surface would have
closed #666's gap, and adding them would have been scope beside the fix rather than part
of it. The state they need now exists.
Acceptance criteria
DescribeInstances renders blockDeviceMapping>item per attached EBS volume, with deviceName and an ebs sub-element carrying volumeId, status, attachTime and deleteOnTermination — the members AWS's own sample response shows, and no
fabricated ones.
RunInstances' response renders the same set, since the reference shows it there too.
DescribeInstanceAttribute with Attribute=blockDeviceMapping answers rather than
refusing, and blockDeviceMapping leaves the explicit-refusal list with a test
asserting the refusal list shrank deliberately.
Moved to milestone v0.105.0. v0.104.0 ships the #662 privilege-boundary fix alone, matching how #660 shipped as v0.102.0 — a false-allow in the authorization path gets a release to itself.
Research findings
Verified against the AWS EC2 API reference and the tree this session:
AWS's InstanceBlockDeviceMapping has exactly two members, deviceName and ebs. EbsInstanceBlockDevice has eight, of which substrate can honestly source four: volumeId, status, attachTime, deleteOnTermination. That is exactly what the DescribeInstances sample response shows, and in that order — so the acceptance criterion's member list is the right one and needs no widening.
RunInstances' own sample response emits <blockDeviceMapping /> (empty), because the instance in that sample is still pending. Worth deciding deliberately whether substrate matches that or renders the mappings it has just created.
The "refusal list" this issue refers to is really the default arm of ec2AttributeSupported's allow-list (emulator/ec2_instanceattribute.go:157-165) — there is no explicit deny list. So the change is "the allow-list grew, and the refusal test row at emulator/ec2_instanceattribute_test.go:259 is deleted", which is what the "refusal list shrank deliberately" criterion should assert against.
The groupSet pointer-wrapper lesson (emulator/ec2_instanceattribute.go:63-70) applies verbatim to this attribute's response shape: an SDK distinguishes an empty array from a nil one, so an instance with no EBS mappings must render an empty blockDeviceMapping element rather than omitting it.
Incidental but in the blast radius: ec2_plugin.go holds two duplicate function-local ec2InstanceItem structs (:784 and :943). Rendering a new member means editing both. They should be hoisted, following ec2GroupItem (:649) whose comment records the EC2: launch template NetworkInterfaces is dropped, so template-specified subnets are ignored #444 drift bug this exact duplication caused before.
Activity
scttfrdmn commentedon Aug 20, 2026
Moved to milestone v0.105.0. v0.104.0 ships the #662 privilege-boundary fix alone, matching how #660 shipped as v0.102.0 — a false-allow in the authorization path gets a release to itself.
Research findings
Verified against the AWS EC2 API reference and the tree this session:
InstanceBlockDeviceMappinghas exactly two members,deviceNameandebs.EbsInstanceBlockDevicehas eight, of which substrate can honestly source four:volumeId,status,attachTime,deleteOnTermination. That is exactly what theDescribeInstancessample response shows, and in that order — so the acceptance criterion's member list is the right one and needs no widening.RunInstances' own sample response emits<blockDeviceMapping />(empty), because the instance in that sample is stillpending. Worth deciding deliberately whether substrate matches that or renders the mappings it has just created.defaultarm ofec2AttributeSupported's allow-list (emulator/ec2_instanceattribute.go:157-165) — there is no explicit deny list. So the change is "the allow-list grew, and the refusal test row atemulator/ec2_instanceattribute_test.go:259is deleted", which is what the "refusal list shrank deliberately" criterion should assert against.EC2Instancehas noBlockDeviceMappingsfield, so deriving the response from the volume records EC2: RunInstances' inline BlockDeviceMapping.N.Ebs.* is parsed nowhere and never reaches DescribeVolumes #666 created is not merely preferable — it is the only possible implementation. The "derived from the volumes, not the recorded request" criterion is therefore free.groupSetpointer-wrapper lesson (emulator/ec2_instanceattribute.go:63-70) applies verbatim to this attribute's response shape: an SDK distinguishes an empty array from a nil one, so an instance with no EBS mappings must render an emptyblockDeviceMappingelement rather than omitting it.ec2_plugin.goholds two duplicate function-localec2InstanceItemstructs (:784and:943). Rendering a new member means editing both. They should be hoisted, followingec2GroupItem(:649) whose comment records the EC2: launch template NetworkInterfaces is dropped, so template-specified subnets are ignored #444 drift bug this exact duplication caused before.feat(ec2): an instance reports its own block devices (#669) (#679)