Commit Graph
796 Commits
Author SHA1 Message Date
vamsiakandVamsi Akavarapu 1abc817c5d fix(stepfunctions): serialize Scheduler target input (#4168)
Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-09-22 15:45:58 -04:00
Niels Kootstra 3cf6c76811 fix(rds-data): reject invalid secret credentials (#3759)
Return AWS-compatible errors for secret retrieval and invalid credentials,
without falling back to master credentials, with focused coverage.
2026-09-22 15:01:41 -04:00
Simone Primarosa 10eeafad69 feat(ec2): add an arm64 Amazon Linux 2023 image catalog entry (#4163)
Add an arm64 Amazon Linux 2023 entry to the EC2 image catalog paired
with the existing x86_64 image. The new entry provides the official
AWS GA arm64 AMI name and public SSM parameter paths under
/aws/service/ami-amazon-linux-latest/.
2026-09-22 14:49:05 -04:00
Anders Wasen 27633bf94d feat(appsync): execute APPSYNC_JS resolvers via a Node sidecar (#3422)
* feat(appsync): execute APPSYNC_JS resolvers via a Node sidecar

A field with a resolver resolved to null: no data fetchers were registered, so graphql-java
fell through to its property fetcher on an empty root. This runs the resolver instead, for
UNIT and PIPELINE alike, over NONE, AWS_LAMBDA, RELATIONAL_DATABASE and AMAZON_DYNAMODB data
sources.

Resolver JavaScript runs in a Node sidecar container rather than in process. Floci's published
image is a Mandrel native executable, which carries no Truffle languages, so there is no
in-process JavaScript to embed; running real Node also means a bundle executes as written, ES
modules and all. @aws-appsync/utils is a shim the sidecar writes at boot rather than the
published package, so a resolver call never depends on npm being reachable.

The pipeline follows AppSync's: ctx.stash threads through every stage, each stage sees the last
as ctx.prev.result, runtime.earlyReturn stops everything, util.error fails the field with the
type the resolver chose, and util.appendError returns its errors beside the data. A data source
failure does not fail the field on its own: the stage's response() handler is called with
ctx.error set and decides whether to re-raise or suppress, which is why resolvers carry an
explicit if (ctx.error) branch.

VTL mapping templates are not executed. A VTL stage fails its field saying so rather than
resolving to null, since a null that means "not implemented" is indistinguishable from a null
that means "no rows".

Carries model/FunctionConfiguration and AppSyncService so it builds and tests standalone; both
are identical to the copies in the AppSync CloudFormation change and collapse on merge.

* feat(appsync): enforce the APPSYNC_JS subset before evaluating resolver code

The sidecar is real Node, so it accepted JavaScript AWS rejects: async functions, promises,
classes, try/catch, while loops, this, and imports of Node builtins. For an emulator that is
the worst failure available, since a local run green-lights resolver code that cannot deploy.

Imports are restricted by a module resolve hook rather than a source scan, so a dynamic import
of a builtin cannot slip past either. An async handler is caught before it runs and a handler
returning a promise after. The remaining constructs are found by scanning the source with
comments, strings and template text blanked first, so the same keywords inside them are not
flagged. A rejected resolver fails its field with errorType UnsupportedFeature and the line.

Enforcement is on by default and can be turned off with
floci.services.appsync.js-runtime.enforce-appsync-subset, which exists only so a false positive
cannot block someone whose code AWS does accept.

Checking real resolvers against it found a gap of the same kind in the other direction:
@aws-appsync/utils/dynamodb is a real module the shim did not provide, so valid code was being
rejected. It now implements get, put and remove; the helpers that compile a condition or update
expression throw by name rather than returning something the data source would mishandle.

Also from review: cap the /evaluate request body, keep integer precision in the DynamoDB NS
branch as the N branch already did, reject two SQL parameters bound to the same name instead of
letting the Data API report it, drop the container id and close the log follower in reset(), and
bound the docker probe in the integration test so an unresponsive daemon cannot hang CI.

* feat(appsync): add the js-runtime url knob and stop the sidecar through ContainerTeardown

Follows the sidecar contract the other managed containers use. floci.services.appsync.
js-runtime.url points the runtime at a Node server that is already running, in which case
ensureStarted skips container management entirely: nothing is created, adopted or stopped, and
the URL is probed with the short adopt budget so a wrong one says so instead of holding the
first resolver for the full start timeout. Same shape and meaning as floci.services.duck.url.

NodeAppSyncJsRuntime now implements ContainerTeardown, so EmulatorLifecycle stops the sidecar
with the other process-bound containers at a deterministic point rather than only through
@PreDestroy, which the interface documents as running too late for the final storage flush.
Teardown is a no-op for a pre-configured URL, since that server is not ours to stop.

* fix(appsync): serialize reset() and stop the sidecar it gives up on

reset() touched started, baseUrl, containerId and logStream without holding the monitor that
ensureStarted() and stopManagedContainers() both take. A failed evaluation could therefore clear
those fields in the window after a container had been created and its id recorded but before
started was set, dropping the only handle to a live container: teardown then saw a null id,
treated the sidecar as never started, and the container was leaked rather than stopped.

reset() is now synchronized on the same monitor, and reentrant so the callers already holding it
are unaffected. The failure path in post() goes through discardSidecar(), which stops and removes
the container before clearing the fields instead of forgetting it, since forgetting is what leaks:
nothing else holds the id. A pre-configured url owns no container, so teardown there stays a no-op.

The regression races eight failing evaluations against startup and asserts every container the
runtime created was also stopped. It needs a transport-level failure to reach the path: a 500 is
rethrown as an AwsException before it, so the stub drops the connection instead. Against the
previous reset() it fails with expected <[container-1]> but was <[]>.

* refactor(appsync): run resolvers through the GraphQL sidecar callback

out of Floci, which left this branch building DataFetchers for a schema that no
longer has any. Resolver execution moves onto the sidecar's batched resolver
callback instead, so the engine stays in the sidecar and the resolvers, the data
sources and the Node runtime stay here.

/v1/execute now carries a resolve block naming every planned coordinate that has
a resolver, with a callback URL and a token minted for that one operation. The
sidecar batches each execution level into one POST /appsync-resolve, which runs
the field's resolver and answers with a value or an error. denyFields still win,
so a denied coordinate is never listed and never reaches a resolver, and the
token stops working as soon as the operation returns.

AppSyncResolverExecutor takes a ResolverInvocation record instead of a
DataFetchingEnvironment. Every value it read off the environment is on the
record, so the pipeline, the data source invokers and the JS runtime are
unchanged. ResolverDataFetcher is gone: fields with no resolver are the sidecar's
own property fetcher again, and a resolver that disappears mid-operation falls
back to the source property rather than failing.

One AppSync behaviour does not fit the callback response, which carries a value
or an error per field and never both. util.appendError means report this and
keep the data, so those errors come back on the operation's session and are
merged into the response envelope, which keeps data and appended errors together
as AppSync returns them.

Also gives the sidecar container host.docker.internal on Linux, since it now has
to reach Floci back, moves the JS runtime image pin into application.yml so CI
prefetches it the way it does the sidecar pins, and puts the Docker integration
test on the shared AppSyncGraphqlSidecarProfile so it is namespaced and gated
like the other AppSync integration tests.

* ci(appsync): prefetch the Node image only on the shard that starts it

The js-runtime prefetch matched /appsync/, so all four shards pulled
node:22-alpine although only the shard carrying
AppSyncJsResolverDockerIntegrationTest starts that container. Every other test
in the package is a unit test. Matching the class name instead is three fewer
Docker Hub pulls per run, which is what this script exists to avoid.

* fix(appsync): keep null arguments and move the resolver callback under _floci

Two review points from #3422.

ResolverInvocation copied arguments and variables with Map.copyOf, which rejects
a null value, so getMessages(nextToken: null) threw out of the callback and
answered 500. That failed every field in the batch, not only the field carrying
the null. Both copies are now null tolerant, and an explicit null stays
distinguishable from an absent argument: it is present in ctx.args and null,
where an absent one is not there at all.

The callback moves from /appsync-resolve to /_floci/appsync/resolve, with the
EKS webhooks. A bare path is reachable as a path-style S3 request for a bucket
of that name, and an S3 bucket name cannot begin with an underscore, so the
prefix cannot be shadowed.

The null case is covered both ways: a unit test in ResolverCallbackResourceTest
that fails with a NullPointerException against the previous code, and three
queries in the Docker round trip covering an explicit null, its value reaching
ctx.args, and an absent argument for contrast.
2026-09-22 14:41:55 -04:00
Kenshin Okinaka 235ee91a76 feat(ses): scan raw sends for the EICAR test file and keep it out of the mailbox store (#4156)
* feat(ses): scan raw sends for the EICAR test file and keep it out of the mailbox store

The content scan now covers raw sends: the wire bytes are searched for the
plain and the base64-encoded signature before parsing, so a message the
lenient MIME parser cannot walk is still caught, and the parsed message is
walked part by part, decoding attachments, descending into forwarded
messages and decoding RFC 2047 header words. A candidate found on the wire
is confirmed by decoding the run around it, so a base64 near-miss of the
signature is not rejected.

A rejected record keeps only its source, its envelope and RejectReason;
subject, headers, reply-to addresses, bodies and raw data are dropped, and
the inspection endpoint lists it in neither the Simple nor the raw shape, so
the signature never reaches the mailbox store on disk. A MIME parse failure
logs the exception class only, since the message text could echo content.

* test(ses): pin that a rejected raw send publishes no parsed subject

The raw rejection test checked the header block and the recipient lists but
read commonHeaders only for the recipients, so a subject leaking back into
the event would have gone unnoticed.
2026-09-22 14:12:02 -04:00
Simone Primarosa 90d8c355d9 fix(eks): validate the node group launchTemplate against EC2 on CreateNodegroup (#4148)
Validate node group launchTemplate specifications against EC2 during
CreateNodegroup. Reject requests where neither or both of id and name
are supplied, or where the referenced launch template or version does
not resolve in EC2, with InvalidParameterException (400). Resolve
launch templates and construct nodegroup ARNs using the cluster's region
rather than the default region.
2026-09-22 14:06:04 -04:00
Daniël van Ziel 00cfcef8f9 fix(stepfunctions): honor Wait Timestamp and TimestampPath (#4099) 2026-09-22 13:42:52 -04:00
Daniël van Ziel 8e6faffcaf fix(kinesis): paginate ListShards with an opaque NextToken (#4098) 2026-09-22 13:38:28 -04:00
Chiara Forresi e8b03538e6 feat(glue): add security configuration CRUD (#3870)
* feat(glue): add security configuration CRUD

Implement AWS Glue security configuration create, get, list, and delete operations with encrypted configuration round trips, account and region isolation, persistence, and integration coverage.

* fix(glue): close catalog encryption handler case

Close the PutDataCatalogEncryptionSettings switch arm so the merged security configuration cases compile.

* test(glue): cover empty security configuration lists

Restore coverage for the empty GetSecurityConfigurations response and keep the test setup aligned with the rebased GlueService constructor.

* refactor(glue): name security configuration length limit

Use a named constant for the documented 255-character security configuration name limit.

* fix(glue): serialize security configuration timestamps
2026-09-22 13:21:15 -04:00
Simone Primarosa f5c63ff398 feat(eks): deliver audit logs from the cluster API server (#4146) 2026-09-22 09:21:54 -04:00
luiseterc df68eebaef feat(ec2): support an external image catalog (#4144) 2026-09-22 09:09:42 -04:00
Priamo Germosen 0524d156d4 feat(codeartifact): serve the maven format through a real Reposilite-backed proxy (#4059)
GetRepositoryEndpoint for format=maven now returns a URL real Maven clients
(mvn deploy, mvn dependency:get, Gradle) can publish to and resolve from
directly, backed by a shared Reposilite sidecar container started lazily on
first use. A CodeArtifact repository maps to its own Reposilite repository,
provisioned automatically and never reused even across delete/recreate of a
same-named repository, so a fresh repository can never inherit a previous
one's artifacts.

Adds GetAuthorizationToken (a token scoped to a domain, with the 900-43200s
custom range; 0 falls back to 12 hours) and requires it on every Maven proxy
request, either as the password of HTTP Basic credentials, the form AWS's
Maven guide configures with username aws, or as a Bearer token. Maven
requests are not SigV4-signed, so the region and account come from the token.

Also enforces AWS's 5 GB asset size quota on the Maven endpoint, matching the
existing PublishPackageVersion check. Artifacts do not survive a Floci
restart; the service page documents this as a known limitation.
2026-09-22 07:42:05 -05:00
Priamo Germosen 06007deea8 fix(cognito): default ExplicitAuthFlows to refresh, SRP and custom auth (#4081)
A user pool client created without ExplicitAuthFlows was treated as allowing every auth flow, where AWS defaults such a client to ALLOW_REFRESH_TOKEN_AUTH, ALLOW_USER_SRP_AUTH and ALLOW_CUSTOM_AUTH. USER_PASSWORD_AUTH against a no-list client succeeded on Floci and is refused on AWS.

Apply that default at auth time, in the existing gate added by #3974. CreateUserPoolClient, UpdateUserPoolClient and DescribeUserPoolClient keep storing and returning exactly what was normalized, empty when unset, matching AWS: Terraform's Cognito acceptance tests confirm the empty read-back for both an omitted list and an explicit empty one, and materialising the default into storage would fail Terraform apply with an inconsistent-result error.

Tests and compatibility fixtures that created a no-list client and then signed in with a flow outside the default now enable that flow on their client.
2026-09-22 07:41:58 -05:00
Priamo Germosen 2f5aa99701 feat(iam): add ListInstanceProfileTags (#4140)
TagInstanceProfile and UntagInstanceProfile already existed; the read side
was missing. Mirrors ListUserTags's response shape, and sorts the result
by tag key to match the documented AWS behavior.

Also adds the instance-profile tag actions to AwsQueryController's
IAM_ACTIONS fallback set, completing the Tag/Untag/List triple already
present there for users, roles and policies.

Covers the trio in the SDK compatibility suite (compatibility-tests),
which previously had no instance-profile tagging coverage.
2026-09-22 07:38:45 -05:00
Priamo Germosen 83ae2b4697 fix(lambda): mount hot-reload read-only and refuse Docker socket directories (#4154)
Bind-mount the hot-reload host directory at /var/task read-only, as /var/task is in AWS Lambda, and, when no allow-list is set, refuse the host root, /var, /proc, and anything under /run or /var/run, where the Docker socket lives or can be reached. Move the no-allow-list warning onto StartupEvent, beside NetworkExposureGuard, so it reaches an operator who has not called Lambda yet.
2026-09-22 07:38:20 -05:00
Abhigya 7cd441231f feat(ecs): serve the task metadata endpoint v4 (#4120)
An application in an ECS task, the AWS SDK integrations that read task
identity, and the aws-for-fluent-bit init process all expect
ECS_CONTAINER_METADATA_URI_V4 to resolve. Under Floci it was never set,
so any of them fell back or failed.

AWS serves the endpoint on the link-local address 169.254.170.2, which a
local container cannot be given. Floci serves the same paths on its own
port instead: clients read the environment variable rather than the
address, so nothing has to know the difference.

The id is minted per container before the container is created, the way
the ECS agent mints one, because the container's own environment has to
carry the URI and so it cannot be derived from the Docker id the daemon
returns afterwards. EcsService.findByMetadataId resolves an id back to
its container and task.

The task document carries Cluster, TaskARN, Family, Revision, the
statuses, Limits in vCPUs, the pull timestamps, AvailabilityZone,
LaunchType, ServiceName for a service's task, VPCID for an EC2 task,
and, on Fargate, ClockDrift and EphemeralStorageMetrics. Floci has no
clock drift and does not meter the disk, so those report a synchronized
clock and zero usage. An awsvpc container's Networks object describes
the task ENI and the subnet it sits in; a local ENI has no DHCP option
set behind it, so the gateway, the resolver and the search domain are
derived the way a real VPC assigns them.

The stats paths read the daemon when the request arrives and return
Docker's own ContainerStats document, plus the network_rate_stats the
agent adds. Docker reports cumulative counters only, so the rates are a
delta across two consecutive samples, which is also why AWS documents a
container as having to run for about a second before its stats appear. A
container with no running Docker container behind it reports an empty
document rather than an error.

Because that pair costs a collection tick, task/stats samples the task's
containers in one pass: every stream is opened before any of them is
waited on, and the waits share one deadline. A sidecar polls that path
for network metrics, so the response has to cost about one tick however
many containers the task has, not one tick per container.
2026-09-22 08:18:55 -04:00
Matheus André 93f8d1421a fix(wafv2): enforce the 50-tag limit and key/value constraints on tags (#4118)
TagResource, UntagResource and the Create* operations accepted any number
of tags with keys and values of any length. Match the AWS WAFv2 contract:
at most 50 tags per resource (WAFLimitsExceededException), keys of 1-128
and values of up to 256 characters restricted to the documented character
set (WAFInvalidParameterException with Field/Parameter/Reason).

Closes #4035
2026-09-22 08:07:29 -04:00
lex00 28ca34ad6c fix(cloudformation): apply an S3 bucket's declared configuration and its policy (#3950)
S3CfnProvisioner translated CorsConfiguration and VersioningConfiguration
and nothing else, and AWS::S3::BucketPolicy took a physical id and stopped,
so a stack reported CREATE_COMPLETE for a bucket with no lifecycle, no
public-access block, no default encryption, no tags and no policy.

PublicAccessBlockConfiguration, LifecycleConfiguration, BucketEncryption
and Tags are now translated into the XML their S3 API calls take and handed
to the same service methods, so they are validated and stored exactly as a
direct PutBucket* would be. The policy document has its intrinsics resolved
and is put on the bucket.

The policy's physical id is the bucket name, as the registry schema's
primaryIdentifier declares, and deleting the resource removes the policy,
tolerating a bucket the stack already deleted. The class javadoc names the
properties that are covered and those still dropped.

Closes #3947
2026-09-21 22:27:54 -05:00
Priamo Germosen 7f5336e2dc docs(iam): document dispatched actions missing from the service page (#4074)
CreateSAMLProvider, GetSAMLProvider, ListSAMLProviders, TagInstanceProfile,
UntagInstanceProfile, the Organizations root-access actions, and the
ListMFADevices/ListServerCertificates stubs are dispatched by IamQueryHandler
but were not listed. Also correct the GetAccountSummary note: Providers counts
OIDC providers only, so it is no longer described as zero for OIDC.
2026-09-21 21:54:16 -05:00
Simone Primarosa 8dcdf7b911 feat(eks): serve pod identity credentials on 169.254.170.23 (#4124)
* feat(eks): serve pod identity credentials on 169.254.170.23

* fix(eks): safely handle cluster arn and initialize test cluster in pod identity integration test

* test(eks): configure fixed test port for pod identity docker integration test

* fix(eks): isolate pod routing and restore webhook timeout
2026-09-21 22:07:50 -04:00
Simone Primarosa d5b7b7f676 feat(eks): deliver control plane logs to CloudWatch Logs (#4111) 2026-09-21 21:24:09 -04:00
Kenshin Okinaka d272cd3ceb fix(ses): publish a Bounce for suppressionlist@simulator and split events by cause (#4073)
* fix(ses): publish a Bounce for suppressionlist@simulator and split events by cause

suppressionlist@simulator.amazonses.com published a Reject event. Real SES
publishes a hard Bounce for it: bounceType Permanent, bounceSubType General,
and a diagnostic that names the suppression. Reject is the outcome of the
content scan, which the simulator has no address for. Verified against SES
in us-east-1 on 2026-09-21 through an SNS event destination.

The same probe confirmed that a recipient on the account-level suppression
list bounces with bounceSubType OnAccountSuppressionList, or is complained
about with complaintSubType OnAccountSuppressionList, and that SES publishes
one event per cause: a message reaching both bounce@simulator and a
suppressed address produces two Bounce events, each listing only its own
recipients. Floci merged them into one General bounce.

One classifier, SesRecipientEvents, now decides the events a send produces
per recipient, and the publisher and identity notifications consume its
output, so the simulator and suppression semantics have a single home.
complaint@simulator now publishes Delivery before Complaint, as the
simulator documents, a list-management opt-out bounces under its own cause,
every bounce and complaint block carries its own feedbackId, and complaints
carry arrivalDate.

Reject stays reachable the way AWS documents it: a Simple send carrying the
EICAR test file in its subject, a header or a text body is accepted and then
rejected with reason "Bad content" and not relayed. The signature is
assembled from fragments at runtime and never appears in source. Scanning
raw MIME and keeping the signature out of the mailbox store follow
separately.

* fix(ses): drop the content of a rejected record

A send the content scan rejected was still recorded in full, so its subject,
body and headers reached the sent-email store, the inspection endpoint and,
with persistence on, the disk. The record now keeps only its source, its
envelope and RejectReason, and the inspection endpoint shows the reason.

* fix(ses): keep the scanned content out of a rejected message's events

The Send and Reject events of a rejected message carried the subject and
the additional headers in their mail block, so with headers enabled a
subject carrying the test string reached every event destination and, with
persistence on, the disk. Both events now carry the envelope but no subject
and no headers, a small deviation from SES that keeps the string off disk
entirely; the docs say so.
2026-09-21 21:15:52 -04:00
Vũ Thế Huy ccb6b63d00 feat(sns): deliver published messages to firehose subscriptions (#4079)
Deliver published messages to Firehose delivery stream subscriptions (sns:Publish -> firehose:PutRecord). Support RawMessageDelivery attribute to switch between raw payload and JSON envelope. Tolerates subscriber delivery errors without failing publisher.

Closes #4068
2026-09-21 21:12:23 -04:00
Simone Primarosa d8239b3e66 feat(eks): inject pod identity credentials through a mutating webhook (#4110)
* feat(eks): inject pod identity credentials through a mutating webhook

Each real-mode cluster gets a MutatingWebhookConfiguration in its k3s
server manifests directory, scoped to pod CREATE and pointing at a
per-cluster, per-account Floci endpoint. On a pod create Floci looks up
an association matching the pod's namespace and service account name
and, when the eks-pod-identity-agent addon is installed, returns a
JSONPatch carrying the projected token volume, the mount and the two
container credentials environment variables, the same shape real EKS
injects. A pod that matches nothing is admitted unchanged.

The webhook carries failurePolicy: Ignore and every path through the
admission handler admits the pod, including a malformed review and an
internal error, so it can never block a pod from being created.
Kubernetes only accepts an https webhook URL with a caBundle it trusts,
so registration needs floci.tls.enabled; with TLS off the cluster starts
with a warning and pods are not mutated. A failed registration logs and
leaves the cluster running.

Nothing answers http://169.254.170.23/v1/credentials yet, so an injected
pod still cannot obtain credentials.

* fix(eks): default the pod identity webhook off until the credential endpoint exists

Injecting AWS_CONTAINER_CREDENTIALS_FULL_URI sends the SDK down the
container credentials path, and nothing answers that URI yet, so a
workload that was picking up credentials earlier in the chain loses
them. On by default that is a regression for anyone already recording
associations, in exchange for a capability that cannot work. Turning it
off also takes the per-cluster warning off a default install.

The webhook timeout drops from the Kubernetes default of 10 seconds to
3. Floci is a local process, so a healthy call takes milliseconds and
the timeout only runs down when Floci is unreachable, which every pod
creation in the cluster pays for.
2026-09-21 19:58:05 -04:00
Abhigya 14d13ee798 fix(elasticache): re-provision caches on restart instead of reporting a dead endpoint as available (#4094)
* fix(elasticache): re-provision caches on restart instead of reporting a dead endpoint as available

Only cluster-mode replication groups were re-provisioned on boot.
Cluster-mode-disabled groups and Memcached clusters were deliberately out
of scope, so a restart removed their containers (EmulatorLifecycle stops
and removes them on ShutdownEvent) and nothing brought them back, while
the persisted record kept its `available` status: the control plane
answered healthy with nothing behind the endpoint, and every connection
failed.

The proxy port made it worse. `usedPorts` is process-local and was only
re-reserved inside the cluster-mode branch, so a restarted group's
advertised port was free for the next create to take, pointing the old
endpoint at an unrelated cache rather than failing cleanly.

Restore now covers every record, mirroring the create path for the shape
it restores: the container and auth proxy come back for a
cluster-mode-disabled group, the container for a Memcached cluster. Ports
are reserved and records marked `creating` synchronously, before anything
can be served; the container work runs in the background so a slow Docker
daemon cannot delay readiness. A record whose data plane cannot come back
is reported `create-failed` (`restore-failed` for a cache cluster, the
value AWS models there) with no endpoint, and its port is released.

No reachable Docker daemon stays the documented degraded mode rather than
a failure: the record keeps its metadata and reports available without a
container, as it does on create.

CacheClusterStatus gains RESTORE_FAILED and a wireName(), matching
ReplicationGroupStatus. Both are values AWS models: CacheClusterStatus is
one of available, creating, deleted, deleting, incompatible-network,
modifying, rebooting cluster nodes, restore-failed or snapshotting, and
ReplicationGroup Status is one of creating, available, modifying,
deleting, create-failed or snapshotting.

* fix(elasticache): take the group monitor before a restore writes back

Restore ran its data-plane work and its write-back outside the per-record
monitor `deleteReplicationGroup` takes, so a delete that arrived in the
first seconds after boot, while the record was still `creating`, could be
undone: the delete removed the record and released its port, then the
restore finished starting the container and proxy and put the record back
as `available`. The group the caller was told had been deleted came back,
with a live cache behind it. `deleteCacheCluster` took no monitor at all,
so Memcached had the same race with nothing to synchronize against.

The container work still runs outside the monitor, as it does on create: a
restore that may pull an image must not hold a delete behind it. Only the
write-back takes the monitor, and it re-reads the record first. A record
that is gone, or has become `deleting`, is not written back; the container
the attempt started is stopped, and the port is left alone because the
delete that removed the record released it already. Releasing it a second
time would return a port a later create had since taken to the pool.

The same guard covers the failure paths: a restore that fails for a record
deleted meanwhile tears down but reports nothing, rather than resurrecting
the record as `create-failed`.

`ElastiCacheMemcachedService` gains the per-cluster monitor
`ElastiCacheService` already had, taken by `deleteCacheCluster` and the
restore write-back.
2026-09-21 19:47:09 -04:00
Allen Sanborn 532bae5525 feat(dms): add replication subnet group lifecycle and tagging (#3630)
* feat(dms): add replication subnet group lifecycle

AWS DMS was entirely absent, so every terraform-aws-data-storage example
using aws_dms_replication_subnet_group failed at plan with
UnknownOperationException.

Adds a minimal dms service on AWS JSON 1.1 (X-Amz-Target prefix
AmazonDMSv20160101.) implementing CreateReplicationSubnetGroup,
DescribeReplicationSubnetGroups and DeleteReplicationSubnetGroup.
Subnets are resolved against the emulated EC2 service, so the VpcId and
Availability Zones a group reports are the ones its subnets actually
have, and AWS's own rules are enforced: the identifier is stored
lowercase, "default" is reserved, subnets must share a VPC, and a group
must cover at least two Availability Zones.

Tagging actions and replication instances, endpoints and tasks are out
of scope and still report UnknownOperationException.

* feat(dms): add resource tagging for replication subnet groups

Terraform's aws_dms_replication_subnet_group reads tags back through
ListTagsForResource, so without the tagging trio the resource could be
created but never read cleanly.

Adds ListTagsForResource, AddTagsToResource and RemoveTagsFromResource,
and stores the Tags member of CreateReplicationSubnetGroup with the
group. DMS does not return a subnet group ARN from describe, so the
provider builds arn:aws:dms:<region>:<account>:subgrp:<id> client side;
Floci parses that form back to the stored group and rejects anything
else, including another account's ARN, with ResourceNotFoundFault.

* fix(dms): address review findings

Emit IsReadOnly on ReplicationSubnetGroup, the one member of the model's
seven the response was missing. It is always false: a read-only group is
one DMS manages for a zero-ETL integration, which Floci does not emulate.

Fault a cross-Region ARN the way a cross-account one already faulted.
Storage is keyed by the caller's Region, so honouring an eu-west-1 ARN
from a us-east-1 caller silently reached the caller's own group of that
name rather than the one named.

Reject a subnet with no Availability Zone as InvalidSubnet. Set.copyOf
rejects nulls, so such a subnet raised a NullPointerException and
surfaced as a 500 instead of a client error.

Adds the user-realistic minimum-AZ case: two subnets sharing one AZ,
which the previous tests did not cover because they passed one subnet.

* fix(dms): reject wrongly-typed tag, filter and arn-list members

A present member of the wrong JSON type was coerced rather than
rejected. asText() on an object yields the empty string, so a tag whose
Value was an object stored an empty value and reported success; a
Filters or ResourceArnList member that was not a list was ignored
outright, which turned a filtered describe into an unfiltered one.

Every string member now answers SerializationException when it is
present with another JSON type, matching what AWS returns when a
json-1.1 member will not deserialize, and matching how Kinesis, Cognito
and KMS already report the same class of error here. An absent member
stays a parameter error: missing and mistyped are different faults.

* fix(dms): paginate DescribeReplicationSubnetGroups and validate the description

DescribeReplicationSubnetGroups returned every matching group in one response and
ignored both MaxRecords and Marker, so an SDK or Terraform paginator diverged from a
live account as soon as more than one page of groups existed.

Page through the shared opaque-cursor helper, keyed on the group identifier, so a
Marker stays resumable across groups created or deleted between requests. MaxRecords
defaults to 100 and is rejected outside the documented 20 to 100 range rather than
clamped, with the InvalidParameterValueException a live account answers. Marker is
emitted only while a further page remains: an SDK paginator treats any Marker as "ask
again", so one on the final page loops forever.

ReplicationSubnetGroupDescription now also enforces the model's printable-character
constraint, so a value carrying a control character such as 0x01 is rejected instead
of persisted.

* docs(dms): describe the Marker as the opaque cursor it is

* fix(test): DmsTest must compile at the sdk-test-java module's Java 17 target

List.getFirst() is a Java 21 SequencedCollection method. The main project
compiles at 21, but compatibility-tests/sdk-test-java pins source/target 17, and
DmsTest was the only file in that module using getFirst() -- so the native arm64
sdk-test-java image failed to build and every test in it was skipped.

This was not caught earlier because the previous head of this PR had no CI
rollup at all; the merge that made the branch mergeable is what first ran the
job. Replaced with get(0), which is what the rest of the module uses.

* style(test): import Objects and Collectors instead of naming them inline

AGENTS.md asks for imports rather than inline fully-qualified names.
DmsServiceTest had two: java.util.Objects::nonNull and
java.util.stream.Collectors.toMap. Neither was imported; both now are.
2026-09-21 19:45:01 -04:00
lex00 09b1dc0803 fix(iam): resolve s3:ExistingObjectTag and s3:RequestObjectTag under enforcement (#3946)
* fix(iam): resolve s3:ExistingObjectTag and s3:RequestObjectTag under enforcement

The S3 condition context was built for s3:ListBucket and the bucket-tagging
actions only, so a statement conditioned on an object tag never matched and
a tag-conditioned allow denied everything, including what AWS allows.

Object reads are now given s3:ExistingObjectTag/<key> from the object's
tags, PutObject is given s3:RequestObjectTag/<key> from x-amz-tagging, and
PutObjectTagging both. Which action gets which key follows what real AWS
was measured to do rather than what reads naturally: s3:DeleteObject is
given neither, and s3:PutObject never sees the tags of an object it is
about to overwrite.

A PutObject carrying If-Match is additionally authorized as s3:GetObject
with the object tags stripped from the context, as measured: under a
tag-conditioned GetObject allow the conditional write is denied, under a
prefix-scoped one it succeeds, and If-None-Match needs no such permission.
The per-resource evaluation loop is extracted into abortIfDenied so the
second authorization reuses it rather than duplicating it.

The class comment named floci.iam.enforcement-enabled; the key that works
is floci.services.iam.enforcement-enabled.

Closes #209

(cherry picked from commit 402920cf137c98f45283ad093f3df97807bb1dc7)

* fix(iam): authorize an object-tag condition against the version the request names

Review follow-ups on #3946.

s3:ExistingObjectTag was read from the current version whatever the request
asked for, so an allow conditioned on a tag decided a versioned read against
tags the older version does not carry, letting it through. The lookup now
passes the versionId query parameter, via a new S3Service.getObjectTagging
overload that takes one.

A malformed x-amz-tagging value such as "a=%zz" threw IllegalArgumentException
out of URLDecoder inside the filter, answering 500 where S3 returns 400
InvalidTag. An undecodable pair is now dropped, so the policy decides.

Documents both condition keys under "Condition keys floci populates" in
docs/services/iam.md, including which actions receive them, the If-Match
coupling, and that s3:RequestObjectTagKeys is not populated.

Replaces the two var declarations in the new test with explicit types, and
drops the downstream project's name from the comments and test fixtures.
2026-09-21 19:44:35 -04:00
David ecdc9ccfdd feat(rds): DB cluster snapshots (#4097)
* feat(rds): DB cluster snapshots

Add CreateDBClusterSnapshot, DeleteDBClusterSnapshot, CopyDBClusterSnapshot,
RestoreDBClusterFromSnapshot, DescribeDBClusterSnapshotAttributes and
ModifyDBClusterSnapshotAttribute, and make DescribeDBClusterSnapshots list
real snapshots with its three filters instead of an empty list.

A cluster snapshot records the cluster's description and a dump of its
database; a restore creates a new cluster from the snapshot's settings
and loads the dump into it. Copies carry the data, CopyTags and Tags and
record SourceDBClusterSnapshotArn; the restore attribute is shared the way
instance snapshots share it.

Closes #4042

* feat(rds): restore a cluster from a snapshot named by ARN, simplify the cluster snapshot handlers

RestoreDBClusterFromSnapshot resolves SnapshotIdentifier by name or ARN
through the helper CopyDBClusterSnapshot already uses, as the API
reference allows and aws_rds_cluster commonly sends. The six handlers
use the shared firstMissingParam helper and the central AwsException
handling; the new service lines import InMemoryStorage and Predicate
instead of qualifying them inline, and the tests import
DbClusterSnapshot.
2026-09-21 19:42:22 -04:00
Allen Sanborn 2af7ed71a7 feat(redshift): implement snapshot copy grant lifecycle (#3628)
* feat(redshift): implement snapshot copy grant lifecycle

Terraform's aws_redshift_snapshot_copy_grant needs the full CRUD, and all
three actions returned InvalidAction. Add CreateSnapshotCopyGrant,
DescribeSnapshotCopyGrants and DeleteSnapshotCopyGrant to the Query handler,
backed by a new storage map on RedshiftService.

The grant name is the key: a duplicate create raises
SnapshotCopyGrantAlreadyExistsFault, and describe-by-name or delete of a
missing grant raises SnapshotCopyGrantNotFoundFault. Describe without a name
returns every grant. KmsKeyId is optional and defaults to the account's
AWS-managed Redshift key alias ARN, mirroring how Ec2EbsEncryptionService
stands in for a default key.

Tags ride along on create, since the CLI sends them inline as
Tags.Tag.N.Key/.Value on this action rather than via CreateTags, and
snapshotcopygrant ARNs now resolve in the tagging operations alongside the
other Redshift resource types.

* test(redshift): cover snapshot copy grants through the real SDK

* fix(redshift): paginate DescribeSnapshotCopyGrants

The action returned every grant in one page and ignored MaxRecords and
Marker, so a client with more grants than fit in a page had no way to walk
them.

Page through the shared Pagination helper, which sorts by the grant name and
encodes the last returned name as an opaque base64 cursor, so ordering is
stable and a marker stays resumable when grants are created or deleted
between pages. Marker is emitted only while further pages remain, which is
what tells a paginating client to stop.

MaxRecords follows the Redshift model: default 100, and a value outside
20 to 100 is rejected with InvalidParameterValue rather than clamped.

The model documents SnapshotCopyGrantName and Marker as mutually exclusive
but declares no error for sending both, so this filters by name and then
paginates instead of rejecting the pair. A name matches at most one grant,
which fits in any page.

* fix(redshift): enforce the SnapshotCopyGrantName contract

AWS validates SnapshotCopyGrantName as 1-63 characters, first a lowercase
letter, then lowercase letters, digits or single hyphens with no trailing
or doubled hyphen. Create accepted anything non-blank, so names Redshift
rejects (1grant, Grant, grant--copy, grant-, 64 characters) persisted
locally and diverged from AWS.

Validate in RedshiftService before persistence, matching the existing
snapshot identifier check, and answer InvalidParameterValue as the rest of
the handler does.

* fix(redshift): return 400 for SnapshotCopyGrantNotFoundFault on Describe and Delete

AWS documents SnapshotCopyGrantNotFoundFault as HTTP 400 in the error tables
for both DescribeSnapshotCopyGrants and DeleteSnapshotCopyGrant; we returned
404. Two existing wire-level assertions in RedshiftOperationsTest pinned the
wrong status, so they move with the code, and the unit tests now assert the
status alongside the error code.

The third throw site, in the tagging helper, deliberately stays 404: the
status belongs to the action rather than the fault code, and that path is
reached only from CreateTags/DeleteTags/DescribeTags, whose documented
missing-resource error is ResourceNotFoundFault at 404. A regression pins
that, and a comment says why the two differ.

Refs:
https://docs.aws.amazon.com/redshift/latest/APIReference/API_DescribeSnapshotCopyGrants.html
https://docs.aws.amazon.com/redshift/latest/APIReference/API_DeleteSnapshotCopyGrant.html
https://docs.aws.amazon.com/redshift/latest/APIReference/API_CreateTags.html

* fix(redshift): serialize grant create/delete, and use ResourceNotFoundFault on the tag path

Two findings from the latest review round.

createSnapshotCopyGrant checked the name was free and then wrote, with nothing
between the two steps, so two concurrent creates of one name could both succeed
and the second would overwrite the first. create and delete are now synchronized,
as createCluster and modifyCluster already are. The new wire-level test holds two
threads on a latch and releases them into the same name: it fails on every run
without the keyword (3/3 locally) and passes with it, so it pins the lock rather
than describing it.

The tagging path threw SnapshotCopyGrantNotFoundFault with HTTP 404. Both halves
of that pairing cannot be right at once: botocore's Redshift model gives that
shape httpStatusCode 400, and an error shape's status is a property of the shape,
not of the calling action. But 404 is the correct status here, because
CreateTags/DeleteTags/DescribeTags do not list that fault at all -- they document
ResourceNotFoundFault, modelled at 404, for any missing resource. So the status
stays and the code changes. That also explains why the three sibling cases in the
same switch are already consistent: ClusterNotFound, ClusterSnapshotNotFound and
ClusterParameterGroupNotFound are each modelled at 404 themselves.

Describe and Delete still return SnapshotCopyGrantNotFoundFault at 400, which is
what those two actions document.

Docs gain a short section on the grant surface: the alias-ARN KmsKeyId default,
the unvalidated tag limits, and why a missing grant reports two different faults
depending on which action you reach it through.

* style(test): name the new snapshot copy grant tests without the testX prefix

AGENTS.md: "Name test methods either as a camelCase sentence or as
method_scenario_expectation. Both are established. testX names are common in
older tests and are not the pattern to copy." The 31 tests this PR adds to
src/test all used testX because the three Redshift files they landed in are
unusually full of it -- 7/7, 30/50 and 69/104 -- but that is the local exception,
not the repo convention, and the rule is explicit about not copying it.

Renames only; no test body changes. The two new tests in
compatibility-tests/sdk-test-java keep testX: that module has the opposite idiom
and AGENTS.md says to follow the module you are in, and all five methods in that
file, three of them pre-existing, are named that way.
2026-09-21 18:31:00 -04:00
Matheus André 2e038b5cfb test(codeartifact): pin ResourceNotFoundException on DeleteDomain of a missing domain (#4107)
AWS returns ResourceNotFoundException (404) when DeleteDomain targets a
domain that does not exist, even though the API reference leaves it out
of the operation's error list. Keep that behaviour, pin it with unit and
integration tests, and note it in the docs and next to requireDomain.

Closes #4000
2026-09-21 18:00:27 -04:00
David 1542c641a6 feat(rds): stop, start and reboot DB instances and clusters (#4071)
* feat(rds): stop, start and reboot DB instances and clusters

Add StopDBInstance, StartDBInstance, StopDBCluster, StartDBCluster and
RebootDBCluster. A stop reports "stopping", takes the optional snapshot,
removes the container and proxy and settles the record to "stopped"
while its identifier, endpoint, groups and Docker volume stay; a start
reports "starting" and brings the container back on the kept volume and
port. Cluster stop, start and reboot carry the member instances along.

StopDBInstance refuses cluster members, read replicas and their sources,
and anything not available; ModifyDBInstance refuses a stopped instance;
a stopped resource stays stopped across an emulator restart.

Closes #4043

* feat(rds): refuse starting a stopped cluster's member alone, serialize cluster lifecycle calls

StartDBInstance now refuses a cluster member as StopDBInstance does, and
both answer InvalidDBClusterStateFault, the fault the model lists for a
member on either call; a member started alone would have got a
standalone container on its own volume while the cluster stayed stopped.
stopDbCluster, startDbCluster and rebootDbCluster are synchronized like
the instance calls, so two concurrent starts cannot both see STOPPED.
The five handler arms use the shared required-parameter helper and the
central AwsException handling.

* test(rds): import DbInstanceStatus instead of qualifying it inline

AGENTS.md asks for imports over inline fully-qualified names; the file
already imports DbInstanceStatus.
2026-09-21 16:12:54 -04:00
stodan c083aad12b fix(apigateway): verify AWS_IAM signatures against the custom-domain path (#4092)
* fix(apigateway): verify AWS_IAM signatures against the custom-domain path

The custom domain filter rewrites a request onto /execute-api/... before
dispatch but, unlike the execute-api host filter, never recorded the path
the caller actually signed. SigV4 verification then rebuilt the canonical
request from the rewritten path, so every AWS_IAM method invoked through a
custom domain was rejected with InvalidSignatureException.

Record the original raw path on ApiGatewayExecuteRouteContext, matching
ApiGatewayExecuteApiHostFilter, and give the filter an explicit
ApplicationScoped scope so the request-scoped context injects through a
client proxy. Covers both REST and HTTP API custom domains, since v2 API
mappings are stored as base path mappings and routed by the same filter.

* test(apigateway): cover AWS_IAM through an HTTP API custom domain

A v2 API mapping is stored as a base path mapping and routed by the same
custom domain filter as REST APIs, so the fix applies to HTTP APIs too. Prove
it rather than assert it: a signed request through the domain reaches the
integration, and unsigned, rewritten-path and other-path signatures are
rejected with v2's flat 403 Forbidden.
2026-09-21 16:11:06 -04:00
Abhigya 7b29fdcf83 feat(ecs): complete the operations outside the launch path (#4019)
The operations that are not part of launching a task were the ones ECS
answered least like AWS: a listing returned everything at once, a
describe dropped what it could not resolve, and several stored less than
the request carried.

Clusters. CreateCluster and UpdateCluster carry configuration and
serviceConnectDefaults, UpdateCluster replaces only the members the
request named, and DescribeClusters gates settings, tags, statistics,
attachments and configuration on include, reporting the eight documented
statistics split by launch type. DeleteCluster refuses a cluster that
still has services, container instances or running tasks, with the
exception AWS reports for each.

Pagination. Every listing pages with maxResults and nextToken behind one
shared helper: a hundred per page, ten for ListServices, ten for
ListAccountSettings. ListTaskDefinitions lists only ACTIVE revisions by
default and orders by family then numeric revision; ListTasks defaults to
the running tasks and filters by launch type, container instance and
startedBy, which has to be the only filter alongside the cluster scope.

Container instances. RegisterContainerInstance keeps what the agent sent,
deregistration leaves the instance describable as INACTIVE,
UpdateContainerInstancesState moves only between ACTIVE and DRAINING,
and DescribeContainerInstances gates tags and health on include.

Account settings and attributes. A setting is validated per name, carries
its principal and type, and falls back from the principal's own value to
the account default to the built-in default under effectiveSettings. An
attribute belongs to a cluster and must name a container instance it has.

Task sets. A task set needs an EXTERNAL or CODE_DEPLOY service, computes
its desired count from the service's, round-trips its networking and load
balancers, and needs force to delete before it is scaled to zero.
CodeDeploy's call site reports the CODE_DEPLOY startedBy ECS reports.

Service deployments and revisions. A deployment is recorded with the
revision it targets, the two point at each other, and the service reports
the deployment and revision it is currently on.

Verified against the AWS SDK for Java v2 and the AWS ECS API reference.
2026-09-21 16:09:00 -04:00
Simone Primarosa cebdc6f2bb fix(eks): store and return node group launchTemplate, taints, remoteAccess, nodeRepairConfig and warmPoolConfig (#4102)
CreateNodeGroupRequest modelled 14 of the 19 documented CreateNodegroup body
members. The other five were discarded by @JsonIgnoreProperties during
deserialization, so DescribeNodegroup omitted them and OpenTofu saw a node group
with no launch template where one was declared. Adding a launch template to a
node group that lacks one is ForceNew in the AWS provider schema, so every plan
destroyed and recreated the node group.

The five are added to the request as Object and copied onto the stored node
group, matching the generic JSON passthrough convention Nodegroup already
records for recursive sub-structures. warmPoolConfig was also missing from
Nodegroup itself and is added there too.

They are recorded as metadata only. Launch template user data is not executed.
2026-09-21 16:07:01 -04:00
Simone Primarosa 31a19df6f5 feat(eks): enable IMDS and link-local metadata access from pod network (#4039)
Pods running without hostNetwork: true run in isolated network namespaces
managed by the CNI plugin (e.g. flannel in k3s). When pods send requests
to link-local addresses such as IMDS (169.254.169.254:80), the packets reach
the host node network namespace where CNI portmap installed
-A PREROUTING -m addrtype --dst-type LOCAL -j CNI-HOSTPORT-DNAT.
Because 169.254.169.254 is assigned to lo, the kernel evaluates its addrtype
as LOCAL, causing non-host-network pods to misroute or drop link-local traffic
if an ingress controller binds the same port.

This introduces EksPodNetworkRouting and an opt-in configuration setting
floci.services.eks.imds-pod-network (defaulting to false to preserve default
pod network isolation). When enabled alongside floci.services.eks.imds,
DNAT iptables rules are programmed in a dedicated FLOCI-LINK-LOCAL chain
inserted at rule 1 of PREROUTING. Requests originating from the cluster pod CIDR
targeting configured link-local endpoints (such as IMDS at 169.254.169.254:80,
and extensible for Pod Identity at 169.254.170.23:80) are explicitly DNATed
to the node's loopback listener, preempting CNI-HOSTPORT-DNAT without
conflicting with CNI portmap or flannel routing.

LinkLocalEndpoint strictly validates IPv4 literal format to reject non-IPs
or malformed strings. Rules are idempotent and degrade gracefully if iptables
configuration fails, ensuring cluster startup is never aborted.
2026-09-21 16:04:20 -04:00
Niels Kootstra c0ed88d647 fix(scheduler): deliver the default event to targets without Input (#4018)
* fix(scheduler): deliver the default event to targets without Input

Templated targets without Input received "{}" instead of the default
"Scheduled Event" notification that EventBridge Scheduler delivers, so
consumers that switch on detail-type or source never matched. Only SQS
targets had a dead-letter body in the shape of the target service's API;
every other target's body was the raw payload. CreateSchedule and
UpdateSchedule also accepted a non-JSON Input for the templated Lambda,
Step Functions, and EventBridge targets that the API reference requires
to be well-formed JSON.

Deliver the default notification (version, id, detail-type, source,
account, time, region, resources, and detail as the string "{}") to
every templated target whose Input is absent, with an id that is stable
per occurrence so retries and the dead-letter body carry the same event.
Materialize dead-letter bodies with the request fields of Lambda Invoke,
SNS Publish, Step Functions StartExecution, EventBridge PutEvents, and
ECS RunTask, next to the existing SQS SendMessage shape. Reject a
non-JSON Input for Lambda, Step Functions, and EventBridge targets with
a ValidationException, while SQS, SNS, and universal targets keep
accepting any text.

The invoker now takes the schedule and the occurrence time, since the
default event needs the schedule ARN, account, region, and time. RoleArn
is still not consulted at delivery: no Floci delivery path evaluates a
role's permissions, so that is left for a platform-wide follow-up.

Refs #3951

* fix(scheduler): reject blank and trailing-token Input for JSON targets

CreateSchedule and UpdateSchedule checked Input with readTree, which
accepts text after the JSON value ("{} garbage") and returns a missing
node for a blank value, so both were stored for Lambda, Step Functions,
and EventBridge targets. Parse with FAIL_ON_TRAILING_TOKENS and reject a
blank Input, which the API reference gives a minimum length of 1.

Import the scheduler model's AwsVpcConfiguration in ScheduleInvoker
instead of qualifying it inline. The ECS model's type of the same name
stays qualified, with a comment naming the clash.
2026-09-21 15:14:53 -04:00
Simone Primarosa 6a3380d13a feat(eks): implement cluster addon management (#4038)
* feat(eks): implement cluster addon management

* fix(eks): address addon management review comments

* fix(eks): handle uncataloged k8s versions and association validation ordering
2026-09-21 14:18:07 -04:00
Simone Primarosa 49d28fb685 feat(eks): support native kubernetes versions and network cidrs (#4064)
Support standard AWS EKS Kubernetes versions (1.28 and above) with strict
1.xx validation format, mapped to stable k3s images when requested. Fall
back to default-image (with 1.29 cluster version metadata) when no version
is specified. Support service IPv4 CIDR validation (RFC 1918 containment,
/12 to /24 prefix, non-overlapping with VPC CIDR) with automatic fallback
to alternative CIDR, and preserve standard k3s pod CIDR to avoid collisions
with Docker networks.
2026-09-21 14:15:06 -04:00
Daniël van Ziel 4618d633e0 fix(textract): retain async results until expiry (#3965) 2026-09-21 14:11:16 -04:00
Abhigya ace99b34b0 feat(ecs): service members, service role and capacity provider management (#4037)
CreateService and UpdateService carry the members AWS documents on the Service
shape, rather than dropping them: deploymentConfiguration, serviceRegistries,
platformVersion and platformFamily, enableExecuteCommand, enableECSManagedTags,
propagateTags, healthCheckGracePeriodSeconds, the role, and anything else the
request sent, which round-trips verbatim. A client that reads back what it wrote
sees no drift.

UpdateService rolls a new deployment only for the members UpdateService
documents as starting new tasks, a changed network configuration, load balancers,
service registries or platformVersion, and applies the rest in place. An update
replaces only the members it names, so a service created with
placementConstraints and updated with placementStrategy alone keeps its
constraints; a member the update does name is replaced outright, which is how an
empty array clears one.

A service role is accepted only where AWS accepts one: with a load balancer, and
not with awsvpc networking.

Capacity provider management follows the documented rules. A name is at most 255
letters, numbers, underscores and hyphens and is never prefixed with aws, ecs or
fargate. A provider reports its ARN, its type and the autoScalingGroupProvider it
was created with. DescribeCapacityProviders gates tags behind include: ["TAGS"]
and reports an unresolvable name as a MISSING failure. DeleteCapacityProvider
refuses the reserved FARGATE and FARGATE_SPOT providers, one still attached to a
cluster and one still named in an active service's capacity provider strategy,
and reports the deleted one through updateStatus so the SDK is never handed an
unmappable CapacityProviderStatus.

Split out of the Fargate launch surface PR, which keeps the capacity provider
strategy distribution and the service task launch.
2026-09-21 11:58:55 -04:00
Vũ Thế Huy d227ef9195 feat(redshift): add ModifyClusterIamRoles, DescribeClusterVersions and DescribeOrderableClusterOptions (#3990)
ModifyClusterIamRoles adds and removes the IAM roles associated with a
cluster. The change is pushed to the running auth proxy, so COPY and
UNLOAD on new connections authorize against the updated role list.
Cluster IamRoles now report ApplyStatus in-sync.

DescribeClusterVersions and DescribeOrderableClusterOptions return static
data so IaC providers can validate node types before creating a cluster.
2026-09-21 11:32:09 -04:00
XuJian 12cad79616 feat(rds): support instance snapshot lifecycle operations (#4066) 2026-09-21 09:48:57 -04:00
Priamo Germosen 847ad256f2 fix(lambda): resolve hot-reload paths before checking the allow-list (#4053)
Normalize the hot-reload S3Key and compare it against the allow-list by directory instead of by string prefix, so dot-dot segments and sibling directories no longer pass. Store the normalized path, reject a colon in it, and warn at startup when hot-reload runs without an allow-list.
2026-09-21 07:53:07 -05:00
Matheus André db9bd692cb docs(cognito): drop ADMIN_USER_SRP_AUTH from the supported AuthFlow list (#4028)
The value does not exist in AWS: botocore's AuthFlowType enum has no
ADMIN_USER_SRP_AUTH member, so no SDK can send it. Advertising it invites
templates and client calls that real AWS rejects. The case label in
CognitoAuthFlowHandler stays as tolerance.

Closes #3996
2026-09-21 08:45:38 -04:00
vamsiakandVamsi Akavarapu 25a74be198 fix(stepfunctions): preserve Scheduler task timestamps (#4056)
Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-09-21 08:30:44 -04:00
Abhigya bf1152e144 feat(ecs): complete the fargate launch surface (#4017)
Floci accepted a Fargate task definition and ran it, but most of the
launch surface was dropped on the way through: members that AWS echoes
back went missing from responses, launch type resolution never validated
what it resolved, and the runtime ignored the sizing the task asked for.

Task definitions. A definition round-trips whole. Members that change
behaviour are typed (ephemeralStorage, dependsOn, environmentFiles, port
mapping name / appProtocol / containerPortRange, pidMode, ipcMode and the
container-level members the parser used to drop); members Floci does not
act on go through EcsJsonPassthrough, so an unimplemented volume
configuration comes back as it was sent rather than vanishing.
compatibilities is derived from the definition rather than echoed from
requiresCompatibilities, requiresAttributes names the capabilities the
definition needs, and a revision carries its registeredAt,
deregisteredAt and deleteRequestedAt through the ACTIVE / INACTIVE /
DELETE_IN_PROGRESS lifecycle.

Validation. Fargate task sizes are validated per CPU architecture and
operating system family, ephemeral storage against its 21-200 GiB range,
container dependencies for unknown names and cycles, and the parameters
Fargate does not support are rejected at registration with the exception
type AWS documents for them, ClientException; the message text is Floci's,
since AWS does not document the wording. Enum-typed members are validated
at parse time and raise InvalidParameterException instead of being
treated as absent, and
tag cardinality and character limits are enforced across the operations
that take tags.

Launch. capacityProviderStrategy is distributed across its providers the
way ECS distributes it, base first and the remainder by weight, with the
cluster's default strategy applying when a request carries neither it nor
a launch type. The strategy is validated against the bounds the ECS model
gives it: at most 20 providers, weight 0 to 1,000, base 0 to 100,000, one
base per strategy, and at least one provider of non-zero weight when a
strategy names more than one, since a provider of weight 0 places nothing
beyond its base. A task's CPU and memory reach the container, an awsvpc
task gets an ENI per task and releases it when it stops, container
dependencies are ordered with cycle detection, and mock mode reports
per-container detail so a client running without Docker sees the same
shape. The ENI allocation reaches into EC2, whose InvalidSubnetID.NotFound
and InvalidGroup.NotFound are not in RunTask's error list, so an unknown
subnet or security group is reported as the InvalidParameterException AWS
returns.

Verified against the AWS SDK for Java v2 and the AWS ECS API reference.
Adds EcsFargateTaskIntegrationTest, EcsFargateTaskDefinitionIntegrationTest
and EcsFargateEdgeCaseIntegrationTest, plus an SDK-based EcsFargateTest in
the compatibility suite.
2026-09-20 22:38:32 -04:00
Simone Primarosa 7777a97de9 fix(ecr): serve the registry data plane over TLS (#4040)
- Update ECR host routing regex to support <account>.dkr.ecr.<region>.localhost.floci.io
- Populate regional wildcard SANs (*.dkr.ecr.<region>.localhost.floci.io) for all advertised AWS regions
- Add unit tests for hostname matching, malformed host rejection, immutable tag mutability over TLS, and certificate SAN enumeration
- Add Docker integration test verifying end-to-end TLS image push/pull with root CA verification and plain HTTP regression
- Update ECR and TLS user documentation
2026-09-20 22:11:46 -04:00
Priamo Germosen 9dab36197a fix(elbv2): block link-local and metadata targets (#4031)
Reject link-local and cloud instance-metadata addresses in RegisterTargets with InvalidTarget, and resolve target hosts once in the data plane and health checker, connecting to the checked address. Loopback and private ranges stay reachable so a load balancer can front a neighbouring container.
2026-09-20 21:11:27 -05:00
Priamo Germosen a12bf8c96c feat(cognito): enforce app client ExplicitAuthFlows in InitiateAuth and AdminInitiateAuth (#3974)
ExplicitAuthFlows was stored but never checked, so a client that only allowed SRP still accepted USER_PASSWORD_AUTH. When a client lists flows, reject any flow it does not enable with InvalidParameterException. Legacy values (USER_PASSWORD_AUTH, ADMIN_NO_SRP_AUTH, CUSTOM_AUTH_FLOW_ONLY) are honored, and clients created without a list stay ungated.

The Java compatibility test signed in with ADMIN_USER_PASSWORD_AUTH on a client that never enabled it; add ALLOW_ADMIN_USER_PASSWORD_AUTH to that client.
2026-09-20 21:04:55 -05:00
Austin W e14221fe62 feat(sagemaker): support GPU-backed training jobs (#4015)
* feat(sagemaker): support GPU-backed training jobs

ResourceConfig.InstanceType had no effect on the container Floci launched, so
a training job asking for ml.g5.xlarge ran on CPU. This maps the accelerator
half of an instance type onto a real device request, using the container GPU
primitive added in #3789.

On AWS the instance type *is* the hardware, so nothing is configurable. Floci
has one host with fixed cards, so serving a GPU instance type means
substituting a local device, and which devices may be lent out is a local
decision. The two halves are split accordingly:

- How many accelerators an ml.* type carries is a property of AWS, so it ships
  as data in sagemaker/instance-type-catalog.yaml, mirroring how
  Ec2InstanceTypeCatalog already carries vcpu and memory for EC2 types. It is
  kept separate from that catalog because ml.* is its own namespace and must
  never appear in DescribeInstanceTypes.
- Which of this machine's devices may be used is configuration, under
  floci.services.sagemaker.gpu: enabled, mode and devices.

Nothing changes unless enabled is set. It defaults to false, so existing
deployments keep launching CPU-only containers, including for GPU instance
types.

mode exists because daemons disagree on the wire form. It defaults to cdi:
Podman resolves only CDI and accepts a count request while attaching no device
(containers/podman#22645), so preferring CDI turns a misconfiguration into a
refused start rather than a job that quietly trains on CPU. That principle
drives the failure cases too: an unlisted GPU-family type, too few allowed
devices, an explicit mode with no devices, and InstanceCount above one all
fail with a FailureReason instead of falling back to CPU. A job that reports
Completed after training on the wrong hardware leaves an artifact that looks
legitimate, which is worse than an error.

Only the accelerator is substituted. An instance type also implies vCPU and
memory, which this does not emulate, consistent with the rest of the codebase:
EC2 instance types are metadata for DescribeInstanceTypes and never size a
container, RDS records DBInstanceClass without acting on it, and Lambda, ECS
and Batch apply limits only where an API supplies an explicit number.

Endpoint hosting is unchanged and still CPU-only; the resolver is a separate
bean so it can be reused there in a follow-up.

* test(sagemaker): cover the GPU refusal paths and the hardware path

The GPU feature shipped with unit coverage on the resolver only, so nothing
exercised it through CreateTrainingJob. These add both halves.

SageMakerGpuIntegrationTest runs everywhere. Every path that refuses a request
raises inside SageMakerGpuResolver, before the runner asks the daemon for
anything, and the removeIfExists above it already swallows a missing daemon, so
an unlisted GPU family, InstanceCount above one, and cdi mode with no configured
devices all reach their verdict on a plain runner. A fourth case pins the
contract that enabling the feature leaves CPU instance types alone.

SageMakerGpuDockerIntegrationTest is opt-in behind -Dgpu.integration.enabled,
matching ContainerGpuDockerIntegrationTest, because it needs hardware no CI
runner has. Verified against an RTX 5060 Ti through Podman 5.8.2: the container
saw exactly the device named in gpu.devices and not the host's other card.

The assertion is the container's exit code. nvidia-smi output is redirected
rather than piped: a pipeline exits with the status of its last command, so
'nvidia-smi -L | tee' reports success even when nvidia-smi cannot reach the
driver, which would be this test passing on a CPU container.

* fix(sagemaker): package the instance type catalog in the native image

SageMakerInstanceTypeCatalog reads sagemaker/instance-type-catalog.yaml through
a constant, which Quarkus's static resource analysis cannot follow, and no glob
under quarkus.native.resources.includes matched it. The file was therefore left
out of the native image, so enabling floci.services.sagemaker.gpu.enabled there
would have failed every training job at catalog load with 'Missing catalog
resource sagemaker/instance-type-catalog.yaml'. Ec2InstanceTypeCatalog reads its
own catalog the same way and ec2/*.yaml was already listed for exactly this
reason.

Nothing caught it: JVM tests resolve the file from src/main/resources, and the
hardware verification ran a JVM-mode image, so the gap existed only in the
artifact neither exercised.

NativeImageResourceIncludesTest closes that gap the way
NativeImageRuntimeInitializationTest closes the Random-in-the-image-heap one, by
moving a native-only failure into ordinary CI. It pairs each resource-path
constant passed to getResourceAsStream with the includes globs and fails when
none matches, skipping the IAM catalog that application.yml already documents as
build-time only.

* refactor(sagemaker): match EC2's case handling for instance types

isAcceleratorFamily folded case while gpuCount did not, so ML.G5.XLARGE was
answered as a GPU family and then reported as missing from the catalog, pointing
the caller at the wrong fix.

Ec2InstanceTypeCatalog is the precedent and normalizes in neither position:
find() looks the type up exactly and familyOf() splits on the first dot without
folding. AWS instance types are exact tokens. The repo folds case where AWS
defines a value as case-insensitive, such as ACM domain names, regions and
content types, which an instance type is not.

Dropping the fold rather than adding one to gpuCount keeps both halves agreeing
and keeps the pair behaving like EC2's.

Also drops the @DisplayName from SageMakerGpuResolverTest. The suite does not
use them anywhere else; the method name carries the intent.

* docs(sagemaker): clarify GPU training device reuse
2026-09-20 17:56:43 -04:00