Commit Graph
852 Commits
Author SHA1 Message Date
Hector Ventura 0dd080a46f feat(core): partition foundation from botocore's published partition data (#4317)
P1 of the multi-partition initiative (#4272). tools/aws/regen_partitions.py
vendors botocore's partitions.json and endpoints.json (8 partitions, 46 regions,
the partition-wide endpoints with their signing regions) plus the CDK's opt-in
and S3 website rules into src/main/resources/aws/partitions.json, checked by
make aws-data-check. AwsPartition and AwsPartitions replace the hand-typed rules
behind AwsRegions; RequestContext carries the request's partition from its
SigV4 signing region; RegionResolver mints global ARNs in that partition and
buildArn routes a blank region there; floci.partitions.id pins the deployment's
partition behind a startup validator that refuses a contradiction with the
default region.

Behaviour a reviewer will see, all AWS-faithful: DescribeRegions follows the
request's partition and the opt-in model (17 commercial regions by default, all
34 with AllRegions=true, RegionName.N filters, endpoints on the partition's DNS
suffix); TLS SANs cover every published region; the EKS registry mirrors follow
the deployment partition's regions. The partition-literal baseline drops by two.

Part of #4272
2026-09-24 10:33:05 -04:00
Priamo Germosen 910f0922c9 feat(iam): add GenerateCredentialReport and GetCredentialReport (#4298)
Generates and downloads the account's credential report, the 23 columns
AWS documents for it, in CSV, Base64-encoded per the wire model. The
report is a single value per account, stored the same way accountAliases
and passwordPolicies already are, and regenerated only once the previous
one is older than 4 hours, matching AWS's documented caching window.

CSV content: every IAM user gets real password_enabled, password_last_used,
password_last_changed and access_key_1/2_active/last_rotated where Floci
already tracks that state, plus the documented placeholder values for what
it does not model (MFA devices, X.509 signing certificates, access-key
last-used date/region/service, and password_last_used itself, since
nothing in the codebase ever sets IamUser's passwordLastUsed field). The
root account row is present, as AWS always includes it, but is placeholder
throughout: Floci does not model root account credentials at all, the same
reason GetAccountSummary's AccountPasswordPresent and
AccountAccessKeysPresent are always zero.

password_last_changed needed a new LoginProfile field: UpdateLoginProfile
changes the password without touching LoginProfile's own createDate (its
meaning stays 'profile created'), so reading createDate for this column
would have kept reporting the original creation time after a password
change. passwordLastChanged is set alongside createDate initially and
updated whenever UpdateLoginProfile actually changes the password, falling
back to createDate for a profile persisted before this field existed.

additional_credentials_info is Floci's own wording, since AWS does not
document the exact text; in practice it is unreachable, since
CreateAccessKey already enforces the real 2-key-per-user quota.

Generating a report is effectively instant here, so GenerateCredentialReport
never actually returns INPROGRESS; a GetCredentialReport call right after
it always finds the report ready. The STARTED state and its description
for the no-report-exists case match AWS's own documented example response
verbatim; the report-expired case's wording is Floci's own, since AWS does
not document it.
2026-09-24 07:45:24 -05:00
XuJian 1952ba4052 feat(ecr): manage pull through cache rules (#4304)
Signed-off-by: XuJian <265865031+xujiantop-crypto@users.noreply.github.com>
2026-09-24 08:36:06 -04:00
Kenshin Okinaka 34be03b334 feat(ses): add v2 BatchGetMetricData (#4302)
Aggregates the per-recipient timelines already stored at send time, so the
batch metrics and GetMessageInsights cannot disagree about what a send
produced. Buckets are whole UTC days, the series is sparse rather than zero
filled, the end of the range is exclusive, and counting is per recipient.

SentEmail gains the configuration set the send resolved to, which the
CONFIGURATION_SET dimension filters on. The VDM gate moves into a shared
SesVdmGate so the two gated operations keep one copy of the probed message.

Metrics that need a real mailbox to act stay empty, as does TRANSIENT_BOUNCE,
since every bounce Floci derives is permanent.
2026-09-24 08:34:15 -04:00
Simone Primarosa 876ddc7422 feat(ec2): expose synthesized cluster node instances to the EC2 service (#4262)
* feat(ec2): expose synthesized cluster node instances to the EC2 service

* fix(ec2): enforce account isolation and tag persistence for cluster node instances

* fix(ec2): scope findInstanceById to caller account for external instances

Scope findInstanceById to the caller account when falling back to
external instances instead of matching across all accounts. Thread
the account identifier into SSM direct command execution, ELBv2 target
resolution, and classic ELB health checking so external cluster nodes
remain strictly account-isolated across all instance lookup paths.

* fix(ssm,eks): update test stubs for account-scoped direct execution and harden cluster provider
2026-09-24 08:27:52 -04:00
Abhigya bae7e0316a feat(s3): enforce Block Public Access on the data plane (#4253)
* feat(s3): enforce Block Public Access on the data plane

The four Block Public Access flags were stored and returned but never read
by any authorization path, so put-public-access-block was accepted and
changed nothing: a bucket left public by a policy or an ACL stayed readable.

Enforce all four, combining a bucket's configuration with its owner
account's and taking the most restrictive of the two, as AWS does.

BlockPublicPolicy and BlockPublicAcls reject the write that would introduce
public access, which AWS applies whoever the caller is, so they do not sit
behind enforce-auth. RestrictPublicBuckets and IgnorePublicAcls suppress
access an existing policy or ACL grants, which only has meaning once
anonymous authorization runs, so they take effect under enforce-auth.

Deciding what counts as public follows the documented AWS rules: an ACL is
public when it grants any permission to AllUsers or AuthenticatedUsers, and
a policy is assumed public unless a wildcard-principal statement pins a
recognised condition key to a fixed value. A single public statement makes
the whole policy public, so RestrictPublicBuckets also withholds the
cross-account delegation a separate non-public statement grants.

Enabling a setting never rewrites stored state; an existing public policy
or ACL is left exactly as written.

* test(s3): pin the Block Public Access contract at the wire

Cover the write-time flags under the default configuration and the
read-time flags under enforce-auth, including the reproduction that
motivated the fix: put-public-access-block followed by an anonymous
GetObject on a bucket whose policy is public.

Each enforcing assertion is paired with a negative control that must keep
passing without the fix, so a test cannot pass vacuously: the without-BPA
case still returns 200, and the owner's signed access is never affected.
Reverting the S3Service change fails the 11 enforcing assertions and leaves
the 10 controls green.

Unit tests cover the settings record's parsing and most-restrictive merge,
the ACL public-status rule, and the policy public-status rule against the
examples in the AWS documentation.

* test(s3): validate Block Public Access through the AWS SDK

Drives BlockPublicPolicy and BlockPublicAcls with S3Client so the rejection
is seen the way an SDK caller sees it: a 403 carrying the AccessDenied error
code, not just a status line. Both apply without enforce-auth, which is the
configuration this suite runs against.

* test(s3): drop the em-dash from the Block Public Access display name

* fix(s3): recognize scoped access point ARN in bucket policies

* fix(s3): honor ForAnyValue in public policy checks
2026-09-24 08:23:12 -04:00
lex00 72231c09cf feat(dynamodb): add the legacy global table operations (#4288)
* feat(dynamodb): add the 2017.11.29 global table operations

CreateGlobalTable, DescribeGlobalTable, UpdateGlobalTable and ListGlobalTables
were all UnknownOperationException, so a legacy global table could not be
created at all. The 2019.11.21 path through UpdateTable ReplicaUpdates already
worked, and these four now run on the same replica metadata.

Constraints come from the model. CreateGlobalTable builds on a table that
already exists, so an absent one is TableNotFoundException rather than the
item operations' ResourceNotFoundException, and a second create is
GlobalTableAlreadyExistsException. The one replica precondition a
single-process emulator can test is the stream, so a table joins only with
DynamoDB Streams enabled and a view type of NEW_AND_OLD_IMAGES.

DynamoDbIntegrationTest used CreateGlobalTable as its example of an
unsupported operation. It now uses DescribeGlobalTableSettings, which is still
unimplemented.

* fix(dynamodb): use the model's fault shapes on the global table surface

Two gaps on the new operations.

requireStreamWithBothImages raised InvalidParameterValue, which is not a
DynamoDB shape at all. Every other rejection in this file raises
ValidationException, seventy-six of them, so a client catching that one missed
this rejection alone. The test asserted only the status, never the code, which
is why nothing caught it.

UpdateGlobalTable delegated straight to applyReplicaUpdates, and that helper is
deliberately idempotent for UpdateTable and CloudFormation re-applies: a
duplicate add is skipped and an absent removal is a no-op. The model declares
ReplicaAlreadyExistsException and ReplicaNotFoundException for
UpdateGlobalTable and declares neither for UpdateTable, so sharing the path
dropped both. The membership check now lives in updateGlobalTable and the
helper keeps its idempotence.

Tests assert the codes rather than the status, cover both replica faults
including a re-add of the home region, and pin that UpdateTable still accepts
the same re-add.
2026-09-24 08:22:20 -04:00
XuJian 7cf8ab7d85 feat(ce): manage anomaly monitors and subscriptions (#4221)
* feat(ce): manage anomaly monitors and subscriptions

* fix(ce): return JSON objects for empty responses
2026-09-24 08:20:17 -04:00
Franklin G. Mendoza 196d1586da fix(codepipeline): retry failed stages in place (#3513) 2026-09-24 07:17:04 -04:00
Hector Ventura 836161e1ff feat(docker): own the floci-aws- container and volume prefix (#4273)
Every container and volume Floci creates was named floci-<service>-<id>. Every
Floci emulator shared that prefix, so two of them on one Docker daemon collided
on names, and docker volume prune --filter label=floci=true reached all of them
at once. Each emulator now owns a prefix of its own; this one uses floci-aws-,
and labels its resources floci_emulator=floci-aws.

Existing data is neither moved nor lost. Resources with a record (RDS, MSK,
OpenSearch, Amazon MQ, Kinesis Analytics savepoints, Timestream InfluxDB)
persist the volume name they were created with; records from before the field
existed are backfilled with the frozen legacy name so their data keeps
resolving. Volumes with no record (the ECR registry, EFS-backed task and Lambda
volumes) are found by probing the legacy name first. Containers are disposable
and always take the current name; the UI console and the ECR registry, which
survive shutdown and are adopted by name, are looked up under both prefixes so
an upgrade does not orphan one that still holds its host port. Stale-container
cleanup clears both names.

Scripts that name containers (docker exec floci-rds-<id>) must be updated, and
downgrading does not migrate back: a record written after the upgrade carries a
floci-aws- name an older build will not look for. Documented in storage.md.
2026-09-24 07:04:59 -04:00
Hector Ventura bfedf6c679 feat(batch): tag actions and one-lock teardown, wired into the CloudFormation provisioner (#4268)
Batch gains ListTagsForResource, TagResource and UntagResource (rest-json on
/v1/tags/{arn}, served by a BatchTagHandler under the shared V1Tags controller,
200 on success as the model declares no responseCode), and the compute
environment, job queue and job definition each get a teardown that deletes
under one lock and reports false when the resource is already gone (an
INACTIVE job definition revision counts as gone).

BatchCfnProvisioner deletes through those teardowns so DeleteStack and rollback
remove the backing resources instead of only forgetting them, and a JobQueue
update reconciles its tags in place. ProvisionContext.resolveTags now reads the
object form of Tags as well as the list form: Batch templates declare tags as a
map, which was silently dropped at create time.

Refs #2861
2026-09-24 07:04:27 -04:00
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
Simone Primarosa 766166fc35 feat(eks): set the cluster node providerID (#4255) 2026-09-23 22:45:07 -04:00
Hector Ventura 96264cde70 chore(build): make the native image build locally and give the Makefile a development workflow (#4271)
The Quarkus container build of the native binary failed on Apple Silicon with
GraalVM's BranchTargetOutOfBoundsException in a generated AwsQueryController
invoker (Quarkus 3.39 turns on -H:+AOTSingleCallsiteInline for Mandrel 25.0.4+),
and the packaged image died at startup because the builder links zlib
dynamically while ubi9-micro ships no libz.so.1. `make native` passes the same
flags CI does (-Ob,-H:-AOTSingleCallsiteInline), stages native/<arch>/ like the
workflow, and copies libz.so.1 from the builder image next to the binary, which
Dockerfile.native-package now puts on LD_LIBRARY_PATH.

The Makefile becomes the entry point for development: help (default), dev,
build, test T=, native (container build), native-host (host GraalVM/Mandrel,
adding the Mandrel-only flag when native-image reports Mandrel), run-native,
native-install (PREFIX, default ~/.local), native-image, native-up/native-down/
native-logs against a new docker/compose.native.yml overlay that carries the
five CI compat env vars, clean-sidecars, clean-volumes (a leftover ECR registry
volume is re-adopted on start and breaks the CDK bootstrap), compat SUITES= and
docker-tests. docker/run-docker-tests.sh gains FLOCI_START=0 and COMPAT_SUITES,
validated against the suite list, and its shell test covers both. Docs:
installation (native section rewritten), docker-images, CONTRIBUTING, AGENTS.
2026-09-23 22:35:24 -04: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 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 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
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
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
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
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
Aniket Shukla 97aa084209 fix(sns): require IAM role ARN for Firehose subscriptions (#4233) 2026-09-23 10:57:28 -04:00
Harsh Pashine 625bcb80d7 docs(ec2): document ten dispatched operations missing from action tables (#2605) (#3769)
* docs(ec2): document ten dispatched operations missing from action tables (#2605)

AttachVolume, DetachVolume, DescribeSnapshots, CreateFlowLogs,
DeleteFlowLogs, DescribeFlowLogs, RequestSpotInstances,
DescribeSpotInstanceRequests, CancelSpotInstanceRequests,
DescribeVpnGateways are dispatched by Ec2QueryHandler but had no rows
in docs/services/ec2.md. Adds the rows by hand with descriptions drawn
from the handlers; EC2 stays on the docs generator deferred_handlers
allowlist.

Fixes #2605

* docs(ec2): clarify DescribeVpnGateways returns an empty set
2026-09-23 10:25:31 -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 7c94f69571 feat(ec2): bound instance containers to their instance type resources (#4189) 2026-09-23 09:08:37 -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
Abhigya 8d9ae9554d fix(elbv2): dispatch a shared listener port by the hostnames rules declare (#4207)
* fix(elbv2): dispatch a shared listener port by the hostnames rules declare

Two load balancers with a listener on the same port both answered 502.
Floci serves every load balancer from one socket per port, and listener
selection keyed only on the load balancer's own DNS name, so a request
carrying any other Host header matched neither key. With one load balancer
a size-1 fallback covered that up; adding a second removed the fallback and
silently broke both.

Listener selection now also consults the host-header conditions the
listener's rules already declare. A load balancer that names the hostname it
serves, which is the configuration AWS needs anyway, claims that hostname
here too. The DNS-name match and the single-listener fallback are unchanged
and still take precedence in that order.

A port taken by a second load balancer now logs a warning naming both, since
nothing else reported the collision: the targets behind them stay healthy and
no API call fails.

Real AWS has no load-balancer selection step, because every load balancer has
its own DNS name and addresses; host-header rules only choose a rule inside
one listener. Selecting a listener by Host header is a Floci deviation forced
by the shared socket, and is documented as one.

* test(elbv2): pin the AWS host-header matching semantics selection relies on

The AWS docs state that a hostname is not case-sensitive, that * matches 0
or more characters and ? exactly 1, and that the rule *.example.com matches
test.example.com but not example.com. Listener selection now depends on that
matching, so cover it directly: a case-shifted Host still resolves, and a
wildcard rule does not let its listener claim the bare domain.

Also record that HostHeaderConfig.RegexValues is unsupported, so a load
balancer naming itself only through a regex cannot be selected this way.
2026-09-23 00:39:31 -05:00
Sergei Kesarev 51b6485173 feat(kms): support RSA imported key material (#4152)
* refactor(kms): encapsulate import key material logic in KmsKeyType implementations

* feat(kms): support RSA key import

* fix(kms): check aes key length

* fix(kms): wrapping algorithm value validation

* docs(kms): update docs to reflect asymmetric RSA import support

* fix(kms): add private CipherUtils constructor

* test(kms): add tests for rsa key material import
2026-09-23 00:21:50 -05:00
vamsiakandVamsi Akavarapu ffe56f735d feat(stepfunctions): route RDS Data execute statement (#4179)
Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-09-23 00:25:04 -04:00
XuJian 9dd2bd62e4 feat(kms): implement ReplicateKey for multi-region keys (#4176) 2026-09-23 00:21:23 -04:00
Kenshin Okinaka e947b6a2a1 feat(ses): add v2 GetMessageInsights (#4157)
* feat(ses): add v2 GetMessageInsights

Serves the per-recipient event timeline for a sent message. The timeline is
derived at send time from the events SesRecipientEvents classifies for the
send, the same classification that drives configuration-set event publishing
and identity notifications, then stored on the SentEmail record, so the read
path is a plain lookup and no new event store is needed. SentEmail also gains
the EmailTags the operation returns, and a raw send now stores its parsed MIME
subject, when present, as a simple send does.

Insights additionally report DELIVERY for an ordinary recipient so a plain
send does not look stuck at SEND; a suppressed recipient never gets DELIVERY,
since it is dropped before the relay, and a message the content scan rejected
ends every recipient's timeline at REJECT. What gets published is unchanged.

Probed against real SES in us-east-1: the operation is gated on Virtual
Deliverability Manager and reports that before it looks at the message id, a
missing message names the account alongside the id, Isp carries the literal
UNKNOWN_ISP when the provider cannot be identified, BounceType is the
upper-case enum member, and an account-suppressed recipient is reported with
BounceSubType ON_ACCOUNT_SUPPRESSION_LIST and SES's own suppression text as
the diagnostic, the upper snake spelling this operation uses where the
published events say OnAccountSuppressionList. Floci deliberately records the
mailbox-simulator sends and the multi-recipient mail that VDM drops, because
dropping both would leave insights permanently empty, and returns one entry
per envelope recipient where an AWS response carries at most one.

* test(ses): pin the message-insights VDM gate to one account

The gate reads the account VDM attributes, which are account-scoped like
every other SES store, but no test said so: the isolation test enables VDM
for both of its accounts. An account that never enabled it now has to meet
the gate while others in the same region are past it.

* feat(ses): report a content-rejected raw send in message insights

The raw send path classified its recipients with a hardcoded false, because
the content scan did not exist on this branch's base. It does now, so the
real scan result reaches the timeline: a rejected raw send reports SEND then
REJECT instead of a delivery it never had.

Its stored tags follow the same rule the published events already use, the
request's own tags only, so tags read off a refused message's headers cannot
resurface through GetMessageInsights.
2026-09-23 00:17:28 -04:00
Niels Kootstra a0cb86cc13 fix(cloudwatchlogs): journal log events instead of rewriting the store under persistent mode (#4187)
* perf(storage): append WAL batches once and skip compaction of an unchanged store

A putAll batch was N locked appends and N flushes; it is now one contiguous run of records and one flush. Compaction rewrote the snapshot on every tick even when nothing had changed since the last one, so an idle store kept rewriting its file; the store now tracks whether it changed and compaction returns early otherwise. Entries replayed from the log at load mark the store changed so the next compaction folds them in.

* fix(storage): recover from a corrupt WAL tail instead of failing boot

The replay reader trusted the signed length headers it read: a negative length threw IllegalArgumentException out of load() and failed the owning service at boot, and a length past the end of the file read to EOF. After any stop, the writer reopened behind the unreadable bytes, so every entry appended after a torn tail was lost on the next load until a compaction happened. Lengths are now bounded by the bytes left in the file, every framing or decode failure stops replay with a warning, and the unreadable tail is cut off before the writer reopens. An unreadable snapshot is quarantined to a .corrupt sibling like the other file-backed stores do, instead of being overwritten by the next compaction.

* fix(storage): journal append-heavy stores under persistent mode

PersistentStorage rewrites the whole store file on every mutation, so the cost of a write grows with the store. A store can now declare an APPEND_HEAVY write profile on StorageFactory.create; under persistent mode such a store is backed by WalStorage with the store's own JSON file as the snapshot and a .wal file next to it. The snapshot layout means an existing store file is picked up as the first snapshot and the file is current again after a clean shutdown, so no migration is needed in either direction. The other modes ignore the profile.

* fix(cloudwatchlogs): journal log events under persistent storage

Every PutLogEvents batch rewrote the whole cwlogs-events.json file under persistent mode, so the cost of one batch grew with the number of stored events. The events store now declares the APPEND_HEAVY write profile: a batch is appended to cwlogs-events.wal and the JSON file is rewritten on the WAL compaction interval and at shutdown. Groups, streams, filters and policies keep the file that is rewritten on every call.

Closes #2500

* docs(storage): describe journaled stores under persistent mode

Explain that CloudWatch Logs events are journaled to cwlogs-events.wal under persistent mode, that the compaction interval now governs that store too, and that the JSON file is current after a clean shutdown and up to one interval behind while running. Also corrects the documented CloudWatch Logs flush interval default from 5000 to 15000, which is what EmulatorConfig ships.

* docs(storage): describe journaled stores as append-heavy

The pages said the CloudWatch Logs event store only ever grows, but the 20,000-event cap, retention pruning and DeleteLogStream all remove events. What qualifies a store for journaling is its write pattern, which is what WriteProfile.APPEND_HEAVY says, so the pages now say that.
2026-09-23 00:08:45 -04:00
Abhigya fcc89c0e8d feat(ecs): implement ExecuteCommand (#4121)
* feat(ecs): implement ExecuteCommand

ECS Exec was accepted at the API but opened nothing: a client got a
response it could not connect to. This implements the whole path, so
`aws ecs execute-command` gives a real shell in a task's container.

The gate matches AWS. The session must be interactive, which is the only
mode ECS supports; the task must belong to the cluster the request
names, must be RUNNING and must have been run with enableExecuteCommand;
and the container must have a runtime behind it, so a mock-mode task
answers TargetNotConnectedException.

The response carries a session with a single-use tokenValue and a
streamUrl pointing at Floci's own data channel, which is where
session-manager-plugin then connects. Floci plays the SSM agent's half
of the Session Manager protocol on that channel, the binary AgentMessage
framing, the handshake, sequenced acknowledgements and terminal resizes,
and bridges it to a docker exec with a TTY.

Two threads meet on that channel. Every call into the Docker daemon
blocks, so it runs on a worker rather than on the event loop, and the
daemon streams the container's output back on its own thread; frames are
written from the channel's Vert.x context only, which also keeps the
outbound sequence numbers in the order they reach the wire. The command
is attached to only once the client has accepted the handshake, so no
output can be written to a channel that is still being opened.

Deliberate limits, documented in docs/services/ecs.md:

- The command runs through /bin/sh -c, so an image without a shell
  cannot be exec'd into.
- Sessions are in memory, single use, and expire after five minutes if
  nobody connects.
- ExecuteCommand logging, the executeCommandConfiguration that sends
  session transcripts to S3 or CloudWatch, is not implemented. The
  cluster field still round-trips.

EcsExecSessionRegistry holds a SecureRandom, so it is registered under
--initialize-at-run-time for the native image.

AgentMessageTest covers the wire framing against a JDK-side encode and
decode, EcsExecuteCommandIntegrationTest covers the API gate, and
EcsExecChannelDockerIntegrationTest runs a real session end to end under
Docker.

* fix(ecs): compare the ECS Exec session token in constant time

The token is the single gate in front of an interactive shell in a
container, so compare it with MessageDigest.isEqual on the UTF-8 bytes
rather than String.equals, which returns on the first differing
character. Matches the constant-time comparison the repo already does in
ScimController, IamAuthValidator and LambdaLayerService.

A failed claim still leaves the session in place: dropping it would let
anyone holding a session id cancel somebody else's session.

* fix(ecs): expire an unclaimed ECS Exec session on read

Only create() swept the session map, and neither claim() nor find()
looked at createdAt, so a session nobody connected to stayed claimable,
token included, until the next ExecuteCommand call happened to come in.
On an idle emulator that is forever, which also made the five minute
expiry documented in docs/services/ecs.md untrue.

claim() and find() now go through liveSession(), which drops a session
past SESSION_TTL and reports it as gone: claim() rejects it before the
token comparison, and the WebSocket upgrade refuses to open a channel
for it. The registry takes the CDI Clock so the tests exercise expiry
without waiting out the TTL.
2026-09-22 23:47:40 -04:00
Abhigya 899c6f5ec1 feat(ui): add a bind address for the web console sidecar (#4175)
The console sidecar is published with a bare host port, so Docker binds it on every
interface. That matches the documented deployment, where Floci's own port is published
the same way, but it does not follow an operator who narrowed theirs: a
"127.0.0.1:4566:4566" mapping keeps the API off the network while the console, which is
unauthenticated and can drive every emulated service, stays reachable on 4500.

floci.services.ui.bind-address (FLOCI_SERVICES_UI_BIND_ADDRESS) names the host interface
the console publishes on. It is unset by default, so nothing changes for anyone who has
not asked; setting it to 127.0.0.1 is how the narrowed deployment keeps the console where
the API is. A blank value is a hard error rather than a silent fall back to the wildcard.

ContainerBuilder.withPortBinding(containerPort, hostPort, hostIp) and a portBindingHostIps
component on ContainerSpec carry the address through to the Docker binding.
withLoopbackPortBinding is unchanged, and a port that asks for neither still publishes on
every interface, which is Docker's own default.
2026-09-22 23:33:14 -04:00
Allen Sanborn 684239b0ef fix(elasticache): create single-node redis clusters and close provisioning races (#3634)
* feat(elasticache): support single-node redis clusters in CreateCacheCluster

CreateCacheCluster refused every engine but memcached, telling callers to use
CreateReplicationGroup instead. Real AWS accepts Engine=redis and Engine=valkey
there as long as the cluster has one node, and that is exactly the call
terraform's aws_elasticache_cluster with engine = "redis" emits, so every such
example failed against Floci.

A single-node redis or valkey cluster is now provisioned the way a
cluster-mode-disabled replication group is: the same Valkey container, fronted by
the same auth proxy on a port from the same range, so the endpoint a describe
reports actually answers RESP. It is stored apart from replication groups, since
one created this way has none and must not appear in DescribeReplicationGroups.

NumCacheNodes greater than 1 is refused with the message a live account gives.
Following AWS, the cluster carries no ConfigurationEndpoint (that is memcached's
node discovery endpoint) and reports its node under CacheNodes when the request
sets ShowCacheNodeInfo, which is where terraform-provider-aws reads the port.

The memcached path is unchanged. ElastiCacheMemcachedIntegrationTest asserted the
old refusal with Engine=redis; it now asserts it with an engine ElastiCache
really does not have.

* fix(elasticache): address review findings

Cross-type id collision closed both directions through one provisioningIds
claim set (the claimed thing is one namespace: container name + proxy key);
wire code corrected to CacheClusterAlreadyExists; create request grown to
round-trip the optional members Terraform reads back, guarded by a
compat-terraform bats config asserting plan -detailed-exitcode after apply;
ListTagsForResource cluster arm brought to parity with the replicationgroup
arm without regressing memcached/member fall-through; standalone clusters
join getResources; create/delete responses no longer leak CacheNodes.

* fix(elasticache): correct review-round test assertion, bats port pin, docs note

The cross-type guard test asserted never() on a tryStart its own setup
legitimately performs — times(1), matching the sibling test. The single-node
bats config pinned port 6379, which the parallel bats runner's sibling
replication-group config fills first from the range base (the allocator
refuses rather than substitutes) — pinned to 6395. AtRestEncryptionEnabled
noted in docs as output-only on real AWS's CreateCacheCluster.

* docs(elasticache): the output-only note belongs to the single-node prose, not the CreateReplicationGroup row

AtRestEncryptionEnabled is a legitimate input member of
CreateReplicationGroupMessage; it is absent only from CreateCacheClusterMessage.

* fix(elasticache): reserve persisted ports on restore, cross-store id uniqueness, validate subnet group

Three findings from the PR review, all on the single-node cache cluster path.

Ports of records that survive a restart are now reserved before Floci serves
anything. Standalone cache clusters and cluster-mode-disabled replication groups
are not re-provisioned, but they still advertise the port they were given, and
nothing put those ports back into the in-use set: a create after a restart was
handed a port a live record still published, and the two then contended over one
reservation, so the first delete freed it and the next create took it again. A
delete now releases only a port this process actually reserved for that record,
since a restored record whose port was already taken advertises one it does not
own.

The id check spans all three stores that answer DescribeCacheClusters. A
standalone redis cluster, a Memcached cluster and a replication group can no
longer share an id in either direction. Both services read the same backends:
StorageFactory keys them by file path and hands the second caller the first
caller's instance, so no new wiring is needed for the two services to agree on
one namespace.

CacheSubnetGroupName must now name a subnet group that exists, instead of being
stored as a reference a describe reports and a caller cannot look up.
CreateReplicationGroup still does not make that check; it is called out in the
service and in the docs rather than changed here.

* style(elasticache): drop em dash in transient-field comment

* fix(elasticache): close the id and port gaps the delta review found

CreateReplicationGroup's duplicate-id check read only the group and redis
cluster stores, so a group could take the id of a live memcached cluster
while CreateCacheCluster refused the same collision the other way round.
Check the third store too, which is what makes the documented "an id is
taken across all three at once" actually hold.

Two port-reservation fixes alongside it. The claim on a new cache
cluster's port was recorded after the synchronized block that stores the
record, so a delete landing in the gap found nothing to release and
stranded the reservation; it now happens under the same monitor as the
put. And deleteReplicationGroup freed the group's port unconditionally,
while the cluster path has guarded that since the restore work went in: a
record restored from disk whose port was already taken advertises a port
it does not own, and freeing it hands a live record's port to the next
create. The holder set now covers both kinds, keyed by id, which is safe
because an id is unique across the stores.

* docs(elasticache): say which engines the subnet-group check covers

CreateCacheCluster with Engine=memcached routes to a create that takes
only the cluster id, so CacheSubnetGroupName is dropped on that path: not
checked, not echoed. The page claimed the check unqualified. Also name
CreateReplicationGroup in the id-uniqueness paragraph, now that it makes
the same check.

* test(elasticache): cover the ordinary group delete that frees its port

The two port tests around it both step past the create path: one deletes a
group written straight into the store, the other one restored after a
restart. So the claim recorded when a group is created in process had
nothing behind it, and dropping it would leave the suite green while every
DeleteReplicationGroup leaked its proxy port for the life of the process.

* fix(elasticache): claim the id on the memcached create path too

CreateCacheCluster for memcached checked the three stores for a duplicate id
and went straight on to start its container, without joining the in-flight
claim set the redis cluster and replication group paths take. No create path
persists its record until after container startup, so a memcached create and
a redis create for one id could both read three empty stores and both write,
leaving the id in two stores with DescribeCacheClusters reporting it twice
and the two containers and proxy registrations colliding under one name.

Move that set out of ElastiCacheService into an ElastiCacheProvisioningIds
bean both services inject, so the claim covers every engine, and take it in
the memcached path before the store checks with the same try/finally release.
A collision with an in-flight create is refused with the fault the store-hit
path already produces, CacheClusterAlreadyExistsFault.

* fix(elasticache): complete the CacheNode shape and correct the memcached fault code

DescribeCacheClusters returned a CacheNode carrying only an id, a status and an
endpoint. terraform-provider-aws dereferences CacheNodeCreateTime and
ParameterGroupStatus while adopting the resource without a nil check, so the
compat-terraform job created floci-tf-redis-single successfully and then died on
the very next refresh with "Unexpected nil pointer" naming both fields. The
endpoint was never the problem; the node shape was incomplete.

Both are stable metadata AWS returns on every available node, and both were
already known here: a single-node cluster's node was created with the cluster,
and its parameter group carries the same in-sync status already reported for the
cluster. CustomerAvailabilityZone is emitted from the cluster's AZ for the same
reason -- a node whose AZ disagrees with its cluster is a permanent plan diff.
Memcached returns early well above this block, so its wire output is unchanged.

Separately, the id claim added on the memcached create path threw
CacheClusterAlreadyExistsFault. The wire code is CacheClusterAlreadyExists -- the
Fault suffix is the botocore shape name, not the code an SDK matches on -- which
this branch had already established on the redis side and then contradicted.
Both memcached throw sites now use the wire code, including the pre-existing one,
and the five test assertions that pinned the wrong spelling are corrected.

* test(elasticache): stop the single-node fixture pinning the shared suite's port

The compat-terraform job runs every stack against one Floci, and this branch's
new elasticache-single-node-tf pinned port 6395 -- the same port main.tf already
pins for the replication group the `terraform` suite creates. ElastiCache
refuses a pinned port that is already reserved, by design, so the two stacks can
only both succeed if the first is fully destroyed before the second applies.

That is what the last run showed: elasticache_single_node failed its apply, so
its destroy never ran, 6395 stayed held, and the `terraform` suite then failed
with "Port 6395 is already in use by another replication group" -- a second
failure that reads like an allocator bug and is really a fixture collision.
Fixing the node shape removes the trigger but not the collision, which would
remain a teardown-ordering dependency between two independent suites.

6396 is free and inside the 6379-6399 proxy range.

* test(elasticache): name the extracted XmlPath instead of inferring it with var

Review follow-up: this was the only `var` in the file, and the type it hides
(io.restassured.path.xml.XmlPath) is the one a reader needs in order to follow
the getString/getInt calls immediately below it.

No behaviour change.

* style(test): import ArrayList and LinkedHashMap instead of naming them inline

AGENTS.md asks for imports rather than inline fully-qualified names.
ElastiCacheQueryHandlerTest had three: new java.util.ArrayList<>(...) and
two new java.util.LinkedHashMap<>(...). LinkedHashMap was already imported;
ArrayList is added.
2026-09-22 22:26:15 -04:00