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: RunInstances accepts any ImageId, with no InvalidAMIID.NotFound or .Malformed #733
Found in the live SDK runs for milestone 92 (v0.107.0). RunInstances accepts any --image-id, including one that names no image and one that is not an AMI ID at all:
AWS publishes both errors for RunInstances: InvalidAMIID.NotFound ("The specified AMI does
not exist") and InvalidAMIID.Malformed ("The specified AMI ID is not valid. Ensure that you
provide the full AMI ID, in the form ami-xxxxxxxxxxxxxxxxx"). There is also InvalidAMIID.Unavailable for one that exists but is not usable.
This is the highest-value of the launch-path gaps because AI-generated IaC gets AMI IDs wrong
constantly — a hardcoded region-specific AMI, a stale one, a placeholder — and substrate
currently launches happily from every one of them. A test that should have caught the mistake
passes.
ec2ImageIDKind already exists (emulator/ec2_resourceid.go), and #713 established ec2RequireResource as the one place a Invalid*.NotFound / Invalid*.Malformed pair comes
from, so the shape of the fix is settled. The care needed is over the launch path's other
image consumers: ec2VolumeFromMapping, the phantom-snapshot fallback #711 pinned, and the
default-AMI behaviour a launch with no ImageId relies on.
Acceptance criteria
RunInstances answers InvalidAMIID.Malformed for an ID that is not ami- + 17 hex,
and InvalidAMIID.NotFound for a well-formed one naming no image, via ec2RequireResource(ec2ImageIDKind, …).
CreateFleet/RequestSpotInstances and the launch-template paths that name an AMI are
surveyed in the same pass; each is fixed or listed with the reason it is not.
The bundled default AMIs still launch, and a launch that names no ImageId behaves as it
does today — both pinned.
InvalidAMIID.Unavailable is either implemented or documented as out of scope with the
reason.
Activity
fix(ec2): a volume or AMI ID that names nothing is an error (#731) (#742