Commit Graph
3406 Commits
Author SHA1 Message Date
Hector Ventura 255162654f fix(lambda): refuse function URLs in GovCloud and China (#5615)
The AWS GovCloud (US) User Guide lists "AWS Lambda Function URLs is not
available"
(https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-lambda.html)
and the China guide "Amazon Lambda Function URLs is not available in the
China Regions"
(https://docs.amazonaws.cn/en_us/aws/latest/userguide/lambda.html), but
CreateFunctionUrlConfig created one in every partition, on a host no
source publishes for either of them.

CreateFunctionUrlConfig now refuses a request whose region is in
aws-us-gov or aws-cn with an InvalidParameterValueException, which the
lambda model declares for the operation. No source shows AWS's message,
so the wording is Floci's own, as for the API Gateway EDGE gate. The
AWS::Lambda::Url provisioner creates through the same service method, so
a stack in those partitions fails with that error. Get, Update and Delete
act on an existing config and are unchanged. The ISO and EUSC partitions
are left as they are because no source covers them, and the open
question about the function URL host now names only those two.

The Java compat suite skips LambdaFunctionUrlTest in those two partitions,
so the China partition nightly stays green.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-13 23:58:42 -04:00
Andre Kurait 63e0302c12 fix(apigateway): validate and normalize imported integration types (#5543)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-13 23:48:12 -04:00
Priamo Germosen eba058266b fix(iam): authorize an operation as the action AWS checks for it (#5604)
Under enforcement a request naming its operation, in a Query Action or an
X-Amz-Target header, was authorized as <namespace>:<Operation>, the operation's
own name. AWS authorizes some operations as an action of another name: SQS
SendMessageBatch, DeleteMessageBatch and ChangeMessageVisibilityBatch as
sqs:SendMessage, sqs:DeleteMessage and sqs:ChangeMessageVisibility, and SNS
PublishBatch as sns:Publish. None of the batch names is an IAM action, so a policy
AWS honours for a batch call was denied, and a policy naming the batch operation
granted something AWS does not check.

AWS publishes the mapping in the Operations of each Service Reference file.
tools/aws/regen_iam_authorized_actions.py vendors the operations authorized by
exactly one action of their own namespace under another name, 235 over 33
namespaces, into src/main/resources/aws/iam-authorized-actions.json. Everything else
keeps its own name. The generator leaves out operations that list:
- several actions, whose extras apply only when tags or a role are passed;
- no action, which is missing data;
- an action of another namespace;
- another action while one of the operation's own name exists;
- a tagging action alone;
- the same action for several SDK clients, which AWS can authorize differently,
  as S3 and S3 Control's GetPublicAccessBlock;
or whose name is listed again with another answer. A record of the wrong shape
fails the run instead of being skipped.
make iam-authorized-actions-check gates the file's shape on pull requests that touch it, and
iam-authorized-actions-verify, run by the IAM Data Drift workflow, checks every
entry against AWS.

IamAuthorizedActions reads the file through the new core.common
VendoredResources, rather than adding one more copy of the read-or-fail block a
dozen catalogs carry, and the Query and X-Amz-Target paths ask it for the action.
DynamoDB TransactGetItems, which AWS authorizes as dynamodb:GetItem, keeps its own
name: the transaction check recognizes the call by it and checks every Get as
dynamodb:GetItem on its own table, with its own dynamodb:LeadingKeys. Renamed, the
call would skip that check and be authorized as one GetItem whose body has no
top-level Key, which a ForAllValues condition accepts, so a fine-grained policy
would grant every key.

The check for operations AWS serves without credentials reads the Query action
directly, rather than through resolve with a placeholder scope, now that resolve
returns the authorized action. A Query request naming no action is not one of them.

An SDK compatibility test covers SendMessageBatch and PublishBatch, granted by
the single-item action and refused under the batch name, with enforcement on.
2026-10-13 22:29:06 -05:00
Priamo Germosen c6c2c609c3 fix(stepfunctions): authorize a Lambda task as the state machine's execution role (#5554)
Under IAM enforcement, a Lambda task naming a function in another account was refused outright,
because Floci evaluated no Lambda function policy when #5079 added the check, and a task on a
function in the state machine's own account was not checked at all. Function policies now take
part in authorization (#5476), so a task is decided the way Lambda decides the Invoke call the
execution role makes (Step Functions Developer Guide, "I can't invoke a Lambda function from
another account"): within one account the role's policies or the function's policy can allow it,
and across accounts both have to (IAM User Guide, cross-account policy evaluation logic).

- LambdaTaskAuthorizer evaluates the role's policies, its permissions boundary and its account's
  SCPs together with the function policy LambdaResourcePolicyProvider supplies. The role ARN has
  to name an existing role, path included, matched as STS AssumeRole matches one
  (IamService.roleArnMatches), and the role is evaluated under the ARN IAM holds for it.
- The task is authorized against the function ARN LambdaArnUtils.functionArn gives for its
  reference: a full ARN as written, a name or partial ARN completed in the state machine's
  partition, Region and account, with the version or alias it names, as Lambda authorizes an
  invoke.
- A task whose Credentials name a role invokes the function as that role, once the execution role
  has assumed it (Developer Guide, Task state "Credentials"). The role's trust policy has to allow
  the execution role, with the state machine's ARN as sts:ExternalId, which the cross-account
  tutorial's trust policy checks. The execution role's own policies have to allow sts:AssumeRole
  on the role too when it is in another account, or when the trust policy names only the execution
  role's account, since an account principal delegates to the account (IAM User Guide, "AWS
  account principals"); AssumeRolePolicyEvaluator.decide tells the two grants apart. RoleArn is
  read the way the task's Parameters or Arguments are. A role the execution role cannot assume
  fails the task with States.Permissions, the Developer Guide's error for a task without the
  privileges to run.
- A refusal to invoke fails the task with Lambda.AccessDeniedException. The cause names the role's
  session as the Step Functions Developer Guide shows it
  (arn:aws:sts::<account>:assumed-role/<role>) and ends in the IAM User Guide's context for the
  policy type that refused it, explicit denials first, each in AWS's evaluation order: service
  control policies, the resource-based policy or role trust policy, identity-based policies, the
  permissions boundary.
2026-10-13 22:28:56 -05:00
Priamo Germosen 287d683da7 feat(iam): populate aws:username, aws:userid and aws:PrincipalType (#5568)
The request context carried seven aws: keys plus aws:PrincipalArn, and none of
the three that say who is calling. A Condition matching on any of them could
not match, which is also why an IAM policy variable has nothing to resolve:
AWS's own IAMUserChangePassword policy scopes itself to user/${aws:username},
and substituting that needs the key to exist before it needs a substituter.

The values come from the user guide's principal key values list, one shape per
principal: Account with the account id for the account-root principal and for a
session token it minted, User with the user's own id for an IAM user access key
and for a session token that user minted, FederatedUser with account:name for a
GetFederationToken session, and AssumedRole with role-id:session-name for a role
session, which for a role on an EC2 instance is role-id:instance-id.

aws:username is the exception and is only published for an IAM user. The guide
is explicit: "always included in the request context for IAM users" while
"anonymous requests and requests that are made using the AWS account root user
or IAM roles do not include this key". Leaving it absent is what makes a
statement matching on it fail to match, which is the documented behaviour for a
key with no value, so the absence is the enforcement rather than a gap in it.

One judgement. The principal key values list renders the role-session type both
as AssumedRole and, twice, as "Assumed role". The unspaced form is the one that
fits the vocabulary of every other value in that list, each a single word or
CamelCase, and it is the form AWS publishes machine-side, as CloudTrail's
userIdentity.type does.

aws:userid was already derived in full by resolveCallerUserId, for every
principal type including the EC2 and ECS session-name fallbacks, so that
derivation is now a shared sessionUserId rather than a second copy inside
resolveCallerArns: reporting one key two ways is how the two readers would
drift. CallerArns carries the three values so they come from the single lookup
its javadoc already required, two lookups being able to straddle a session's
expiry, and it writes them itself, so every context a request is evaluated
against describes the same principal and there is one place that decides which
keys a principal publishes. The enforcement filter builds one context per
resource the request names and, since #5576, one per transaction item, which is
what a policy scoped to dynamodb:LeadingKeys = ${aws:userid} will need. S3
builds one of its own when s3.enforce-auth has it evaluate a bucket policy
there and then, and that one carried aws:PrincipalArn alone, so an inverted
Condition on any of the three keys held against a caller that has them and
fired a Deny the policy meant to leave alone.

Three unit tests and four integration tests, one on the transaction-item path
and one in S3's own bucket-policy class, with the existing caller-ARN
assertions widened to pin the keys for the root, federated and user-minted
session principals they already covered. Each key probed by dropping it alone:
without aws:PrincipalType or aws:userid both enforcement tests fail, without
aws:username one does, and giving a role session a username it should not have
fails the test that asserts the absence. The two contexts outside the filter
are probed the same way, each reverted to aws:PrincipalArn alone, and each
fails its own test. 4489 tests pass at this commit, across all 277 IAM and
core/common classes, the shared enforcement fixtures, and the S3 policy,
enforcement, presigned and account-context ones, the shared filter and
CallerArns reaching all of them. Checkstyle and docs-check clean.
2026-10-13 22:28:47 -05:00
Priamo Germosen c5a964297e fix(sns): carry Status on VerificationException (#5602)
VerifySMSSandboxPhoneNumber's VerificationException declares two required
members, Message and Status, and Floci sent only the message, so status() came
back null in the SDKs.

AWS documents no values for Status, and no recorded response carries one, so
Floci picks one from what the API does publish: the number's own verification
status, which a wrong password leaves Pending. Pending and Verified are the only
statuses SNS defines for a sandbox number, and the developer guide reads a
number left Pending as an unsuccessful verification. docs/services/sns.md says
the value is Floci's choice.

JSON errors already write an exception's extra members into the body. Query
errors did not: SnsQueryHandler built them from the code, message and status
alone. AwsQueryResponse gains an error overload that writes the extra members
into <Error> after <Message>, where the SDKs read them, and every SNS catch site
now passes the exception through it.

Refs #5570
2026-10-13 22:28:37 -05:00
Hector Ventura 73b034aa18 feat(ui): turn the landing page into a dashboard with a built-in wait view (#5594)
* feat(ui): turn the landing page into a dashboard with a built-in wait view

The page served to browsers on / becomes a dashboard: how to connect
(endpoint, region, account and copyable snippets), the init stages and
scripts, runtime facts, services grouped by category with a filter, and
an opt-in news panel. The top bar shows the emulator status and its
version, and reports "Shutting down" once shutdown has started.

The news panel makes no request until it is turned on. It then reads
floci.io/news.json, a feed shared by every Floci emulator: an item may
carry a product, and this page shows items for "aws" and items with no
product. The choice is remembered in local storage when the browser
allows it and otherwise lasts for the page view. An item without a date
is shown without one.

The "starting Floci UI" interstitial is now a second view of the same
file, picked from the request path, so /_floci/ui serves index.html and
starting.html is removed. The wait view shows elapsed time, the error
the emulator reports, and a retry, and still redirects once the UI
sidecar is ready.

StartingPageEscapesUntrustedTextTest now reads index.html: the launch
error must go through textContent and the status error shown on the
dashboard must be escaped.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(ui): correct the update hint and the news gate wording, drop em-dashes

The release note told users to run "floci update", which replaces only
the CLI binary; "floci start" pulls with the "missing" policy and
"floci restart" forces it, so a cached image stayed in place. The note
now says to pull the new image and restart, and gives the CLI form:
"floci stop", then "floci start --pull always".

The news gate said the page only talks to the local emulator, which is
not true while the fonts load from Google Fonts. It now says what holds:
nothing is fetched from the news host until news is turned on.

Em-dashes are removed from the UiController Javadoc, the Runtime
placeholders and the page title.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-13 23:26:58 -04:00
Hector Ventura 8bd88bfb40 fix(codepipeline): link approval notifications to the partition's console host (#5595)
* fix(codepipeline): link approval notifications to the partition's console host

The approval-needed notification built consoleLink and approvalReviewLink on
the commercial console host for every pipeline, so a pipeline in China or
GovCloud sent its approver to a console where the pipeline does not exist.

The console host becomes a vendored per-partition fact, consoleHost in
aws/region-facts.json, read by the generator from the user-guide snapshots
under local/aws/aws-docs/partition-guides: cn/console.md for aws-cn
(console.amazonaws.cn), gov/configure-account.md for aws-us-gov
(console.amazonaws-us-gov.com) and gov/govcloud-organizations.md for the
commercial host. The China guide also spells the host console.www.amazonaws.cn
once, in cn/managing-aws.md; the console page's own statement is the one used.
A guide page that lost its sentence, or states two hosts with it, fails the
generation instead of leaving a stale value.

CodePipelineEventPublisher resolves the host from the execution's region, since
it runs on a worker thread without a request context. No source states a
console host for the ISO or EUSC partitions, which keep the commercial one and
are listed as an open question. The path after the host stays the commercial
console's: no source gives the per-service path per partition.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(codepipeline): parse the China console host from the Markdown guide page, require sourced hosts

AWS serves each user-guide page as Markdown at the same URL with .md in
place of .html, and that rendering writes the China console host as a
link, "[https://console.amazonaws.cn](https://console.amazonaws.cn).".
The aws-cn pattern only took the page-text form, so a snapshot saved
from the Markdown page failed the generator, and with it the rest of
"make aws-data-sync". The pattern now takes both forms.

The docstring names the three guide page URLs and the path each is
saved under.

self_check now requires consoleHost for the three partitions that have
a source (aws, aws-cn, aws-us-gov). The shape-only check used when the
sources are not checked out accepted a file without them, which would
link approval notifications to the commercial console.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-13 23:02:27 -04:00
Allen SanbornandPriamo 05e1bebe1e fix(elasticache): restore groups and clusters of every account (#5244)
* fix(elasticache): restore groups and clusters of every account

restorePersistedRuntime scanned the replication group and cache cluster
stores with scan(k -> true), which is scoped to the calling account. At
boot there is no request context, so only the default account's records
were re-provisioned: groups and clusters of any other account kept a
stale status with no data plane, and their proxy ports were never
reserved, so the next create could be handed the same port.

Scan every account with scanAllAccountEntries and carry the owning
account through the restore path, so each write-back, and the
deleted-while-restoring check, works on the owner's record instead of
copying it into the default account. Unprefixed group and cache cluster
records from before account prefixing are moved under the default
account first, as get() does on first read, so they are restored once
and a delete does not leave a legacy copy to come back on the next boot.

The proxy authenticates on its own thread, outside any request, so a
validator that looked the group or cluster up by id alone read the
default account. The validator now carries the owning account captured
when the proxy is registered, and reads the group, cluster, user groups
and users for that account.

The set of records holding their port is keyed by account and id, so
deleting one of two same-named groups in different accounts no longer
leaks the other's port.

* fix(elasticache): read a group's auth mode under its owning account

The proxy's authMode() callback still looked the group up by id alone.
ModifyReplicationGroup does not restart the proxy, so that callback is
how it learns a group dropped its last user group. On the proxy thread
the read landed in the default account, so another account's proxy kept
its starting mode, or picked up a same-named default-account group's
mode. Read it with getForAccount, like the other callbacks.

Moves the cross-account restore and proxy tests into
ElastiCacheServiceTest and adds one for the auth-mode read.

* fix(elasticache): check a proxy's IAM tokens against the cache's own account

The auth proxy validates IAM tokens on its own thread, outside any
request, so the long-term access key lookup fell back to the default
account: a replication group or serverless cache of any other account
rejected tokens signed with its own account's keys, restored or not.

The proxy now passes the owning account its authenticator already
captures, and SigV4RequestValidator resolves the key with
findSecretKeyInAnyAccount, accepting it only when that account holds it.
Temporary session keys are found whichever account issued them, as
before. Callers that pass no account, RDS and MemoryDB among them, keep
the existing lookup.

* test(compat): poll SDK waiters once a second and let ECS test tasks exit on SIGTERM

The slowest sdk-test-java classes spent most of their time sleeping rather than testing.

SDK waiters sleep out the published AWS cadence between checks: 6 s for ECS TasksStopped, 15 s for
ServicesStable and 30 s for the CloudFormation and EKS waiters, where Floci has usually settled
within one. TestFixtures.waiterOverride(timeout) keeps each call's timeout, and against Floci checks
once a second with an attempt limit to match; against real AWS the waiter keeps its own cadence.
The ECS, EKS and CloudFormation waiters in these classes now use it.

The capacity-provider service test and the one-shot task's explicit-stop test ran a bare sleep as
the container's PID 1, which has no default SIGTERM handler, so every stop sat out the whole
stopTimeout grace period, four times per case for deleteService. They now trap TERM, as the ECS and
EKS Docker integration tests already do.

* test(ec2): let the volume test's instance containers exit on SIGTERM

Ec2VolumeBlockDeviceDockerIntegrationTest ran its instance and cluster-node containers with a bare
"sleep 3600" as PID 1, which has no default SIGTERM handler, so every stop sat out the whole grace
period: the 30 s Ec2ContainerManager.stop gives a container when the root-device test stops its
instance, and the 2 s of the cleanup stop after every test. Both containers now trap TERM, as the
ECS and EKS Docker integration tests already do.

---------

Co-authored-by: Priamo <pgermosen@gmail.com>
2026-10-13 22:34:00 -04:00
David Phillips 2aca536bec fix(rds): use cluster IAM policies for Aurora members (#5605) 2026-10-13 21:51:57 -04:00
Vũ Thế Huy a95b01020b feat(redshift-serverless): add UpdateSnapshot (#5537)
Change a snapshot's retentionPeriod (-1 for indefinite) with the same validation as CreateSnapshot; an omitted period leaves the snapshot unchanged.
2026-10-13 21:51:23 -04:00
TATSUNO “Taz” Yasuhiro dd0f40fcbb fix(dynamodb): use the AWS wording when Query or Scan rejects AttributesToGet with a Select (#5599)
* fix(dynamodb): use the AWS wording when Query or Scan rejects AttributesToGet with a Select

* refactor(dynamodb): share the Select conflict check for ProjectionExpression and AttributesToGet
2026-10-13 21:37:02 -04:00
David Phillips ddc0e0257b fix(autoscaling): preserve launch configuration user data (#5600)
* fix(autoscaling): preserve launch configuration user data

* fix(autoscaling): reject unusable launch configuration data
2026-10-13 21:26:05 -04:00
Vũ Thế Huy 86b19047f3 fix(elasticache): return modeled wire error codes for replication group and user name faults (#5571)
CreateReplicationGroup threw ReplicationGroupAlreadyExistsFault, whose modeled wire code is ReplicationGroupAlreadyExists at HTTP 400. ModifyReplicationGroup's duplicate user name check threw DuplicateUserNameFault, whose modeled wire code is DuplicateUserName, matching the user group create path.
2026-10-13 20:56:08 -04:00
TiM ca1d74c49e fix(s3): compare conditional GET dates at second precision (#5598)
A client revalidating with the Last-Modified it was given now gets 304
for If-Modified-Since and 200 for If-Unmodified-Since on GetObject and
HeadObject, as S3 answers.

Objects are stamped to the millisecond while Last-Modified and HTTP
dates carry whole seconds, so at an object's own Last-Modified the
stored time was up to 999 ms later than the header and compared as
modified. checkPreconditions now truncates the stored time to seconds
before the date comparisons, as checkCopySourcePreconditions and
ByteRange.rangeApplies already do.

Tests: a stubbed object stamped .456Z covers both headers at LM-1s, LM
and LM+1s on GET and HEAD, with a .000Z control; the at-LM .456Z cases
fail without the fix. HTTP round-trip tests cover the real write path.
2026-10-13 20:43:14 -04:00
David Phillips 9ab820d7f7 fix(iam): preserve later policy writes during rollback (#5596)
* fix(iam): preserve later policy writes during rollback

* fix(iam): explain rollback ownership conflicts
2026-10-13 20:35:35 -04:00
David Phillips d5c6a36ac9 fix(auth): explain signature date and service mismatches (#5591)
* fix(auth): explain expired query signatures and service mismatches

* fix(auth): distinguish future and expired signatures
2026-10-13 20:11:09 -04:00
Hector Ventura dbf6c3016d fix(appsync): name the one service principal in a data-source denial (#5593)
AppSyncDataSourceAuthorizer built its principal as "appsync." plus the
region's DNS suffix, so in China the denial read "service role does not
trust appsync.amazonaws.com.cn". A service principal is
<service>.amazonaws.com in every partition; the trust check already
folded both forms, so only the message was wrong. It now comes from
ServicePrincipals.of, as the repository rules ask.

Two Javadocs said a layer ARN "outside the aws partition" is rejected.
The check compares with the request's partition (the deployment's only
outside a request), so for a China request the foreign partition is
aws. They now say "outside the request's partition".

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-13 20:07:10 -04:00
David Phillips 1d8f65d231 fix(iam): enforce user and group inline policy quotas (#5590) 2026-10-13 19:31:32 -04:00
Priamo Germosen b7a1bde2dc feat(sns): add topic permissions, the SMS sandbox and SMS opt-out (#5570)
SNS's Query routing set listed ten names that neither SNS handler dispatched, so a
request for any of them was answered UnsupportedOperation. All ten are real SNS
operations, and both the Query and JSON protocols now serve them.

AddPermission and RemovePermission edit the topic's Policy attribute the way AWS
does, going by LocalStack's recordings of the same calls against a live account:
the label becomes the statement's Sid, each account its root principal, and a single
account or action is written as a string. A duplicate label, an action outside SNS
and a missing topic get AWS's errors. A label the policy does not hold leaves it
unchanged, since no source shows what AWS answers there. Floci stores topic policies
but does not evaluate them under enforcement, so the grant only shows in
GetTopicAttributes.

The default topic policy now matches what AWS returns for a new topic: Version
2008-10-17 with an AWS:SourceOwner condition, where Floci has had 2012-10-17 and
AWS:SourceAccount since the first commit. AddPermission builds on it.

GetSMSSandboxAccountStatus reports the account outside the sandbox, because Floci
delivers SMS to any number. The sandbox numbers still work per account and region,
without the limits AWS lifts outside the sandbox. CreateSMSSandboxPhoneNumber texts a
six-digit code through the same path as Publish, so a test reads it from /_aws/sns,
and VerifySMSSandboxPhoneNumber checks it.

No number is ever opted out. AWS opts a number out when its owner replies STOP, and
nothing reaches Floci that way, so CheckIfPhoneNumberIsOptedOut answers false,
ListPhoneNumbersOptedOut is empty, and OptInPhoneNumber checks only the E.164 format,
with AWS's error for a malformed number.

AddPermission takes only twelve-digit account IDs, so a malformed one cannot end up as
a principal in the stored policy.

Each of these edits reads a record, changes it and writes it back. AddPermission,
RemovePermission and SetTopicAttributes, which writes the same Policy attribute, are
synchronized, as are the sandbox's create, verify and delete, so overlapping requests
cannot lose a grant or bring back a deleted number. A number whose verification text
cannot be recorded is put back as it was. The tests park the first of two edits inside
that window and check the second waits. testing.ThreadStates holds the wait they use,
which several other test classes still carry their own copies of.

With SNS dispatching AddPermission and RemovePermission, the last two rows of the
Query routing gap file, SQS's two names reaching SNS without a Version, are gone,
leaving 171. The SNS row in docs/services/index.md now counts 39 operations, up
from a stale 17.

Refs #5549
2026-10-13 17:55:05 -05:00
Priamo Germosen a88ef42b4b feat(s3): read one part of an object with GetObject and HeadObject partNumber (#5569)
GetObject and HeadObject ignored partNumber, so a client reading a
multipart object one part at a time downloaded the whole object for
every part, and never learned how many parts there were. The API
Reference describes partNumber as "effectively" a ranged GET or HEAD
for that part, with x-amz-mp-parts-count "only returned if you specify
partNumber in your request and the object was uploaded as a multipart
upload".

Both now answer partNumber as S3 does in LocalStack's AWS-validated
test_get_object_part, test_get_object_part_checksum and
test_complete_multipart_parts_checksum captures: 206 with the part's
Content-Range and Content-Length, the object's ETag, and
x-amz-mp-parts-count for an object completed from a multipart upload.
An object stored in one request is its own part 1. A part the object
does not have is 416 InvalidPartNumber, naming PartNumberRequested and
ActualPartCount, and partNumber with a Range header is 400
InvalidRequest. A part streams from storage like a range, so the parts
of a large object are read one at a time without holding it.

With checksum mode on, a part of an object with a COMPOSITE checksum
gets that part's own checksum, of type COMPOSITE, and a part that is all
of its object gets the object's checksum; any other part of a
FULL_OBJECT multipart object gets none, as the captures show.

A part number below 1 is 400 InvalidArgument, and one above the part
count, past 10,000 or not, is the 416, as the AWS SDK for Java documents
for partNumber; the 400 carries the wording and fields the captures
record for UploadPart. Part 1 of an empty object succeeds, as the AWS
SDKs' integration tests that download an empty object by part expect,
with no Content-Range, which the CRT client reads only from a part with
bytes, and so with 200, since a 206 must carry one (RFC 9110 15.3.7).

GetObject's ranged response and HeadObject now build their common
headers with GetObject's, given the length served.
2026-10-13 17:46:30 -05:00
David Phillips c907eec9d2 fix(sts): require long-term callers for federation tokens (#5586)
* fix(sts): require long-term callers for federation tokens

* fix(sts): preserve temporary federation caller refusals

* fix(sts): refuse temporary federation callers before dispatch
2026-10-13 18:31:06 -04:00
David 5e48cbb80b feat(rds): IAM role associations for DB clusters and instances (#5367)
* feat(rds): IAM role associations for DB clusters and instances

AddRoleToDBCluster, RemoveRoleFromDBCluster, AddRoleToDBInstance and
RemoveRoleFromDBInstance answered UnsupportedOperation, and DBCluster
and DBInstance carried no AssociatedRoles, so Terraform's
aws_rds_cluster_role_association and aws_db_instance_role_association
could not apply.

Clusters and instances now keep their associated roles and report them
as AssociatedRoles, ACTIVE as soon as they are added. The four actions
raise the faults the API model lists, and CreateDBCluster accepts
AssociatedRoles, checked before the cluster is created. Feature names
are not yet validated against the engine.

Closes #5343

* fix(rds): route the instance role actions, and refuse only a repeated cluster role

AddRoleToDBInstance and RemoveRoleFromDBInstance were missing from
RDS_ACTIONS, so a request with no credential scope reached SQS.

DBClusterRoleAlreadyExists covers the role ARN only, so a cluster now
takes a second role for a feature that already has one. Instances keep
refusing a repeated role or feature, as their fault documents.

CreateDBCluster reads every AssociatedRoles index, gaps included, and
refuses an entry without a RoleArn. It associates the roles in one step
and deletes the new cluster if that is refused.

* refactor(rds): import the types parseAssociatedRoles uses

The regex and sorted-set types were written with their packages inline;
AGENTS.md asks for imports. The role association compat test gains a
DisplayName like the others in its class.

* docs(rds): count the role association actions alongside the catalogue reads

#5196 and this branch each added four RDS actions, so the service matrix
count is 98.
2026-10-13 17:07:33 -04:00
David Phillips a017c94ecc fix(auth): verify query signatures and retain STS caller identity (#5584)
* fix(sts): retain caller identity for query credentials

* fix(sts): retain form token precedence for caller identity

* docs(sts): clarify credential header precedence

* fix(sts): verify presigned caller identity requests

* test(sts): respect the configured signature-checking mode

* fix(auth): verify query signatures across services
2026-10-13 16:41:44 -04:00
vamsiakandVamsi Akavarapu 1acedaf068 feat(apigateway): export deployed REST APIs as OpenAPI (#5131)
* feat(apigateway): export deployed REST APIs as OpenAPI

* fix(apigateway): reject lossy export round trips

* fix(apigateway): preserve native export round trips

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-13 16:40:50 -04:00
Mohith 760c38ef99 fix(ecs): mount and clean up ephemeral task volumes (#5511)
* fix(ecs): mount and clean up ephemeral task volumes

* fix(ecs): retry orphan volume cleanup independently

* fix(ecs): quiet repeated orphan volume cleanup failures
2026-10-13 16:34:26 -04:00
David Phillips 69bbd2242b fix(iam): check DynamoDB transaction item permissions (#5576)
* fix(iam): check DynamoDB transaction item permissions

* test(iam): cover transaction attribute and item permissions

* test(iam): cover transaction policy boundaries

* fix(iam): bind transaction permissions to the accessed table

* fix(dynamodb): preserve omitted transaction return values

* docs(iam): clarify transaction return-value conditions
2026-10-13 15:20:54 -04:00
Nazimuddin Tajuddin Basha e52ce672fe fix(s3): report the default Block Public Access settings for a new bucket (#5434)
GetPublicAccessBlock answered NoSuchPublicAccessBlockConfiguration for a
bucket nobody had configured. AWS has applied all four settings to every
new bucket since April 2023, so a fresh bucket reads back with
BlockPublicAcls, IgnorePublicAcls, BlockPublicPolicy and
RestrictPublicBuckets all true. The 404 only follows a
DeletePublicAccessBlock.

Bucket now remembers whether its configuration was deleted, and Get
returns the default when none is stored and none was deleted. The default
is reported, not stored, so enforcement on ACLs and policies is unchanged.
2026-10-13 15:14:44 -04:00
Nazimuddin Tajuddin Basha daef71ca76 feat(guardduty): add Malware Protection plans and AWS::GuardDuty::MalwareProtectionPlan (#5373)
* feat(guardduty): add Malware Protection plans and AWS::GuardDuty::MalwareProtectionPlan

Adds CreateMalwareProtectionPlan, GetMalwareProtectionPlan,
UpdateMalwareProtectionPlan, DeleteMalwareProtectionPlan and
ListMalwareProtectionPlans, and routes plan ARNs through the shared tag
operations.

Adds a CloudFormation provisioner for AWS::GuardDuty::MalwareProtectionPlan.
Ref and Fn::GetAtt MalwareProtectionPlanId return the plan id, and Arn,
CreatedAt, Status and StatusReasons are set. Role, object prefixes, the
tagging action and tags update in place; a different BucketName is rejected
because the update API cannot change the bucket.

Management plane only: no scan runs, so a plan stays ACTIVE.

Closes #4657

* fix(guardduty): address review findings on Malware Protection plans

- Apply a plan update all-or-nothing: validate every supplied field before
  storing any, so a rejected request no longer changes the role.
- Page ListMalwareProtectionPlans by the last returned id instead of an
  offset, so deleting a plan between pages neither fails nor skips, and use
  the documented default page size of 100.
- Restore a plan on a failed CloudFormation stack update from a snapshot
  taken before the first change, and delete a plan an update created in
  place of one deleted out of band.
- Clear ObjectPrefixes and Actions on a stack update that drops them.
- Apply the creation tag rules to the shared tag routes.
- Require the role to be an IAM role ARN.
- Use explicit types instead of var.

* style(guardduty): import ArrayList instead of fully qualified name

* test(cloudformation): wire GuardDuty into CfnProvisionerFixture

CfnProvisionerFixtureTest requires every provisioner to be reachable through a public Builder setter. Add a guardDuty(...) setter that registers GuardDutyMalwareProtectionPlanCfnProvisioner.

* fix(guardduty): address second review round on Malware Protection plans

- Rolling back a stack update that recreated a plan deleted out of band now
  restores the prior plan's Arn, CreatedAt, Status and StatusReasons, not only
  its id, so Fn::GetAtt no longer names the deleted replacement. The
  out-of-band test now changes the plan's properties: unchanged resources are
  skipped on update, so it never reached the create before.
- Plan tag keys are checked against GuardDuty's documented TagKey pattern
  (^(?!aws:)[a-zA-Z+-=._:/]+$) on creation and on TagResource.
- The tag routes require the supplied ARN to equal the stored plan's ARN, so
  a matching plan id under another account, service or partition is
  ResourceNotFoundException.
- The /malware-protection-plan routes move behind a @PreMatching filter that
  rewrites only guardduty-signed requests to /_guardduty, as DlmRouteFilter
  does, so path-style S3 requests for a bucket of that name reach S3.

* style(guardduty): import Instant and List, drop em-dash, document the plan route

Review on #5373: GuardDutyController used an inline java.time.Instant and its
Javadoc carried an em-dash, which AGENTS.md rules out. The Javadoc's routing
paragraph now names /malware-protection-plan next to /detector and /admin and
says GuardDutyRouteFilter keeps a same-named S3 bucket reachable. The
CloudFormation and plan integration tests import List and nullValue instead of
spelling them out.

* refactor(core): share signed-service route rewriting across DLM, GuardDuty and Resource Explorer 2

DlmRouteFilter, GuardDutyRouteFilter and ResourceExplorer2PathRewriteFilter each
repeated the same path test, credential-scope check and rewrite. They now
delegate to SignedServiceRoute in core.common.

The helper also reads the signing service from the X-Amz-Credential query
parameter when there is no Authorization header, as ServiceEnabledFilter does
(which now uses the same lookup), so a query-signed plan request reaches
GuardDuty instead of S3.

A request sent straight to an internal prefix that is not signed for the
service is refused as S3 refuses that bucket name, rather than reaching the
service's routes. Resource Explorer 2's prefix moves from /re2 to /_re2, since
re2 is a valid bucket name.
2026-10-13 13:17:16 -04:00
Allen Sanborn 63b48342d6 feat(redshift): add snapshot copy and snapshot schedule operations (#5574)
* feat(redshift): add snapshot copy and snapshot schedule operations

Terraform's aws_redshift_snapshot_copy, aws_redshift_snapshot_schedule and
aws_redshift_snapshot_schedule_association failed with InvalidAction because
the Query handler had no arms for these actions.

- EnableSnapshotCopy / DisableSnapshotCopy / ModifySnapshotCopyRetentionPeriod
  store the copy settings on the cluster, and DescribeClusters reports
  ClusterSnapshotCopyStatus while copy is enabled. RetentionPeriod defaults
  to 7 and ManualSnapshotRetentionPeriod to -1. Faults follow the Redshift
  model: SnapshotCopyAlreadyEnabledFault, SnapshotCopyAlreadyDisabledFault,
  SnapshotCopyDisabledFault (modify), InvalidRetentionPeriodFault and
  SnapshotCopyGrantNotFoundFault.
- Create/Describe/Modify/DeleteSnapshotSchedule and
  ModifyClusterSnapshotSchedule. The association lives on the cluster, so
  DescribeSnapshotSchedules derives AssociatedClusters (state ACTIVE) and
  filters by ClusterIdentifier from it, and a deleted cluster cannot leave a
  stale association. Deleting a schedule in use is refused with
  InvalidClusterSnapshotScheduleState.
- Snapshot schedules take part in CreateTags/DeleteTags/DescribeTags as
  resource type snapshotschedule.

No snapshot is copied to another region or taken on a schedule; the docs
say so.

* fix(redshift): reject malformed snapshot schedules and in-use copy grant deletion

* fix(redshift): validate snapshot copy region and snapshot schedule identifier

EnableSnapshotCopy now refuses a DestinationRegion that is not a published
AWS region with UnknownSnapshotCopyRegionFault (404), as the model lists.

CreateSnapshotSchedule now refuses a ScheduleIdentifier containing anything
but letters, digits and hyphens with InvalidParameterValue (400). The API
reference allows alphanumerics; the management guide's example uses a hyphen.
2026-10-13 13:12:34 -04:00
David Phillips 43eacd524c fix(sts): reject session-token requests from temporary callers (#5582)
* fix(sts): reject session-token requests from temporary callers

* fix(sts): retain query callers with blank authorization headers
2026-10-13 13:06:21 -04:00
Vũ Thế Huy b8e628356c feat(cloudformation): provision ElastiCache serverless caches (#5423)
* feat(cloudformation): provision ElastiCache serverless caches

Add the AWS::ElastiCache::ServerlessCache provisioner on top of the serverless cache API, with dotted Endpoint.* and ReaderEndpoint.* Fn::GetAtt attributes, in-place modification, rejected immutable changes and replacement on rename.

* fix(cloudformation): reject a malformed NoPasswordRequired on ElastiCache users

* fix(cloudformation): restore serverless cache settings on a failed update and reset removed ones

* refactor(elasticache): inject ElastiCacheService once into the serverless service

* fix(cloudformation): replace a serverless cache on its create-only properties

Register AWS::ElastiCache::ServerlessCache in create-only-properties.json so a
change to ServerlessCacheName, SubnetIds, KmsKeyId or SnapshotArnsToRestore is
reported as a replacement instead of being applied in place or ignored.

Share one Docker availability probe across the ElastiCache integration tests and
validate the tag count in one place in ElastiCacheServerlessService.

* fix(cloudformation): reject custom-named serverless cache replacement on create-only properties

* fix(cloudformation): simplify serverless create-only update check and share replacement error
2026-10-13 13:00:16 -04:00
David Phillips 367ae0b2db fix(iam): honor managed policy attachment conditions (#5578)
* fix(iam): honor managed policy attachment conditions

* test(iam): keep managed policy group tests isolated
2026-10-13 12:05:34 -04:00
Andre Kurait 04dd78d0f6 fix(ec2): filter network interfaces by primary address association (#5531)
* fix(ec2): filter network interfaces by primary address association

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): synchronize EIP associations on supplied interfaces

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): require disassociation before release in nondefault VPCs

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): keep Elastic IP associations aligned with interface lifecycle

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(ec2): preserve retained interface association metadata

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-13 11:56:42 -04:00
TATSUNO “Taz” Yasuhiro 9c9e5a1464 fix(dynamodb): prefix the Select conflict errors of Query and Scan (#5562) 2026-10-13 11:39:27 -04:00
Aniket Shukla 2a04cd78c7 fix(rds-data): reject concurrent transaction requests (#5575)
Use a nonblocking per-transaction lock so overlapping Data API calls fail instead of waiting. Skip active transactions during expiry cleanup and refresh their idle timeout after statements finish.
2026-10-13 11:22:27 -04:00
David 890b8eca51 feat(rds): engine versions, engine defaults and valid modifications (#5196)
* feat(rds): engine versions, engine defaults and valid modifications

Serve DescribeDBEngineVersions, DescribeEngineDefaultParameters,
DescribeEngineDefaultClusterParameters and
DescribeValidDBInstanceModifications.

A curated engine catalogue lists one representative version per major
version Floci knows through its managed parameter and option groups.
Each version carries the parameter group family the create path computes
for it, its major version and its upgrade targets; each engine's default
is the version Floci creates when a request names none.
DescribeDBEngineVersions serves it with Engine, EngineVersion (exact or
major), DBParameterGroupFamily, DefaultOnly, the documented filters and
paging, and DescribeOrderableDBInstanceOptions now reads the same
catalogue.

The engine default calls check the family against the catalogue and
return an empty list, as Floci's default parameter groups hold no
parameters. DescribeValidDBInstanceModifications reports the instance's
storage type with a range from its current allocation to the engine's
maximum, and nothing for an Aurora instance.

Closes #5186

* feat(rds): one source for engine defaults, and engine version capabilities

Create paths, the cluster parameter group family check and global
clusters each kept their own default engine version, and Aurora MySQL's
disagreed with the catalogue: 8.0.36 against 8.0.mysql_aurora.3.05.2.
All four now read the catalogue's default, so a create that names no
version gets what DescribeDBEngineVersions reports with DefaultOnly.

DescribeDBEngineVersions and DescribeDBClusterEndpoints share one
offset paging helper and one MaxRecords check, which
DescribeEventSubscriptions also uses.

Each engine version now reports ExportableLogTypes,
SupportsLogExportsToCloudwatchLogs, SupportsReadReplica,
SupportedFeatureNames, SupportsParallelQuery, SupportsGlobalDatabases
and SupportsBabelfish, following what Floci supports.

* fix(rds): route the catalogue reads to RDS without a credential scope

DescribeDBEngineVersions, DescribeEngineDefaultParameters,
DescribeEngineDefaultClusterParameters and
DescribeValidDBInstanceModifications were missing from RDS_ACTIONS, so a
request with no credential scope reached SQS.
2026-10-13 10:25:21 -04:00
XuJian 7b8377fa3c fix(apigateway): match AWS integration responses by status (#5443)
* fix(apigateway): match AWS integration responses by status

* fix(apigateway): ignore synthetic status during response selection
2026-10-13 10:24:21 -04:00
TiM e023ae9ff4 fix(s3): refuse DeleteBucket while versions or delete markers remain (#5548)
* fix(s3): keep versioned buckets until history is purged

Reject DeleteBucket while any account-scoped object metadata remains under the bucket prefix. Cover hidden versions and markers through service, HTTP, and persistent storage tests, and purge them in CLI and Java compatibility cleanup.

* test(s3): purge versioned enforcement fixtures

Delete every listed object version and marker before removing fixture buckets, repeating the first page so deletions do not invalidate continuation markers. Cover null versions, mixed history, and a page boundary inside one key with a direct bucket absence assertion; register the formerly exempt versioned fixture for cleanup.

* test(s3): assert fixture purge removes a null version

Seed an untouched object before enabling versioning and assert that ListObjectVersions reports its literal null version ID. This makes the direct purge guardrail exercise the null-version branch as intended.

* test(s3): encode versioned fixture keys during purge

* test(s3): share SDK bucket cleanup helper
2026-10-13 10:21:42 -04:00
Bharat Kaurav ac5f0bd95f fix(ec2): enforce VPC IPv4 CIDR block association restrictions (#5510)
* test(ec2): keep subnet range test secondary block in 10.0.0.0/8

* test(ec2): add same-range secondary blocks in subnet containment tests

* fix(ec2): enforce VPC IPv4 CIDR block association restrictions

* refactor(ec2): add Cidr4.rfc1918Range for the containing private range

* fix(ec2): classify VPC CIDR ranges by containment, not overlap

* test(ec2): drop the /0 primary case now that CreateVpc refuses it
2026-10-13 10:10:43 -04:00
Matheus Oliveira 4da5143456 fix(route53resolver): require at least two IP addresses for CreateResolverEndpoint (#5539)
* fix(route53resolver): require at least two IP addresses for CreateResolverEndpoint

A resolver endpoint's IpAddresses member is modeled min 2 / max 20, but the
emulator only rejected an empty list. A request carrying a single address (or
more than twenty) returned HTTP 200 and created the endpoint, which real AWS
refuses. Validate the count on CreateResolverEndpoint and raise the service's
existing InvalidParameterException, creating no endpoint on rejection.

Fixes #4774

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

* refactor(route53resolver): fold the two endpoint body builders into one

The request member is modeled min 2 / max 20, so phrase the code and test
comments from the shape rather than the older min 1 note. Replace
createEndpointBody and endpointBody with a single builder taking the
member name, the creator request id and the address count.

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-13 09:41:57 -04:00
David Phillips 41517f3c2f fix(autoscaling): pause suspended capacity adjustments (#5545)
* fix(autoscaling): pause suspended capacity adjustments

* test(autoscaling): cover suspended capacity through AWS clients

* fix(autoscaling): coordinate suspension with capacity changes

* fix(autoscaling): keep capacity locks within each account

* test(autoscaling): check suspension without scheduler waits
2026-10-13 09:37:17 -04:00
David Phillips 2927a4520e fix(rds): preserve credentials when managed-secret opt-out is refused (#5553)
* fix(rds): retain managed credentials while secret replicas exist

* fix(secretsmanager): keep released managed secrets deleted

* fix(secretsmanager): keep removed replicas from returning

* fix(rds): reject opt-out without Secrets Manager support

* fix(secretsmanager): keep unrelated secrets available during release
2026-10-13 09:31:41 -04:00
Abhigya ee229af975 fix(cloudfront): release origin connections when viewers disconnect (#5564) 2026-10-13 09:11:50 -04:00
Bharat Kaurav 66b2ec05e9 fix(ec2): reject reserved IPv4 ranges for VPC CIDR blocks (#5559)
* fix(ec2): reject reserved IPv4 ranges for VPC CIDR blocks

* test(ec2): cover reserved VPC ranges through the Query API
2026-10-13 08:44:35 -04:00
Aniket Shukla e919560e3c fix(dynamodb): keep expired items visible until TTL deletion (#5555)
* fix(dynamodb): keep expired items visible until TTL deletion

* fix(dynamodb): count items after legacy query filters
2026-10-13 08:07:30 -04:00
Jay c65b6e96fc fix(rekognition): refuse the images Rekognition refuses (#5540)
Rekognition never looked at the image, so a WebP, a cut-off file, an
oversized Bytes payload or an S3Object that was never uploaded all got
the stub's success response. RekognitionImageValidator now checks every
image as Rekognition does, before the stub or mock response: base64
(SerializationException), Bytes length (ValidationException, every
violation in one error), the S3 object's existence and region
(InvalidS3ObjectException), JPEG/PNG structure
(InvalidImageFormatException) and the 10,000 pixel side limit
(ImageTooLargeException or InvalidImageFormatException, per operation).
Each rule was measured against Rekognition in us-east-2.
2026-10-13 07:50:42 -04:00
Hector Ventura 1b7c79fd9e fix(signin): accept the cross-device redirect on each partition's sign-in host (#5557)
The cross-device redirect_uri was matched against the commercial
<region>.signin.aws.amazon.com only, so a login that resolved another
partition's Sign-In host was refused with invalid_request.

regen_partitions.py now reads botocore's signin endpoint ruleset and
vendors one signinHost per partition into aws/partitions.json. The
redirect is accepted on the Sign-In host of a region in the deployment's
partition, and another partition's host is refused. The device
authorization client ids keep their literals: the Sign-In model spells
them the same way in every partition.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-13 07:47:19 -04:00
Allen Sanborn 4afa7d8e9f feat(opensearch): serve the legacy Elasticsearch Service 2015-01-01 API (#5357)
* feat(opensearch): serve the legacy Elasticsearch Service 2015-01-01 API

`aws es` and Terraform's aws_elasticsearch_domain call the 2015-01-01
API, which Floci did not route, so every call got
UnknownOperationException.

ElasticsearchController serves the domain lifecycle, ListDomainNames and
the tag operations on that path by delegating to OpenSearchController,
renaming only the members the legacy model spells differently:
ElasticsearchVersion (bare "7.10", stored as "Elasticsearch_7.10") and
ElasticsearchClusterConfig. A legacy create without a version gets
Elasticsearch 7.10 rather than the OpenSearch default.

* fix(opensearch): reject blank legacy ElasticsearchVersion, report legacy instance types

ElasticsearchVersionString's pattern matches no blank or non-string value, so
CreateElasticsearchDomain now returns ValidationException instead of storing
an empty engine version. ESPartitionInstanceType lists only *.elasticsearch
types, so the legacy responses rewrite the store's *.search spelling (including
the m5.large.search default). The legacy test methods get distinct @Order
values.

* fix(opensearch): store legacy .elasticsearch instance types as .search, accept OS_X.Y

The legacy API now respells ElasticsearchClusterConfig.InstanceType from
*.elasticsearch to *.search on create and update, so the 2021 API reports
t3.small.search and the legacy API maps it back. ElasticsearchVersion's
OS_X.Y form is stored as OpenSearch_X.Y instead of Elasticsearch_OS_X.Y.
Replaces the jakarta.ws.rs wildcard import with explicit imports.
2026-10-12 23:50:09 -04:00
Hector Ventura ec5692dfa2 fix(ec2): remove the volume helper container on shutdown (#5551)
* fix(ec2): remove the volume helper container on shutdown

The privileged helper that manages loop devices for EBS volumes was
started on the first volume operation and never stopped or removed, so
it kept running after Floci exited and stayed in the container list.

Ec2VolumeBlockDeviceManager now implements ContainerTeardown. On
shutdown and on a state reset it looks the helper up by name, detaches
the loop devices behind the backing files and removes the container. It
never creates a helper only to remove it, and it also collects one left
behind by an earlier process. Backing files stay in storage and the next
volume operation recreates the helper.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(ec2): leave no volume helper after a reset and report failed loop detaches

A state reset removed the helper in the container teardown and then
started it again to delete the backing files, so the reset ended with a
running helper. clear() now removes the helper once the files are gone.

The script that releases loop devices before the helper is removed
discarded every losetup failure, so the warning that follows could only
fire when the exec itself failed. It now records each loop device that
would not detach and exits non-zero, while still trying every device and
still removing the helper.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-12 23:36:15 -04:00