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: CreateVolume with neither Size nor SnapshotId produces an 8 GiB volume where AWS refuses #712
createVolume (emulator/ec2_plugin.go:5024-5030) falls back to ec2DefaultVolumeSizeGiB (8)
when Size is absent. #689 made a named SnapshotId supply the size, and recorded the
remaining half in a comment rather than fixing it:
A request naming neither Size nor SnapshotId still gets the 8 GiB default rather
than the refusal AWS documents ("Size is required unless SnapshotId is specified").
That is a wider change than this one and a follow-up.
So CreateVolume with no parameters at all succeeds and produces an 8 GiB gp2 volume in us-east-1a, where real EC2 refuses. Two neighbouring silent-default rules in the same function
belong in the same decision:
AvailabilityZone is required by AWS and defaults to <region>a here.
The reason it is wider than #689: ec2DefaultVolumeSizeGiB is reached from the launch path too,
where a mapping legitimately has no size, so the constant cannot simply be removed — the refusal
has to live at CreateVolume's own parameter parse.
Acceptance criteria
CreateVolume with neither Size nor SnapshotId is refused, with the code, message and
status verified against AWS's CreateVolume reference (MissingParameter vs InvalidParameterValue decided on evidence, not assumption).
An unparseable or non-positive Size is refused rather than silently defaulted.
A decision recorded for a missing AvailabilityZone: refuse, or keep the default and say
why in the doc comment.
ec2DefaultVolumeSizeGiB's remaining callers documented, so it is clear the launch path
still needs it.
Table-driven tests per case, and any existing test that relied on the silent default
rewritten rather than extended.
Activity
fix(ec2): CreateVolume invents neither a size nor a zone (#712) (#723)