Commit Graph
2211 Commits
Author SHA1 Message Date
Priamo Germosen 94fc4c45bb feat(codeartifact): release a deleted repository's Maven storage (#4210)
DeleteRepository never cleaned up the Reposilite-side storage of a deleted
repository; it was left behind, wasting space over a long-running process.
Reposilite has no bulk-delete endpoint, but DELETE on a path recursively
removes everything under it in one call, so this deletes each of the
repository's top-level entries before removing it from the shared settings
list, verified against a live instance. Order matters: the repository must
stay registered while its files are deleted, since Reposilite 404s every
path, including DELETE, for an id absent from its settings.

Release is best-effort: the CodeArtifact-side metadata delete already
committed by the time it runs, matching real CodeArtifact's own
DeleteRepository (synchronous, always succeeds once the repository exists).
A sidecar that is unreachable must not turn an already-successful delete
into a 500, and must not leave the repository stuck, since a retry would
just 404 against the already-deleted record.

Introduces RepositorySidecarManager, a small interface every per-format
sidecar can implement, and CodeArtifactSidecarRegistry, which discovers
implementations via CDI. CodeArtifactService.deleteRepository releases
storage generically over whatever formats a repository has sidecar ids
for, so a future format's sidecar needs no change here. Reposilite is the
first and only implementation for now; CodeArtifactRepository's
mavenRepositoryId field becomes a sidecarContainerIds map for the same
reason.
2026-09-23 22:48:03 -05:00
XuJian b986b95074 fix(s3): reject reserved storage bucket names (#4289) 2026-09-23 23:41:20 -04:00
Vũ Thế Huy a450cdc9b0 feat(redshift): support Redshift Spectrum phase one (#4184)
* feat: add Redshift Spectrum metadata catalog

* feat: parse Redshift Spectrum DDL

* feat: read Redshift Spectrum CSV data from S3

* feat: classify and rewrite Redshift Spectrum queries

* feat: materialize Spectrum rows into PostgreSQL

* feat: intercept Redshift Spectrum queries

* test: cover Redshift Spectrum wire integration

* docs: document Redshift Spectrum phase one

* fix: handle Spectrum extended queries

* fix: preserve Spectrum query protocol state

* fix: resolve Spectrum cursor paging and extended query race condition

- Await prior backend queries before streaming local Spectrum Extended Query frames
- Drop synthetic Spectrum Parse/Bind/Describe/Close frames from coordinator pending queue
- Support server-side cursor pagination with PortalSuspended across multiple Execute cycles
- Add cascade cleanup for unexhausted portal cursors when prepared statement is closed

* fix(redshift): register SpectrumMaterializer for GraalVM runtime initialization

* fix(redshift): forward non-Spectrum queries and register storage models for reflection

* docs(redshift): clarify Spectrum temp table lifecycle across protocols

* docs(redshift): note that Simple Query Spectrum creates a temp table per query

---------

Signed-off-by: Vũ Thế Huy <31652864+vuthehuyht@users.noreply.github.com>
2026-09-23 23:34:03 -04:00
Vũ Thế Huy 5f1f80b496 refactor(redshift): align Redshift code with AGENTS.md style rules (#3992)
* refactor(redshift): align main sources with AGENTS.md style rules

Import Matcher instead of qualifying it inline, replace a var with its
explicit type, and order the RedshiftService imports (java.* last).
Remove em-dashes from comments and a log message.

Two swallowed IOExceptions now log with context (snapshot dump deletion
and exec output capture), and the remaining intentionally ignored one
says why it is safe.

* refactor(redshift): replace var and inline qualified names in tests

Use explicit types instead of var and import the classes that were
written fully qualified inline, as AGENTS.md requires.

* refactor(redshift): drop the test prefix from test method names

AGENTS.md prefers camelCase sentences over testX names, which are common
in older tests but not the pattern to copy. Rename the 99 remaining
testX methods in the Redshift tests. No assertions changed.

* refactor(redshift): remove remaining em-dashes from test comments

* refactor(redshift): log warning when temp dump cleanup fails on aborted reboot
2026-09-23 23:12:21 -04:00
Matheus Oliveira fc81cdedd9 fix(lambda): bound a destination cycle that re-enters through SNS or EventBridge (#4279)
The 16-hop bound only advanced when a destination named a Lambda function, so a
cycle closed through an SNS topic or an EventBridge bus restarted at zero on every
lap and ran forever. The chain position now rides the calling thread, which both
services already deliver their Lambda targets on, and the asynchronous invoke drops
the event once the chain is exhausted instead of running it.

Closes #4267

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-23 23:11:06 -04:00
Matheus Oliveira 4de043cf88 fix(ecr): return a proxyEndpoint for the request's region (#4277)
GetAuthorizationToken built the docker login endpoint from the configured default region while the matching repositoryUri used the region of the call, so any non-default region advertised two different registry hosts. Both now resolve the region the same way.

Closes #4264

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-09-23 23:00:02 -04:00
Simone Primarosa 766166fc35 feat(eks): set the cluster node providerID (#4255) 2026-09-23 22:45:07 -04:00
Hector Ventura 69217dff2a fix(cloudformation): key the Lambda hot-reload identity on the Docker host path (#4275)
LambdaCfnProvisioner.canonicalHotReloadPath spelled the identity with
Path.normalize().toString() while LambdaService stores the path through
toDockerHostPath (#4080), the POSIX form Docker receives whatever separator the
JVM uses. lambdaCodeChanged compares the two, so on a Windows-hosted JVM every
stack update looked like a code change and re-mounted the same directory. The
provisioner now reuses the Lambda helper, made public for it, so the identity
and the stored path cannot drift.

Follow-up to #4093.
2026-09-23 22:42:33 -04:00
Hector Ventura 69ceb976c7 refactor(cloudformation): replace the retired monolith with CfnResourceDispatcher (#4269)
* refactor(cloudformation): replace the retired monolith with CfnResourceDispatcher

CloudFormationResourceProvisioner was the monolith that held every AWS::
provisioning arm. With the per-service migration complete it kept no arm:
LEGACY_SWITCH_TYPES and DELETE_NEEDS_STACK_RESOURCE were empty sets, five
private helpers duplicated ProvisionContext, six imports were unused, and its
UPDATE_ROLLBACK_* constants only re-exported CfnRollback. What it still did is
small: route provision and delete to the registry, stub a type nothing serves
(or refuse it in strict mode), answer the engine's update-lifecycle questions
through the owning provisioner, and give Cloud Control its stack-less entry
points.

That is now CfnResourceDispatcher in provisioners/, behaviour unchanged: the
same stub arm, warn lines, status reasons and strict-mode failure, with the
same logger category the unsupported-type test binds to. The dead overloads
go with the class (the 8-arg provision, the unused accountId on delete, the
short deleteStandalone forms). CloudFormationTemplateEngine gains a public
standalone(...) factory so the dispatcher can build Cloud Control's throwaway
engine from outside the package while the constructors stay package-private
for the tests that mock it. CloudFormationService reads the rollback markers
from CfnRollback directly.

The empty guards leave with the class: CfnDeletePrecedenceTest read only the
empty set, and CfnResourceInventoryTest no longer folds a legacy owner into
the inventory (the checked-in file had no such row). Javadocs that described
the switch as still present now describe the registry.

CfnResourceDispatcherTest pins the standalone engine's dynamic-reference
resolver, the prior identity reaching the ProvisionContext, and the
whole-resource delete form; every other test only changed the type it names.

* chore(cloudformation): retire the legacy-switch guards from tooling and instructions

The switch is gone, so nothing can carry a LEGACY_SWITCH owner: the schema
coverage test drops its skip, the docs generator's double-ownership check
generalises to any type with two provisioners, and its fixtures name real
owners. AGENTS.md and CONTRIBUTING.md tell contributors where types live
instead of warning them off a class that no longer exists.
2026-09-23 22:31:27 -04:00
Allen Sanborn 239f560d97 fix(cloudformation): read a TemplateURL on the S3 service host as path-style (#4248)
* fix(cloudformation): read a TemplateURL on the S3 service host as path-style

A TemplateURL whose host is the S3 service endpoint under a local hostname,
http://s3.localhost.floci.io:4566/<bucket>/<key>, was read as virtual-hosted
because the host merely ended with the configured suffix. The bucket came out
as the literal label "s3" and the real bucket and key in the path were dropped,
so CreateStack failed with "The specified bucket does not exist" against a
bucket and key that both existed. That is what cdk deploy emits whenever
AWS_ENDPOINT_URL_S3 names the S3 service endpoint.

This is the same misreading the ".amazonaws.com" condition was fixed for
earlier; only the local-suffix branch still had it. A host whose first label is
"s3" is now the service endpoint, covering s3.<suffix> and the regional
s3.<region>.<suffix>, and its URL is parsed path-style. <bucket>.<suffix> and
<bucket>.s3.<suffix> stay virtual-hosted.

The bucket/key split moves into a package-private parseTemplateUrl so it can be
tested without an HTTP round trip.

* fix(cloudformation): keep a virtual-hosted URL for a bucket named s3

The service-endpoint guard tested only for a leading "s3." label, which also
matches a virtual-hosted URL whose BUCKET is named s3:
s3.s3.us-east-1.amazonaws.com/key and s3.s3.<suffix>/key. Both were parsed
path-style, so the bucket came out as the first path segment and the key was
empty, and CloudFormation could not load a template that exists in the valid
s3 bucket. A bucket may legally be named s3, and the canonical S3 request
parser reads these as virtual-hosted.

What separates the two is not the first label but what follows it: the service
endpoint is "s3." plus an endpoint suffix, optionally with a region label in
between. The guard now strips an optional region label and requires the
remainder to be amazonaws.com, localhost, or the configured hostname suffix,
so s3.<suffix> and s3.<region>.<suffix> stay path-style while s3.s3.<suffix>
returns to virtual-hosted.

Four cases added, covering the bucket named s3 on the configured suffix, on
AWS and on bare localhost, plus the regional service host. Reverting the guard
alone fails them.

* style(cloudformation): follow the guide in the TemplateURL parsing and its test

Three review points, all AGENTS.md requirements.

The service-endpoint predicate carried two consecutive Javadocs: only the second
attached to the method, and the orphan contradicted the code it sat above. It
still said the parser "costs the ability to address a bucket actually named s3
virtual-hosted style", which the preceding commit restored. Merged into one that
describes the predicate as it now behaves, keeping the pointer to
S3VirtualHostFilter.extractBucket.

The relocated S3 lookup declared its object with var; AGENTS.md asks for the
explicit type so a wire-contract type stays visible in review. Named S3Object,
which needed its import.

The test asserted with JUnit assertEquals throughout; AGENTS.md asks for Hamcrest
outside the Lambda launcher tests. Converted all 28 to assertThat/equalTo, which
also puts the actual value first, as the rest of the package reads.

No behaviour change.

* fix(cloudformation): recognise the dualstack, FIPS and legacy S3 service hosts

The service-endpoint guard accepted only s3.<suffix> and s3.<region>.<suffix>.
Every other endpoint form S3VirtualHostFilter serves fell through to the
virtual-hosted branch, which takes the host's first label as the bucket and
leaves the real bucket in the key, so a TemplateURL addressed to one could not
be fetched:

  s3.dualstack.us-east-1.<suffix>        read the bucket as "s3"
  s3-fips.dualstack.us-west-2.<suffix>   read the bucket as "s3-fips"
  s3-us-east-1.<suffix>     (legacy)     read the bucket as "s3-us-east-1"
  s3-website-us-east-1.<suffix>          read the bucket as "s3-website-us-east-1"

None of this is new: before the guard existed these hosts ended up virtual-hosted
by the same suffix test, with the same wrong bucket. The canonical list lives in
S3VirtualHostFilter, so the guard now follows it: a first label of s3, s3-fips,
s3-accelerate, s3-website, s3-website-<region> or the legacy s3-<region>, then an
optional dualstack label, then an optional region, then the endpoint suffix.

A bucket whose name merely begins with s3- is untouched, since the remainder of
the label has to parse as a region: s3-logs.<suffix> stays virtual-hosted. Five
cases added, including that negative. Narrowing the label test back to a bare s3
fails four of them.

* fix(cloudformation): decide an S3 region label from the known-region list

The service-host guard tested a region label by shape, which a bucket name can
also satisfy. s3-eu-team-2.<suffix> is a legal virtual-hosted URL for a bucket
called s3-eu-team-2, but "eu-team-2" matches the shape of a region, so the host
was read as a legacy service endpoint and the object key was taken as the
bucket. The same held for a region-shaped label after the first, as in
s3.eu-team-2.<suffix>.

S3VirtualHostFilter already decides this from AwsRegions.isRegionId, backed by
the finite AwsRegions.KNOWN_IDS, and says in its own comment that the finite
list is what separates a real regional endpoint from a bucket whose name merely
looks like one. Two parsers disagreeing about the same host is the defect;
using the catalogue rather than a second hand-rolled rule is the fix. The shape
regex goes with it.

Two cases added, one per position. Restoring the shape test fails both.

* style(cloudformation): order the AwsRegions import after AwsException

The import added for the known-region check was placed next to AwsArnUtils
without looking at what followed it, leaving AwsRegions ahead of AwsException.
AGENTS.md asks for non-java imports in alphabetical order.
2026-09-23 18:41:09 -05:00
Priamo Germosen 1fa5534e6c feat(iam): add GetAccountAuthorizationDetails (#4208)
Returns every user, group and role in the account, plus every local
(customer-managed) policy and every AWS-managed policy actually attached to
or used as a permissions boundary by something in the account: the entity
lists themselves, their inline and attached policies, group membership,
instance profiles, permissions boundaries, and each managed policy's
version list.

AttachmentCount and PermissionsBoundaryUsageCount are computed by scanning
the account's own users, groups and roles rather than read off
IamPolicy.getAttachmentCount(): for an AWS-managed policy that field is a
single object shared process-wide across every account (attachUserPolicy
et al. mutate the same catalog entry every account resolves), so trusting
it would leak one account's attachments into another's response. Filed
separately as #4205, since fixing it properly means changing the
attach/detach methods themselves, well beyond this action.

Also fixes two related, smaller gaps found while building this:
- CreateInstanceProfile silently dropped a Tags parameter at creation,
  unlike every other Create* action.
- GetInstanceProfile, CreateInstanceProfile and ListInstanceProfilesForRole
  never serialized an instance profile's own tags into the response.
  ListInstanceProfiles keeps omitting them: its own operation
  documentation, like ListRoles's, says it returns a subset of attributes
  and does not return tags, even though the InstanceProfile shape itself
  carries no such exclusion note.

Policy documents are returned as plain JSON, not URL-encoded as AWS
documents them for this action: matches every other IAM action that
returns a policy document, none of which URL-encode either. Filter,
MaxItems and Marker are not honored; the response always includes
everything.
2026-09-23 18:16:27 -05:00
Priamo Germosen d30a744b66 fix(iam): reject an access key that exists nowhere under enforcement (#4182)
With enforcement enabled, a signed request whose access key resolved to no caller context was allowed through, so any access key id authorized any call. Reject it with InvalidAccessKeyId for S3 and UnrecognizedClientException elsewhere, matching what the S3 signature filter and the API Gateway execute path already return.

resolveCallerContext returns null for a key that does not exist and for a real credential it cannot map to policies, such as a session carrying no role ARN. Only the first is unauthenticated, so isKnownAccessKey searches sessions and long-term keys across every account and only a key found nowhere is rejected. The test credential, the bare account-id root principal, unresolvable actions and unsigned requests are unchanged.
2026-09-23 18:16:13 -05:00
Priamo Germosen 3f5741a965 feat(ecs): issue task-role credentials and serve them over the AWS wire contract (#4160)
Adds EcsTaskRoleCredentials, which mints, rotates, and revokes an ECS task's
role session, and EcsTaskRoleCredentialsServer, a small Vert.x server that
serves it at GET /v2/credentials/<uuid> in the shape AWS_CONTAINER_CREDENTIALS_
RELATIVE_URI expects (RoleArn/AccessKeyId/SecretAccessKey/Token/Expiration).
The default 6-hour TTL and response shape are verified against
docs.aws.amazon.com and botocore's ContainerMetadataFetcher.

Builds on the session plumbing from #4143. The server binds a normal Floci
port, not 169.254.170.2: that address is hardcoded in every AWS SDK (unlike
EC2's configurable AWS_EC2_METADATA_SERVICE_ENDPOINT), and nothing in Floci's
own process can bind it without also owning it on a task's Docker network.
A follow-up piece adds the small proxy container that holds that address and
forwards here, and another wires this into EcsContainerManager so a task
actually gets one. Both are still off (feature flag defaults to false) since
neither exists yet.
2026-09-23 18:10:50 -05:00
Priamo Germosen 2e21c013c5 fix(s3): keep a bucket's data inside its own account directory (#4244)
A bucket name went into the storage path unvalidated, so a bucket named .. resolved to the account storage root itself and the containment check then passed for any account's objects. Reject a name that is not a single directory at CreateBucket, and resolve every bucket path through a helper that asserts the directory sits directly under its account, which also covers a bucket persisted before the name was refused.
2026-09-23 18:07:48 -05:00
stodan 34f4f72e82 fix(cloudformation): pass Lambda hot-reload code through to the Lambda service (#4093)
* fix(cloudformation): pass Lambda hot-reload code through to the Lambda service

AWS::Lambda::Function code of {S3Bucket: hot-reload, S3Key: /host/path} is
Lambda's bind-mount hot-reload convention: the bucket is a marker and the key
is a directory on the Docker host. The provisioner probed S3 for the pair
before calling CreateFunction, so no such object existed and the stack failed
with a ValidationError (or, with allow-stub-lambda-code on, quietly deployed
the stub handler).

Skip the S3 probe for the hot-reload bucket and hand the Code map to
LambdaService unchanged, which keeps enforcing hot-reload enablement, the
absolute-path rule and the allow-list, and reports its own error as the
resource status reason. Record a hot-reload code identity so a redeploy with
the same path is a no-op, and compare adopted functions by host path since a
hot-reload function carries no S3 bucket or key.

* fix(cloudformation): canonicalise the hot-reload code identity

LambdaService stores a hot-reload host path normalised (#4053), while the
provisioner recorded the raw template key as the code identity and compared
adopted functions against it. A template that spelled the same directory with
a trailing slash or a ".." segment, or a function adopted from a direct
CreateFunction, therefore looked like a code change and triggered an
UpdateFunctionCode that mounted the same directory again.

Build the identity from, and compare against, the normalised path. The raw key
still goes to Lambda so its validation and error messages are unchanged. Also
cover the documented SAM CodeUri form, s3://hot-reload//abs/path, through the
transform.
2026-09-23 18:03:35 -05:00
Allen Sanborn 67f06c3ac9 feat(cloudformation): list a deleted stack and report its DeletionTime (#4246)
* feat(cloudformation): list a deleted stack and report its DeletionTime

A deleted stack is already retained so DescribeStacks and DescribeStackEvents
keep answering for it by stack id after the delete, but the record they answer
with was incomplete in two ways.

It carried no deletion time, so DescribeStacks reported DELETE_COMPLETE with
nothing saying when. Stack now has a deletionTime, set as the stack reaches
DELETE_COMPLETE from the same service clock the retention window uses, and the
query handler emits DeletionTime wherever AWS does.

ListStacks omitted deleted stacks entirely. AWS keeps one there as
DELETE_COMPLETE long after DescribeStacks has stopped answering for it by name,
which is how a client reconciles what it deployed against what is left, and a
StackStatusFilter of DELETE_COMPLETE selects exactly those. Retained stacks are
now merged into the listing, still scoped to the caller's account and region and
still dropped once the window passes. A name reused after a delete lists twice,
once per stack id, as it does on AWS. Resource Explorer reads the live map
directly and is unaffected.

Restores deleted-stack-retention-seconds to application.yml, which #849 dropped
in a merge: the knob kept working on its @WithDefault, but the repository YAML
is the source of truth for what a deployment actually runs. Pinned in the test
YAML too, since the retention tests advance the clock past that exact window.

Nothing here changes how a delete runs, and it does not make a multi-stack cdk
destroy work: that client polls a destroy entirely by stack name, so a record
retained by stack id, these two members included, never enters its path.
DeleteStack does already return before the delete finishes, and the stack does
pass through DELETE_IN_PROGRESS, but the whole delete completes in roughly 15ms,
well inside one poll interval, so a client that starts watching when it issues
the delete finds the stack gone by name on its first poll. Giving a deleting
stack an observable window is separate work.

* fix(cloudformation): set a stack's deletion time before publishing the status

Stack.status is volatile and is documented as the publishing write of a deploy:
a reader that observes a terminal status is guaranteed to observe every write
that preceded it. deletionTime was assigned after it, outside that guarantee, so
a DescribeStacks running concurrently with the last step of a delete could
observe DELETE_COMPLETE while deletionTime was still null and answer with no
DeletionTime element at all.

Assigning it first puts it inside the same happens-before edge as the rest of
the delete. The window is nanoseconds wide and no test can land in it reliably,
so this carries none; the ordering rule is the thing being fixed, and the
comment records it so the next edit here keeps it.

* fix(cloudformation): retain a deleted stack before it leaves the live map

The handover at the end of a delete removed the stack from the live map, wrote
its removal through to storage, and only then retained it as deleted. A
ListStacks landing between the removal and the retention found it in neither
map and dropped it from the listing, though the stack both existed a moment ago
and is retained a moment later.

Retaining before removing closes that window. The stack is then briefly in both
maps, which is harmless: they hold the same Stack, and listStacks now reduces by
stack id, so it is listed exactly once throughout. Nothing else reads both maps,
since resolveStackForDescribe consults the retained one only after the live
lookup has missed.

Greptile reported the listing could also show the stack twice. It could not:
the old order removed before it inserted, so the two maps never overlapped. The
duplicate only becomes possible with this ordering, which is why the reduction
comes with it.

The test drives 60 deletes with four concurrent listings each. It fails on every
run against the old ordering and passes on every run against this one. It pins
the retention window open through a profile: the window is measured on the test
MutableClock, which advances on every read, and the pollers would otherwise
expire the retained record themselves.

* style(cloudformation): order the Stream import with the rest of java.util

java.util.stream.Stream landed between java.util.regex and java.util.concurrent
when it was added. It now follows both, the order AGENTS.md asks for. Only the
line this branch introduced moves; the block's older irregularities are left
where they are.

* fix(cloudformation): read the live stacks before creating the deleted-stack view

Retaining a stack before removing it keeps it in at least one map at every
instant, but listStacks built both of its views up front, the retained one
first and the live one after. A ConcurrentHashMap view reflects the table at
some point at or since its own creation and is not guaranteed to reflect a
modification made after it, so the retained view, created before the retain,
need never show the stack, while the live view, created after the remove, can
already miss it. A listing landing there loses the stack in both, which is the
window the retain-before-remove ordering was meant to close. Traversing the
retained view second does not help: creation bounds the guarantee, not
traversal.

The maps are now read one after the other instead of through a concatenated
pipeline, the live one first and in full, so the retained view is created after
any remove the live pass could have missed, and therefore after the retain that
preceded it. The reduction by stack id stays: the overlap it covers is real.

No test. The fault is the absence of a JDK guarantee rather than a behaviour:
these views do in practice reflect a later put, so the old ordering passes every
time and nothing can force it not to. The existing listing-race test still
covers the retain-before-remove ordering this rests on.

The java.util.stream.Stream import goes with Stream.concat, which the change
removes.

* test(cloudformation): stop the listing-race pollers on every exit path

The pollers were stopped after awaitDeleted returned, so a throw from the delete
or the wait left four non-daemon threads spinning on listStacks for the rest of
the run. That holds the test JVM open and buries the failure that caused it
under a hang, which is a far worse thing to debug than the failure itself.

Shutdown moves into a finally, so a failing delete stops them on its way out.
Each join is bounded and a thread still alive afterwards is interrupted and
recorded, with the poller loop now checking its own interrupt flag so that
interrupt is not merely decorative. The check that they all stopped is asserted
after the try and never inside the finally, where it would replace whatever the
delete threw with its own failure. The threads are daemons as a backstop, so a
future edit that throws somewhere nothing throws today still cannot wedge the
suite.

Also replaces an assertTrue(false, ...) in the wait helper with fail(...), which
says the same thing and reads as what it is. Noted here rather than slipped in.
2026-09-23 18:01:55 -05:00
Allen Sanborn 97a2a08e1f feat(lambda): deliver asynchronous invocation results to configured destinations (#4247)
* feat(lambda): deliver asynchronous invocation results to configured destinations

An event invoke configuration was stored and returned faithfully but never
applied, so a function with an OnSuccess or OnFailure destination computed its
result and the emulator dropped it. A CDK application that carries a function's
output on to a bus, as the Loan Broker sample does with an EventBridge
destination, saw nothing arrive.

An Event invocation now hands its result to AsyncInvokeDestinationRouter, which
delivers the invocation record AWS sends to all four destination kinds, routed
by the service in the destination ARN: an EventBridge event bus, an SQS queue,
an SNS topic, and another Lambda function. On a bus the record is the event
detail, under the source "lambda" and the detail type "Lambda Function
Invocation Result - Success" or "... - Failure", so a rule matching
detail.responsePayload.<field> sees the function's own response where AWS puts
it. A function error routes to OnFailure with a condition of RetriesExhausted, a
responseContext.functionError, and the error as the responsePayload.

The router is its own bean and reaches its collaborators through Instance
lookups because the dependency graph runs the other way: SnsService invokes its
Lambda subscribers and EventBridgeInvoker its Lambda targets, so injecting
those services into LambdaExecutorService eagerly would close a CDI cycle. The
lookup happens per delivery, which is also when a destination is first known to
exist, so a function without one costs a single map read. Delivery runs on the
invocation's pool thread under the destination account's request scope, and a
destination that rejects the record is logged: the caller was answered with 202
long before, and has nowhere to receive a late failure.

Retries and event age are still not applied, so a failure reaches its
destination once and approximateInvokeCount is always 1. The docs say so.

* fix(lambda): read an event invoke configuration as the function's own account

The configuration store is account-aware: PutFunctionEventInvokeConfig writes
into the caller's partition, keyed by that account. findEventInvokeConfig is
called from the asynchronous invoke pool, which carries no request context, so
the read fell back to the default account. A function in any other account
therefore looked as though it had no configuration and its destination was
silently skipped, with nothing logged, because having no destination is the
ordinary case this path is built to return quickly.

The read now runs under the function's owning account, taken from the function
itself and falling back to the account in its ARN, the same way the other
background workers re-establish an account before touching an account-aware
store.

* fix(lambda): bound a Lambda destination chain that leads back into itself

A function whose OnSuccess or OnFailure destination is a Lambda function, and
whose chain of those leads back to a function already in it, invoked forever.
Real AWS is not unbounded here either: recursive loop detection halts such a
chain after about sixteen invocations, so looping without end was a deviation
and not merely a hazard, and on a laptop it is a worse one than on AWS.

The number of destination hops that reached an invocation is now carried with
it, from the router through invokeArnFromDestination and into the executor, and
a Lambda destination at the sixteenth hop is dropped with a warning naming the
function the chain started from. A ThreadLocal, which is how the EventBridge
invoker bounds bus-to-bus forwarding, cannot serve here: every hop is an Event
invocation and so runs on a different pool thread.

The bound applies to Lambda destinations alone, the only kind that re-enters
this path. A queue, topic or bus at the last hop is still delivered, since it
ends the chain rather than extending it.

* docs(lambda): state the destination limits in the service docs

The alias constraint was recorded only in findEventInvokeConfig's javadoc, which
serves a maintainer reading the code and not a user reading the service docs,
and AGENTS.md asks for an intentional deviation to be documented. A destination
configured on an alias is not found, because the lookup matches the version the
invocation ran; $LATEST and an explicit version both work, and the CDK onSuccess
and onFailure properties store theirs under $LATEST.

Records the Lambda destination chain bound alongside it, so both limits of this
feature are in one place.

* refactor(lambda): make the destination routing switch an expression

AGENTS.md asks for switch expressions over switch statements without
qualification. The routing switch was a statement whose arms fell through to a
shared log line, with two of them returning early to skip it. Each arm now
yields whether the record was delivered and the log line is guarded on that,
which also removes the two returns hidden inside the arms.

The Lambda arm moves into its own method so its chain-bound check reads as a
condition on delivery rather than a second exit from the switch. No behaviour
changes: a record dropped for an unsupported ARN or for reaching the chain bound
is still logged at warn and still leaves the debug line unwritten.

* fix(lambda): carry the function and destination as event resources, and say S3 is not delivered

Two parity gaps against the capturing-records page, both found in review.

putOnEventBus set no Resources. AWS fills the event's resource field with the
invoked function and the destination, and EventBridgeService already emits the
member and matches rules against it (buildEventEnvelope reads entry Resources at
:1041 and writes `resources` at :1064; matchesPattern reads it at :894). Without
it a rule whose pattern matches on `resources` never fires -- the field arrives
empty rather than absent, so the pattern does not match and the record is dropped
at the bus rather than at the destination. Rules matching on `detail`, which is
the case the tests cover, are unaffected, which is why it stayed invisible.

The docs claimed all four destination kinds are supported. AWS has five: an S3
bucket, on failure only. The router keys on the service in the destination ARN
and has no s3 arm, so such a record reaches the default arm and is dropped with a
warning. That is the deploys-green-nothing-arrives shape this branch exists to
remove, so it is now a third bullet in the limits list rather than an omission,
and the opening sentence says four of five instead of all four.

The Resources test is measured killing a mutant: with the entry.put removed it
fails with "was: null", which is the defect verbatim.

* docs(lambda): correct the pre-fix mechanism, and scope the hop bound honestly

Two corrections from review, both to things this branch asserted.

The Resources javadoc and its test comment said the member "arrives empty
rather than absent, so the pattern simply does not match". It was absent, and
the route is worse than a mismatch: matchesPattern casts event.get("Resources")
to an ArrayNode unconditionally (EventBridgeService.java:894), so an absent
member throws NPE, the surrounding catch swallows it, and it is logged as
"Failed to parse event pattern" and reported as no-match. The record is dropped
at the bus and the log blames the caller's pattern. SesEventPublisher.java:215
already documents the same shape in almost the same words.

The limits list said a chain "stops at 16 hops" without qualification. The bound
is keyed on the destination being a Lambda ARN, so a cycle that leaves and
re-enters Lambda another way is not bounded at all: SnsService.java:1688 and
EventBridgeInvoker.java:109 each start a fresh chain at zero, so a topic that
fans back to the function, or a bus rule targeting it, loops forever. With
CallerRunsPolicy on the async executor that grows the stack once the queue
saturates rather than just spinning.

The code fix needs the depth threaded through both re-entry points, so it is
filed rather than done inline. The docs no longer claim what the code does not
do, which is the half that must not wait.

* fix(lambda): always emit millisecond precision in the record timestamp

Instant.toString() emits micro or nanosecond precision on JDK 9+, and emits no
fractional part at all when the nanos are zero. AWS always emits milliseconds
(2019-11-14T18:16:05.568Z), so a consumer parsing the record with a fixed .SSS
pattern breaks on the whole-second case. Same formatter shape as
ElasticBeanstalkQueryHandler, which already had this problem.

The test is deterministic on purpose. An assertion that only formats now() is
passed by truncatedTo(MILLIS).toString() about 999 runs in 1000, since that
differs only on an exact second -- I measured exactly that: the first version of
this test let the near-miss through, 16/16 green. formatRecordTimestamp is
package-private so the deciding input can be pinned, and the mutant now fails
with "expected 2019-11-14T18:16:05.000Z but was 2019-11-14T18:16:05Z".

LambdaEventInvokeConfigAccountScopeTest becomes an IntegrationTest. The earlier
round dismissed the conformance warning as a rule the repo ignores; review
counted it, and it does not: 778 of 922 @QuarkusTest classes follow the naming,
and 26 of 29 within services/lambda. The dismissal was wrong.
2026-09-23 18:32:06 -04:00
Kurt McAlpine a574a6d01f fix(docker): keep host network mode for containers that publish ports (#4192)
* fix(docker): keep host network mode for containers that publish ports

A spec with port bindings skipped HostConfig.NetworkMode on create and
connected to the network after start, which Docker refuses for host,
none and container:<id>. Such containers silently stayed on the default
bridge with a published port, so an OpenSearch domain under
FLOCI_SERVICES_DOCKER_NETWORK=host stopped listening on the host's :9200
once domains always published a host port (#2798).

Namespace network modes now always go on the HostConfig, their port
bindings are dropped since Docker publishes nothing there, and the
post-start connect is skipped. A host-network container's endpoint
resolves to localhost when Floci itself runs in Docker instead of a
null host.

* fix(docker): resolve container:<id> endpoints through the owning container

resolveEndpoint only special-cased host, so a container sharing another
container's network namespace fell through to resolveContainerIp, which
has no network to read, and Floci stored a null host for it. The
endpoint now follows HostConfig.NetworkMode to the owning container:
localhost when that container is on the host network, otherwise its IP
on the Docker network. Reading the mode from the inspect rather than the
spec also covers adopted containers.

* test(docker): pass portBindingHostIps to the network test spec helper

ContainerSpec gained a 28th component in #4175 after this branch was cut, so the spec(...) helper added here no longer compiled once rebased onto main.
2026-09-23 18:31:09 -04:00
Niels Kootstra a624608b5d fix(scheduler): keep a schedule's account across UpdateSchedule (#4258)
UpdateSchedule rebuilt the schedule without its account id, so an updated
schedule with ActionAfterCompletion=DELETE was no longer found in its own
account when it completed and was never deleted.
2026-09-23 18:26:21 -04:00
Niels Kootstra 1027f0a602 fix(ssm): bound direct-execution output to the GetCommandInvocation limits (#4257)
The direct executor buffered a command's full stdout and stderr in memory
until the command finished, and only then truncated them to 24,000 and
8,000 characters.

Collect each stream with a bounded collector that keeps the first N
characters, keeps draining the Docker stream after the cap, decodes UTF-8
characters split across frames, and never ends on half a surrogate pair.
2026-09-23 18:18:37 -04:00
Daniël van Ziel fab5130ebb fix(s3): validate CreateBucketConfiguration before creating the bucket (#4113) 2026-09-23 18:07:46 -04:00
Daniël van Ziel 75dd057b5c fix(athena): keep terminal queries terminal (#4112) 2026-09-23 18:04:02 -04:00
Niels Kootstra ea60f70ad2 fix(apigatewayv2): cap HTTP_PROXY integration responses at the 10 MB payload quota (#4226)
HttpProxyInvoker read the whole integration response into memory with no
limit. Stop reading once a response passes API Gateway's 10 MB payload quota
and return 413 Request Entity Too Large, for Content-Length, chunked and
close-delimited bodies alike. REST and HTTP APIs share this invoker, so both
get the limit.
2026-09-23 17:08:11 -04:00
yarammanasa2001-maxandyarammanasa2001-max 317e007942 fix(redshift): fix Redshift emulation gaps found against the Terraform AWS provider (#3987)
* fix(redshift): add SnapshotArn and SnapshotCreateTime to snapshot responses

DescribeClusterSnapshots and CreateClusterSnapshot never populated
SnapshotArn or SnapshotCreateTime — the Snapshot model didn't carry
either field. Real AWS returns both, and callers that filter on
recovery-point age or restore by ARN have nothing to key off.

SnapshotArn reuses the existing snapshotArn(clusterIdentifier,
snapshotIdentifier) helper (already used for tagging, just never
attached to the model). SnapshotCreateTime is captured via Instant.now()
at snapshot creation and formatted with the same DateTimeFormatter.ISO_INSTANT
convention already used elsewhere in this file for Expiration/CreateTime.

Both elements are omitted from the XML response when the snapshot predates
this field (an on-disk store surviving an upgrade), matching how the other
optional elements in buildSnapshotXml already degrade.

* feat(redshift): support DescribeLoggingStatus, EnableLogging, DisableLogging

The Upbound Terraform provider's redshift Cluster resource calls
DescribeLoggingStatus on every observe cycle, unconditionally, as part
of its standard drift check across all configurable cluster aspects —
not something a caller opts into. Without it, every cluster's observe
step failed outright with InvalidAction, and the cluster could never
report Synced/Ready even once fully created and available.

Adds the three logging actions as a set, matching how EnableLogging/
DisableLogging/DescribeLoggingStatus share one response shape in the
real API. No log delivery is emulated — only the configuration a caller
set (enabled, bucket, prefix) is tracked and returned, the same
graceful-scope choice already made for snapshot dump handling.

XML wrapper element names (DescribeLoggingStatusResult, EnableLoggingResult,
DisableLoggingResult) were verified against aws-sdk-go-v2's own generated
deserializer, not assumed from the docs.

* fix(redshift): default parameter group and MultiAZ on cluster responses

Terraform provider's resourceClusterRead indexes ClusterParameterGroups[0]
and requires MultiAZ to be exactly "enabled" or "disabled" unconditionally.
Real AWS always attaches a default parameter group and never returns MultiAZ
blank; floci previously omitted both, causing a panic and then a read error
in the provider.

* fix(redshift): resolve RestoreFromClusterSnapshot by SnapshotArn too

Real AWS lets callers restore from either SnapshotIdentifier or
SnapshotArn. Terraform's aws_redshift_cluster resource populates only
snapshot_arn when that's the field configured, so the request carried
no SnapshotIdentifier at all and floci NPE'd looking one up as null.

* fix(redshift): use the real AWS error code for missing subnet groups

RedshiftService threw "ClusterSubnetGroupNotFound", but AWS's actual
code is "ClusterSubnetGroupNotFoundFault" and the Terraform AWS
provider's generated deserializer type-matches on that exact string to
recognize "doesn't exist yet, create it". A bare code fell through to
an unclassified error, so the provider never got past Observe and a
cluster subnet group could never be created through Crossplane.

* fix(redshift): address PR review feedback

Validate SnapshotArn (400 on malformed/missing, account and region check),
honor ClusterParameterGroupName and MultiAZ, seed the default parameter
group, allow CloudWatch EnableLogging, return 400 for missing subnet
groups, sync docs, and add tests.

* test(redshift): fix merge of logging tests with main's IAM role tests

* refactor(redshift): share logging response helper and trim comments

* fix(redshift): restore testDisableLogging's closing brace lost in the main merge

Merging main's snapshot-copy-grant tests (#3628) next to the logging
tests dropped the closing brace of testDisableLogging and the @Test
annotation on describesSnapshotCopyGrants, so the latter body ran
inside the former and the file failed to compile.

* docs(redshift): resync action table order after the main merge

make docs-sync moved ModifyCluster after the snapshot-copy-grant rows
main added, matching the generator's canonical action order.

---------

Co-authored-by: yarammanasa2001-max <271440416+yarammanasa2001-max@users.noreply.github.com>
2026-09-23 16:59:27 -04:00
XuJian 22c56157ee feat(ecr): advertise TLS registry URIs on opt-in (#4252) 2026-09-23 16:46:10 -04:00
jwoa95 eb039eb71c feat(cognito): serve managed login for native users with PKCE (#4238)
GET /oauth2/authorize with identity_provider=COGNITO, or none, now signs
in the pool's own users through managed login instead of requiring a
federated provider. It redirects to a plain sign-in form at
/cognito-idp/login (/login on a custom domain), which checks the
password as USER_PASSWORD_AUTH does, sets a pool-scoped `cognito`
session cookie and redirects to the callback with code and state. A
browser with a live session skips the form.

/oauth2/token enforces PKCE (S256 only, as on AWS) when the
authorization request sent a code_challenge, for managed login and
federated sign-in alike, and refuses a code_verifier for a code issued
without one (RFC 9700). The ID token carries the request's nonce.

/cognito-idp/logout (/logout on a custom domain) ends the session and
redirects to a registered LogoutURL, or back to the sign-in form for
the redirect_uri form of the request. Discovery advertises
code_challenge_methods_supported.

Closes #4218
2026-09-23 16:35:35 -04:00
jwoa95 7e4d4dafae feat(rds): pause and resume Aurora Serverless v2 clusters at zero capacity (#4232)
An Aurora cluster whose ServerlessV2ScalingConfiguration has MinCapacity 0
now freezes its database container with docker pause once nothing has used
it for SecondsUntilAutoPause, and resumes it for the next client, as Aurora
Serverless v2 does.

Every client of a backend container holds a lease while it uses it: each
connection through the auth proxy (cluster, reader, instance and RDS Proxy
endpoints), each RDS Data API call and open transaction, and each command
Floci runs inside the container. A client that reaches a paused cluster is
held, not refused, until the container runs again, after
FLOCI_SERVICES_RDS_AURORA_RESUME_DELAY_MILLIS (default 0; Aurora takes
about 15000). A connection that arrives while the pause is under way
cancels it.

While paused, the cluster and its instances stay available,
DescribeEvents reports RDS-EVENT-0370 to 0374 for each instance, and
ServerlessDatabaseCapacity, ACUUtilization and CPUUtilization report 0
once a minute. A cluster with a provisioned instance, in a global database
or behind an RDS Proxy never pauses. A ModifyDBCluster that changes
MinCapacity or SecondsUntilAutoPause resumes a paused cluster. Stopping,
deleting or rebooting a cluster, shutting Floci down and resetting its
state thaw a paused container first.
FLOCI_SERVICES_RDS_AURORA_AUTO_PAUSE_ENABLED=false keeps every cluster
running.

Closes #4219
2026-09-23 16:25:41 -04:00
XuJian c15af65bf0 fix(iam): scope managed policy attachment counts (#4213)
* fix(iam): scope managed policy attachment counts

* fix(iam): keep attachment counting out of policy resolution

* fix(iam): isolate managed policy snapshots

Copy mutable managed-policy state before returning account-scoped snapshots and cover catalog isolation with a regression test.
2026-09-23 14:09:02 -04:00
Niels Kootstra addee350ba fix(kinesis): expire shard records past the stream's retention period (#4224)
* fix(kinesis): expire shard records past the stream's retention period

Shards kept every record for the life of the stream, so memory grew without
bound and TRIM_HORIZON returned records older than the retention period.

Drop records older than the retention period when a shard is written or read,
including right after DecreaseStreamRetentionPeriod. Continuation and LATEST
iterators now resume by sequence number instead of by array index, so
trimming older records does not make a consumer skip data. Index-based
iterators issued by earlier versions, such as persisted Firehose checkpoints,
are offset by the number of records pruned since.

* fix(kinesis): read a shard's records and pruned count under one lock

A legacy index iterator is offset by the number of records pruned since
it was issued. The records and the count were read in two separate lock
acquisitions, so a prune between them left the count ahead of the
snapshot and the consumer resumed too early, replaying records it had
already read. Take both from one snapshot.

* chore: rerun CI

* test(kinesis): pin the service clock instead of stretching retention

The JSON handler timestamp tests raised retention to 8760 hours so a
fixed 2026 arrival timestamp survived pruning against the wall clock,
which would start failing a year later. Build those services with a
clock fixed just after the literal instead, and restore the fixed
2026-01-01 base in millisBehindLatestIsTimeDeltaWhenBatchLimitHit.
2026-09-23 14:05:10 -04:00
Abhigya 4e42f47740 fix(cognito): stop defaulting unset password requirements to enabled (#4250)
* fix(cognito): stop defaulting unset password requirements to enabled

CreateUserPool filled in RequireUppercase, RequireLowercase, RequireNumbers
and RequireSymbols as true whenever a PasswordPolicy left them out. The four
members are unboxed booleans in the Cognito model, so a client that wants one
off cannot say so on the wire: aws-sdk-go-v2 emits each under
`if v.RequireLowercase != false`. A request built for require_* = false
carries only MinimumLength, and Floci answered it with all four enabled.

That made every Terraform plan after a create report drift on all four flags,
converging only because UpdateUserPool does not normalize, and it over-enforced
the policy on SignUp and AdminSetUserPassword: a pool created with
PasswordPolicy { MinimumLength: 6 } rejected passwords real Cognito accepts.

The API reference documents no default for any of the four. It documents one
for TemporaryPasswordValidityDays ("Defaults to 7"), which is kept, along with
MinimumLength 8. The all-enabled policy is the console's "Cognito defaults"
mode, not an API default; terraform-provider-aws asserts require_numbers and
require_uppercase read back as false immediately after a create that set them
to false, against the live service.

Absence now means "not required", which validatePasswordAgainstPolicy already
resolved that way through policyBoolean, so enforcement follows with no change.

Pools created with no PasswordPolicy at all are untouched, as before.

* test(cognito): pin the unset password requirement contract at the wire

Adds the JSON 1.1 half of the CreateUserPool password policy fix: a request
carrying only MinimumLength must come back without the four Require* members,
and a request that sets them to false explicitly must come back with false.

Verified non-vacuously - with the RequireUppercase default restored, the first
test fails on "RequireUppercase must not be defaulted on".
2026-09-23 14:03:27 -04:00
jwoa95 f8f1b56ce9 feat(cloudfront): forward viewer headers, cookies and query strings per origin request policy (#4230)
Custom origins only ever received the origin custom headers: the serving
controller built each origin request from them alone and dropped the
query string, whatever cache policy, origin request policy or legacy
ForwardedValues the matched cache behavior carried.

CloudFrontOriginRequestBuilder now decides what reaches the origin. With
a cache policy it forwards the union of the cache policy's
ParametersInCacheKeyAndForwardedToOrigin and the origin request policy
(every HeaderBehavior, CookieBehavior and QueryStringBehavior value).
Without one it applies legacy ForwardedValues, including the headers
CloudFront forwards by default. It also adds what CloudFront always
sends: Host for the origin unless the viewer Host is forwarded,
User-Agent "Amazon CloudFront", X-Forwarded-For, Via and X-Amz-Cf-Id.
Authorization is kept on the methods CloudFront does not cache, and
CloudFront-Forwarded-Proto, -Viewer-Address and -Viewer-Http-Version are
generated when a policy asks for them. Origin custom headers now replace
every same-named viewer header, and signing parameters are still never
forwarded.

The eight AWS managed origin request policies are served by their AWS
IDs and cannot be updated or deleted. With no origin request policy and
nothing selected by the cache policy, no cookies or query strings are
forwarded, as before.

Closes #4217
2026-09-23 13:59:53 -04:00
Niels Kootstra 0e432dd41b perf(s3): assemble multipart uploads without doubling the object in heap (#4227)
* perf(s3): assemble multipart uploads without doubling the object in heap

CompleteMultipartUpload read every part with Files.readAllBytes into a growing
ByteArrayOutputStream and then copied it again with toByteArray(), so a
disk-backed upload briefly held several full-size copies of the object.

Size one array from the part lengths and read each part straight into its
slot, failing if a part changes size during assembly rather than producing a
corrupt object. The composite ETag and full-object checksum are unchanged.

* fix(s3): fail multipart assembly when a part grows after being measured

The size check caught a part that shrank between being measured and
being copied, but not one that grew: the read stopped at the measured
size and the extra bytes were dropped. Disk parts are now checked for
end of file after the measured bytes, and in-memory parts are copied
from the arrays that were measured, whose length cannot change.

* chore: rerun CI
2026-09-23 13:56:29 -04:00
jwoa95 4ca0e085cd feat(cloudfront): serve POST, PUT, PATCH and DELETE viewer requests (#4229)
The serving controller only declared GET, HEAD and OPTIONS, so a write
method on a distribution host matched the resource class but no method
and fell through to a bare 405, even when the cache behavior allowed all
seven methods.

POST, PUT, PATCH and DELETE are now served under the same AllowedMethods
check (403 "Invalid method." otherwise) and the same trusted key group
enforcement as the read methods. Custom origins receive the method, the
viewer request body, its Content-Type and its Authorization header, with
Content-Length taken from the body; GET and HEAD still reach the origin
without Authorization, as on CloudFront. In-process S3 origins answer
these methods with 403 Access Denied instead of forwarding them, which
is documented.

Closes #4216
2026-09-23 12:24:40 -04:00
Niels Kootstra 6bf1695f2a fix(eks): remove the k3s container on DeleteCluster when shutdown retention is on (#4241)
With keep-running-on-shutdown enabled, EksClusterManager.stopCluster
returned before removing the container, so DeleteCluster left the k3s
container and its data volume behind. The option only governs emulator
shutdown, so the check moves to EksService.shutdown, which now detaches
from each cluster (metadata endpoint and log stream) and leaves its
container running. stopCluster always removes the container.

Closes #4239
2026-09-23 12:10:24 -04:00
Simone Primarosa 188542e67f feat(ssm): seed the EKS optimized AMI parameter paths (#4191) 2026-09-23 12:00:12 -04:00
Abhigya f2d6710b24 fix(rds): apply DBInstanceClass, AllocatedStorage and EngineVersion on ModifyDBInstance (#4214)
* fix(rds): apply DBInstanceClass, AllocatedStorage and EngineVersion on ModifyDBInstance

ModifyDBInstance parsed the password, IAM auth, subnet group, option group,
security groups and the backup and monitoring settings, but never read
DBInstanceClass, AllocatedStorage or EngineVersion. A resize or an engine
upgrade returned 200 while DescribeDBInstances kept reporting the values the
instance was created with, so a caller that diffs its configuration against a
read-back saw the same pending change on every run.

The three members move into a DbInstanceScalingChanges record that the handler
fills from the request and the service applies, with the rules the AWS API
reference states for them:

- AllocatedStorage below the current size fails with InvalidParameterCombination
- an increase under 10% is rounded up to 10% greater on PostgreSQL, MySQL and
  MariaDB, and taken as given on SQL Server
- the same size is not a change and is left alone
- a different major EngineVersion needs AllowMajorVersionUpgrade

Floci applies the change immediately rather than deferring it to the preferred
maintenance window: it runs no maintenance window and models no
PendingModifiedValues, so a deferred change would never be applied at all.

* fix(rds): reject a ModifyDBInstance scaling change before applying any member

The scaling members were validated as they were assigned: the class was set,
then the storage was resolved, which can refuse a shrink, then the engine
version was checked, which can refuse a major upgrade. The instance a modify
works on is the stored object rather than a copy, so a request refused at the
second or third step had already written the earlier ones, and a read-back
reported a class the 400 said it never got.

The checks now run in resolveFor, ahead of every setter in modifyDbInstance,
including the password rotation that reaches the running container. applyTo is
left as pure assignment of an already-resolved record.
2026-09-23 11:41:15 -04:00
Allen Sanborn daecc6da17 fix(route53resolver): CreateResolverEndpoint reads IpAddresses, as AWS names it (#4180)
* fix(route53resolver): CreateResolverEndpoint reads IpAddresses, as AWS names it

CreateResolverEndpoint read its address list from a member called
IpAddressRequests. AWS names that member IpAddresses; the list's SHAPE is named
IpAddressRequest, which is where the wrong wire name came from.

The distinction is not cosmetic. Every AWS SDK, the CLI and the Terraform
provider serialise IpAddresses, and the CLI refuses to send IpAddressRequests at
all because no such member exists in its model. So the operation dispatched and
no real client could call it:

  {"Name":"ep","Direction":"INBOUND","SecurityGroupIds":["sg-1"],
   "IpAddresses":[{"SubnetId":"subnet-1"}]}
  -> 400 InvalidParameterException: IpAddressRequests is required

That is the worst shape a gap can take, because every cheap check says the
service works: it is in the service directory, /_floci/health lists it, an
operation-name grep finds it, and a does-it-route probe passes.

Reads IpAddresses, still accepting the old spelling so anything written against
the previous behaviour keeps working — the existing CustomResources tests use it
and are untouched. The error message names only the AWS member, since it is the
sole hint a caller gets. The idempotency record keeps its internal member name
deliberately: renaming it would make every endpoint stored by an earlier build
read as absent, which that code reports as a replay conflict.

Tests: the AWS member is accepted, the legacy one still is, a retry that switches
between the two spellings is not a conflict, and the missing-member error names
IpAddresses. 55 Route53Resolver tests pass.

Reported as #4108. Found while confirming that an earlier finding — Route53Resolver
absent entirely — had been fixed upstream: the probe written for it asserted only
that the call dispatches, which is what let this hide behind it.

* style: use -- rather than an em dash in added prose

AGENTS.md forbids em dashes in all content and the conformance check flags them.
Two in javadoc lines this branch added. Comments only, no behaviour change.

* docs(route53resolver): name the list shape correctly, and trim the member note

The list shape is `IpAddressesRequest`; `IpAddressRequest` is the shape of each
element, and that element name is where the wrong wire spelling came from. Both
the service doc and the Javadoc on ipAddressesOf had it as the list's own name.

The Javadoc also carried a paragraph on how the bug stayed hidden, which the PR
description already covers at length. What a reader of this method needs is the
member name and the legacy alias, so that is what is left.
2026-09-23 11:20:50 -04:00
Aniket Shukla de50859273 fix(sns): match nested message-body policies in arrays (#4234) 2026-09-23 11:03:10 -04:00
Allen Sanborn aba5f4e919 fix(ec2): release a capture when a whole batch of instances is terminated (#4127)
* fix(ec2): release a capture when a whole batch of instances is terminated

TerminateInstances excluded only the instance currently being processed when
deciding whether a deregistered AMI's capture still had a live dependant. Every
other instance of the same request still read as running or shutting-down, so
each reclaim attempt in the batch was blocked, and since nothing revisits the
batch once its asynchronous teardown finishes the committed Docker layer stayed
on disk for the lifetime of the emulator.

Thread the ids of the whole request through terminateInstances ->
reclaimCapturesPinnedBy -> reclaimCapturedImage, so none of them counts as a
live dependant. The reclaim is now attempted on the first instance of the batch,
while the other containers may still exist and the daemon may refuse to delete
the layer; the reference is only cleared on success, so the attempt comes round
again on each remaining instance and the last one succeeds. Both behaviours are
covered by new tests that terminate a batch in a single call, with the container
manager stubbed to leave instances shutting-down as production does.

* fix(ec2): retry the capture reclaim once container teardown has finished

Threading the batch through the dependency check was not enough on its own.
terminate() only schedules the container removal, so every attempt made inside
the TerminateInstances loop can run while a container of that same batch still
exists. Docker then refuses to delete the image, and because the loop is the
only thing that retries, a batch whose containers all tear down slowly left the
captured layer on disk for the lifetime of the emulator.

Give terminate() an optional callback that runs on the teardown executor once
the container is really gone, and have terminateInstances pass one that
attempts the reclaim again. The callback is invoked from a finally block so a
failure earlier in teardown does not skip it, and anything it throws is logged
rather than killing the executor task. The synchronous attempt stays: by the
time the loop reaches later instances the earlier containers are often already
gone, and it costs one refused call when they are not.

The existing stubs move to the two-argument form. The default one runs the
callback, modelling teardown that completes immediately;
terminationLeavesInstancesShuttingDown holds it instead, so a test can decide
when teardown finishes. The new test covers the case this commit fixes: every
in-loop attempt refused, then the layer reclaimed once teardown completes.
aRemovalTheDaemonRefusesKeepsTheReferenceForALaterAttempt now expects the extra
post-teardown attempt, with the counts explained in the test.

* fix(ec2): run the teardown hook only once the container is gone

The hook ran from a finally block, so a teardown that threw before the
container was removed still fired it. A capture reclaim would then be
attempted while Docker still referenced the image, be refused, and have no
later retry behind it, which is the state the hook exists to avoid.

Track whether the container is actually gone: removed, already absent, or
never launched. Everything after removal can fail without making the hook
wrong, so it still runs from the finally block, but a failed removal now skips
it and logs why.

Two tests in Ec2ContainerManagerTest: the hook fires on the ordinary path, and
it does not fire when removeContainerCmd throws. The second fails without the
guard.

* style(test): place the AtomicBoolean import with the other java.util.concurrent.atomic entries

* docs(ec2): drop the duplicated teardown-hook rationale, and fix the skip message

The Javadoc's third paragraph and the comment at the top of the teardown
lambda explained the same rule in almost the same words; the Javadoc is the
one callers read, so the inline comment now just names the variable's role
and points there.

The skip message claimed the container "could not be removed", but
unpublishAll runs first inside the same try: if it throws, containerGone is
still false and the same message is logged with no removal ever attempted.
It now says the container is not established to be gone, which is what the
flag actually means on both paths.

* fix(ec2): run the post-teardown reclaim as the account that owns the instances

The hook runs on the teardown executor, which carries no request context, so
every account-aware store it touched resolved under the default account. For a
batch in any other account capturedImageFor looked the AMI up under
000000000000, found nothing, returned null, and the reclaim returned at its
first guard. That is silent: no exception and no log, because having no capture
is the ordinary case this path returns quickly for. The slow-teardown batch is
the whole reason the hook exists, so the leak stayed open exactly there.

The account is captured in terminateInstances, on the request thread where the
context is still active, and the hook runs under RequestScopes.runAs. That is
what the other background workers do, and its Javadoc names this failure.

Scoping the whole hook rather than threading scanForAccount/putForAccount into
reclaimCapturesPinnedBy is deliberate: capturedImageFor runs FIRST and reads
registeredImages.get(), so a fix confined to the scan and the write-back would
still have returned null before reaching either.

The regression test drains the teardown callbacks on a bare thread, because the
existing batch tests run them on the test thread where the request context is
active, which is why none of them could see this. It fails without the change:
the two synchronous in-loop attempts still happen, since those run on the
request thread, and only the third one, the hook's, goes missing.
2026-09-23 11:02:27 -04:00
Aniket Shukla 97aa084209 fix(sns): require IAM role ARN for Firehose subscriptions (#4233) 2026-09-23 10:57:28 -04:00
Aniket Shukla b6d5d51bde fix(sns): validate Publish Subject (#4172)
* fix(sns): validate Publish Subject

* fix(sns): validate Subject for SMS publishes too

* fix(sns): accept 100-character subjects and leading spaces
2026-09-23 10:52:50 -04:00
Niels Kootstra 2c3332c7cf fix(opensearch,mwaa): remove containers on explicit delete when shutdown retention is on (#4225)
keepRunningOnShutdown made stopDomain and stopEnvironment return early, so
DeleteDomain and DeleteEnvironment left their containers running. Only the
shutdown hook now honours the setting, matching how MWAA already guards its
shutdown path.
2026-09-23 10:17:48 -04:00
Allen Sanborn 4b3923712a feat(redshiftserverless): add namespace lifecycle and tagging (#3631)
* feat(redshiftserverless): add namespace lifecycle

Amazon Redshift Serverless was absent entirely: every call returned
UnknownOperationException, so Terraform's aws_redshiftserverless_namespace
could not be planned or applied against Floci.

Add a JSON 1.1 service under the RedshiftServerless. target prefix with
CreateNamespace, GetNamespace, ListNamespaces, UpdateNamespace, and
DeleteNamespace. Namespaces are account and Region scoped and stored through
StorageFactory. AWS defaults are applied on create (dbName dev, kmsKeyId
AWS_OWNED_KMS_KEY, empty logExports, status AVAILABLE), adminUserPassword is
accepted and never returned, DeleteNamespace returns the removed namespace
with status DELETING, and UpdateNamespace applies only the supplied fields.

Workgroups, snapshots, and the tagging operations remain unemulated.

* feat(redshiftserverless): add namespace tagging operations

Terraform's aws_redshiftserverless_namespace calls ListTagsForResource on
every read once tags are involved, so the namespace lifecycle alone left the
resource broken as soon as a config set tags.

Add ListTagsForResource, TagResource, and UntagResource. Lookup is by
resourceArn rather than namespace name, scoped to the caller's Region, since
that is how AWS keys these operations; the namespace is currently the only
taggable Redshift Serverless resource, so any other ARN is reported absent.
TagResource merges into the existing tags, UntagResource removes by key, and
tags passed to CreateNamespace are readable back and survive UpdateNamespace.

* fix(redshiftserverless): emit creationDate as ISO-8601 per the API model

The awsJson1.1 default is epoch seconds and 133 call sites use it, but this
model overrides it: TimestampFormatTrait ISO_8601 on creationDate (and on all
eleven other timestamp members in the package, audited). Strict clients broke
on the number: Terraform's Go SDK failed to decode and orphaned the created
namespace outside state; the Java SDK failed to unmarshall. Only botocore's
lenient parsing let CLI checks pass. Emitted via the repo's millisecond-ISO
idiom; format pinned by regex in the integration test and by a new
handler-level unit test class covering the wire layer that had none
(timestamp shape, nextToken emission, maxResults type guard). Checklist note
added to AGENTS.md + CONTRIBUTING.md so the next service checks the trait
before reaching for the epoch idiom.

* docs(redshiftserverless): the ISO-8601 rule is per member, not model-wide

Review follow-up: the earlier claim that every timestamp member in this model
carries TimestampFormatTrait(ISO_8601) is wrong — 15 of the model's 30 INSTANT
members carry no trait and fall back to the awsJson1.1 epoch default. The
shipped code is unaffected (creationDate, the only timestamp emitted, is
genuinely ISO_8601), but the claim was load-bearing guidance: whoever adds
snapshots or scheduled actions next would have applied ISO-8601 to trait-free
members and reintroduced the bug in the opposite direction. Narrowed in all
four places it appeared.

* fix(redshiftserverless): validate collection types, copy-on-update; drop em dashes

A present iamRoles, logExports, tags or tagKeys member that was not a JSON
array parsed to null and was then indistinguishable from an omitted member,
so a malformed UpdateNamespace silently kept the stored value and returned
200 instead of reporting the request as invalid. Only a missing or null
member now means "omitted"; a present member of the wrong type, or a
collection holding a non-string element, is a ValidationException naming the
member.

updateNamespace mutated the stored Namespace in place while GetNamespace and
ListNamespaces read without taking the same monitor, so a concurrent reader
could observe a torn object with some fields updated and some not. Build the
new state on a copy and store that instead, which also makes the write-back
explicit. The same in-place mutation was present in tagResource,
untagResource and deleteNamespace, so all four now copy. Merge semantics are
unchanged.

Replace the em dashes in the timestamp guidance with commas and periods, per
the repository ban.

* fix(redshiftserverless): reject Redshift reserved words as namespace names

CreateNamespace rejects a namespace name that is an Amazon Redshift SQL
reserved word, so names like select or user passed the length and
[a-z0-9-] checks here and were persisted. Add the documented reserved
word list to the shared namespace-name validator, which create, get,
update and delete all reach, so the rejection is consistent.
2026-09-23 10:13:24 -04:00
Simone Primarosa dc70f60a66 fix(eks): claim the cluster user data slot atomically (#4190)
* fix(eks): claim the cluster user data slot atomically

* fix(eks): propagate user data execution result to concurrent node groups
2026-09-23 09:12:46 -04:00
Simone Primarosa 7c94f69571 feat(ec2): bound instance containers to their instance type resources (#4189) 2026-09-23 09:08:37 -04:00
XuJian d8a4f5e58e fix(iam): enforce case-insensitive resource names (#3986)
* fix(iam): enforce case-insensitive resource names

Reject duplicate IAM user, group, role, and managed policy names that differ only by case.

Signed-off-by: XuJian <265865031+xujiantop-crypto@users.noreply.github.com>

* test(iam): cover case-insensitive resource names

Signed-off-by: XuJian <265865031+xujiantop-crypto@users.noreply.github.com>

* test(iam): verify case-insensitive names end to end

Signed-off-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>

* fix(iam): enforce instance profile name uniqueness

* fix(iam): preserve name uniqueness on group rename and legacy data

* fix(iam): exclude managed catalog mirrors from name conflicts

---------

Signed-off-by: XuJian <265865031+xujiantop-crypto@users.noreply.github.com>
Signed-off-by: xujiantop-crypto <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-23 09:06:17 -04:00
TATSUNO “Taz” Yasuhiro 133ef62d27 feat(dynamodb): vector indexes and SearchVectors (#4215)
* feat(dynamodb): define vector indexes on the table control plane

* feat(dynamodb): serve SearchVectors against vector indexes

* feat(dynamodb): validate vector attributes on write

* feat(dynamodb): report vector write capacity on writes

* fix(dynamodb): reject a PartiQL read of a vector index

* test(dynamodb): cover vector search in Floci's own suite

* fix(dynamodb): match AWS on vector member paths and the f32 number format

* fix(dynamodb): match AWS on the vector search validation gaps

* perf(dynamodb): stop retaining and recomputing per candidate in vector search

* docs(dynamodb): document that indexes are not stored
2026-09-23 08:57:08 -04:00
Hector Ventura 6fadba8d57 fix(cloudformation): apply EC2 Instance UserData and IamInstanceProfile in place (#4206)
UpdateStack kept a reused AWS::EC2::Instance's prior UserData and
IamInstanceProfile because Ec2Service had no in-place path for either: the
provisioner reconciled only InstanceType and SecurityGroupIds. On AWS both are
mutable, UserData with the "some interruptions" of a stop and a start.

EC2 gains the three association actions, AssociateIamInstanceProfile,
ReplaceIamInstanceProfileAssociation and DisassociateIamInstanceProfile, with
botocore's wire names, all five members of the association including the
timestamp the instance now records, and the errors moto documents
(IncorrectState for a second association, InvalidAssociationID.NotFound for
an unknown id). ModifyInstanceAttribute accepts UserData.Value on a stopped
instance, answering IncorrectInstanceState otherwise, the order Terraform's
provider performs as stop, modify, start. The association id derivation moves
from the handler into Ec2Service so the provisioner can name an association.

Ec2InstanceCfnProvisioner rewrites a changed UserData across a stop and a
start (an already stopped instance stays stopped), resolves the profile name
to its ARN at provision time as the RunInstances handler does, associates or
replaces a changed profile, and disassociates one only when the template
declared it last time, recorded in a __Floci attribute so a profile a launch
template set is never stripped. A dropped UserData is left as it is, the same
rule SecurityGroupIds follows.

Tests: Ec2InstanceCfnProvisionerTest covers the stop/modify/start order, the
stopped case, associate, replace, disassociate and the undeclared-profile
guard; Ec2IamInstanceProfileAssociationIntegrationTest and
Ec2UserDataAttributeIntegrationTest pin the wire behaviour;
CloudFormationEc2InstanceIntegrationTest updates both properties on one
instance and reads them back through EC2.
2026-09-23 08:51:47 -04:00
Kenshin Okinaka 678b50f14b feat(ses): run custom verification emails through the shared send preamble (#4212)
* feat(ses): run custom verification emails through the shared send preamble

SendCustomVerificationEmail accepts a ConfigurationSetName like the other
send APIs but skipped everything the other send paths do first. It now
resolves the identity's default configuration set, refuses a paused set,
honours the account suppression list, scans the template subject and body
like any other content, and publishes its Send, Bounce or Reject events
through the shared classifier. A suppressed or rejected verification email
is recorded but not relayed.

* test(ses): give the builder's cvetService accessor the same guard as its peers

It was the only accessor that lazily created its service instead of
requiring build() first, so a caller could get a service the built
SesService did not use. build() now assigns the field with the others.
2026-09-23 08:47:16 -04:00
Hector Ventura fac87a6cf4 fix(cloudformation): make a stack's collections safe for concurrent requests (#4199)
A Stack is shared state: it lives in the service's concurrent map and is
handed to every request that names it while the operation executor provisions
it, but its collections were plain LinkedHashMaps and an ArrayList mutated
outside any lock. DescribeStackEvents copied the event list while a running
ExecuteChangeSet appended to it (41 addEvent sites), resources were put and
removed while DescribeStackResources walked them, and DeleteChangeSet removed
from the change-set map under nothing.

The model now owns its thread safety: synchronized maps over LinkedHashMap, so
the insertion order the XML responses reproduce survives; a CopyOnWriteArrayList
for the append-mostly event log; setters that wrap whatever Jackson or the
service hands in; and *Snapshot() accessors that copy under the map's monitor.
Jackson serializes through the snapshots under the same property names, so
persisting a stack mid-deploy no longer races the deploy and the stored shape
is unchanged. Every iterating site in CloudFormationService and the query
handler reads a snapshot; the one removeIf on the change-set map runs under
its monitor. #3564 had already made the change-set claim atomic; #2473 carried
this shape but was closed after a broken rebase.

A whole-map replace is one step too. clear() and putAll() are two separately
locked calls on a synchronized map, so a snapshot between them copied an empty
map: a DescribeStacks mid-update reporting no Outputs. Stack's replace*
methods hold the map's monitor across the pair, and the nine clear/putAll
sites (parameters, the update's outputs, exports and export names, both
rollback restores) go through them.

Closes #2419
2026-09-23 00:49:23 -05:00