* feat(eventbridge): add ApiDestination target support (#4702)
- Add ApiDestination, ApiDestinationState, and HttpParameters models
- Implement CRUD operations for API destinations in EventBridgeService
- Add CreateApiDestination, DescribeApiDestination, UpdateApiDestination, DeleteApiDestination, ListApiDestinations actions in EventBridgeHandler
- Support HttpParameters on targets in PutTargets and ListTargetsByRule
- Implement HTTP delivery to API destinations in EventBridgeInvoker with connection auth and SSRF protection
- Add CloudFormation provisioning for AWS::Events::ApiDestination in EventsCfnProvisioner
- Update docs and tests
* fix(eventbridge): harden ApiDestination delivery and CloudFormation lifecycle
- Throw on delivery failure so TargetDispatcher retries 429/5xx and connection
errors and dead-letters permanent failures
- Enforce InvocationRateLimitPerSecond per destination
- Run the OAuth client-credentials exchange for OAUTH_CLIENT_CREDENTIALS connections
- Reject non-http(s) endpoints and wildcard hosts, encode path parameter values,
keep the query before any fragment, and stop logging URLs that may carry secrets
- Resolve destination and connection ARNs only when they match the stored ARN
- Validate every UpdateApiDestination field before applying any of them
- Paginate ListApiDestinations with Limit and NextToken
- Keep HttpParameters on AWS::Events::Rule targets and roll back
AWS::Events::ApiDestination updates from a snapshot
* fix(eventbridge): keep connection credentials authoritative and require a valid endpoint host
- Apply target headers and query parameters before the connection's so a target
cannot override its credentials, and replace header names that differ only by case
- Reject endpoints without a parsed host (for example https://:8080/path)
- Sweep stale rate-limit windows once the map grows
* fix(eventbridge): make the ApiDestination rate limit check atomic
Count permits inside ConcurrentHashMap.compute on an immutable window so the
stale-window sweep can no longer remove a window another delivery is using,
which let concurrent deliveries exceed InvocationRateLimitPerSecond.
* refactor(eventbridge): drop the in-service InMemoryStorage constructor and tidy tests
- Remove the compatibility constructor that instantiated InMemoryStorage inside
EventBridgeService; tests pass the ApiDestination store explicitly
- Import classes instead of qualifying them inline in the ApiDestination integration test
- Surface worker failures in the concurrent rate limit test by checking each Future
* docs: correct the EventBridge and IAM operation counts in the service matrix
* test(iot): cover custom authorizer management against AWS
* feat(iot): manage custom authorizers
Serve CreateAuthorizer, DescribeAuthorizer, UpdateAuthorizer,
DeleteAuthorizer, ListAuthorizers, SetDefaultAuthorizer,
DescribeDefaultAuthorizer and ClearDefaultAuthorizer on the AWS REST-JSON
paths, with the validation, messages, defaults, key merge, delete rules,
ordering and paging measured against AWS. Authorizer ARNs are tagged
through the existing IoT tag routes. Authorizers are stored, not evaluated.
Closes#4821
* fix(iot): read authorizer public key PEM line by line like AWS
A key without its PEM header line, or with an indented or inline header, is not a valid RSA key, a header without its end line cannot convert, and text before the header is skipped, as measured on AWS.
* fix(iot): validate authorizer names like AWS, SetDefaultAuthorizer included
A name member reports every violated constraint in one message, the pattern first, and a missing one must not be null. SetDefaultAuthorizer validates authorizerName before the lookup, as measured on AWS.
* fix(iot): validate the authorizer name on describe, update and delete like AWS
DescribeAuthorizer, UpdateAuthorizer and DeleteAuthorizer now reject a malformed or overlong authorizerName path member with AWS's 400 InvalidRequestException messages instead of a 404, measured on eu-west-1.
* fix(iot): route tag calls to the authorizer service on the ARN resource
IotTagHandler matched ":authorizer/" anywhere in the ARN, so an ARN with that text outside the resource field reached the authorizer service and failed with a 500. It now routes on the parsed resource prefix, and any other IoT ARN goes through IotService as before.
* feat(cognito): provision user group attachments
Serve AWS::Cognito::UserPoolUserToGroupAttachment through a new per-service
provisioner. Ref is <UserPoolId>|<GroupName>|<Username>, as measured on AWS.
Every property is createOnly, so a change replaces the membership and the old
one is removed in cleanup; delete tolerates a membership that is already gone.
* test(cognito): read stack outputs with XmlPath
* fix(cognito): attach users to groups from their recorded parts, as AWS does
* test(cognito): cover pipe group names and alias updates, delete seeded pools
* fix(cognito): remove an unrecorded attachment named unambiguously by its id
* test(cognito): pin that a failed rollback keeps the replacement's recorded parts
* fix(docker): finish a failed tar copy's writer before retrying
* test(docker): wait for each attempt's tar writer instead of racing it
Restores RetryingTarCopier.copyStreamed to its state on main: joining a failed attempt's writer could block on a writer stalled outside the pipe.
* docs(cloudformation): note the no-op delete of a short membership id
The class Javadoc said an unrecorded id that does not split into exactly three parts is refused. An id of fewer parts names no membership and its delete does nothing; only more parts is refused.
* fix(cloudformation): keep __Floci attributes out of Fn::GetAtt
Provisioners keep private state under __Floci attribute keys. Fn::GetAtt and Fn::Sub resolved them like any attribute, so a template could read, for example, an attachment's recorded pool, group and username, while AWS resolves no such attribute. They now resolve as unresolved, like any attribute a type does not have.
* docs(cloudformation): note that custom resource Data keys under __Floci are reserved
* feat(redshift-serverless): add running workgroups and Data API WorkgroupName support
Redshift Serverless workgroups get full CRUD (Create/Get/List/Update/Delete),
tagging by ARN, and the AWS::RedshiftServerless::Namespace and ::Workgroup
CloudFormation types with dotted Fn::GetAtt keys taken from the registry
schema. A namespace has at most one workgroup, and DeleteNamespace is refused
while one is attached.
Each workgroup runs a PostgreSQL container behind an authenticating proxy,
sharing the managers and the proxy port pool with provisioned Redshift. Add
GetCredentials, accept WorkgroupName (name or ARN) in the Redshift Data API,
and push a changed namespace adminUserPassword down to the running backend.
The runtime is re-attached when Floci restarts.
Not covered: snapshots, usage limits, endpoint access, and COPY/UNLOAD/Spectrum
on workgroups.
* fix(redshift-serverless): stop the runtime when workgroup creation fails after it started
If persisting the workgroup record failed after the container and proxy were
already running, the runtime was left behind with no record. createWorkgroup
now stops it (best effort) and releases the endpoint on the failure path.
Fix the CloudFormation error for a NamespaceName change: suggesting a new
WorkgroupName can never succeed because a namespace holds only one workgroup.
* fix(redshift-serverless): reset omitted CloudFormation properties and order startup observers
When UpdateStack drops a property from the template, the provisioner now sends
its default (BaseCapacity, EnhancedVpcRouting, PubliclyAccessible, Port,
TrackName, PricePerformanceTarget) instead of keeping the stored value, which
matches CloudFormation semantics. MaxCapacity has no default and keeps its
stored value.
Give the workgroup StartupEvent observer a @Priority after RedshiftService so
every persisted cluster has reserved its proxy port before workgroups restore
theirs.
Also remove an unused import and move DEFAULT_DATABASE to the top of
RedshiftContainerManager.
* fix(redshift-serverless): address review findings on password rotation and namespace updates
- Roll the backend password back when a rotation cannot be completed or stored, and apply
it last so validation failures never leave the backend ahead of the stored namespace.
- Keep a workgroup endpoint reserved when its runtime cannot be stopped during clear().
- Reject an in-place DbName change in CloudFormation, since it is fixed at creation.
- Reset an omitted KmsKeyId and DefaultIamRoleArn on CloudFormation updates.
* fix(redshift-serverless): keep rollback failures from masking errors and drop stale GetAtt role
- Do not reset the proxy password when the role restore fails, and attach restore
failures to the original exception instead of replacing it.
- Remove Namespace.DefaultIamRoleArn from the stack resource when an update no
longer declares a default role.
* docs: correct the Redshift Serverless operation count in the service matrix
* fix(redshift-serverless): expose Workgroup.ConfigParameters through Fn::GetAtt
* fix(redshift-serverless): parse ConfigParameters resolved from a GetAtt attribute
* docs(redshift-serverless): list every unsupported operation group
* fix(eventbridge): make UpdateArchive a partial update
UpdateArchive reset the event pattern to null and the retention to 0
whenever a request omitted them. On AWS an omitted Description,
EventPattern or RetentionDays keeps the stored value, an empty
Description or EventPattern clears it, and RetentionDays 0 sets 0.
* feat(eventbridge): provision AWS::Events::Archive
CloudFormation stubbed AWS::Events::Archive with a fake ARN and created
nothing. EventsArchiveCfnProvisioner now creates a real archive through
EventBridgeService.
Ref is the archive name and Fn::GetAtt Arn the archive ARN. ArchiveName
is generated when omitted and kept across updates. Description,
EventPattern and RetentionDays update in place, sending only the
properties the template declares, and a failed stack update restores
them from a snapshot. Changing SourceArn or ArchiveName, or dropping an
explicit name, replaces the archive and deletes the displaced one once
the update commits. A replacement that keeps an explicit name is refused
with CloudFormation's custom-named resource error before any change.
KmsKeyIdentifier is ignored.
Closes#4815
* fix(eventbridge): reject an archive source that is not an existing bus of the account and region
CreateArchive now checks EventSourceArn as AWS does, before the archive
name: a bus in another account fails with AccessDeniedException, one in
another region with ValidationException, and a bus that does not exist
with ResourceNotFoundException. The AWS::Events::Archive provisioner goes
through the same service call, so a stack can no longer reach
CREATE_COMPLETE with an archive that could never capture an event.
* test(eventbridge): roll back an in-place archive update when a later resource fails
A stack update changes an archive's description and retention in place,
then fails on a second archive whose source bus does not exist. The stack
ends UPDATE_ROLLBACK_COMPLETE, DescribeArchive shows the original values
and the second archive was never created. The golden case passes on AWS
and is mirrored in the Floci integration test.
* fix(cloudformation): refuse declaring a generated archive name explicitly
Adding ArchiveName with the name CloudFormation generated for an unnamed
archive asks AWS to replace the archive under the same custom name, which
it refuses with the custom-named resource error and rolls the stack back.
Floci took the in-place path and reached UPDATE_COMPLETE; the existing
refusal now also fires when the previous name was generated.
* fix(cloudformation): provision a real archive when updating a stack whose archive was stubbed
A stack created before AWS::Events::Archive had a provisioner holds the dispatcher's stub, whose physical id names no archive. Its next update now creates the archive instead of failing to describe that id, and the stub id is left to the replacement cleanup.
* fix(eventbridge): validate archive description, pattern and retention as CreateArchive and UpdateArchive do
CreateArchive and UpdateArchive now reject a description over 512 characters, an event pattern over 4096 characters and a negative retention with the ValidationException AWS returns, all violations reported together. The check runs before the source, existence and duplicate checks, so it also fails the AWS::Events::Archive resource in a stack.
* feat(eks): stop shipping a default storage class in clusters
* test(eks): verify coredns rollout status and preserve cluster storage on restore
* test(eks): assert storage class absence after coredns rollout completes
* docs(eks): clarify stock storage class and provisioner behavior
Deleting the current version in a versioned bucket made the previous
version current by reading its whole file into a byte array and writing
it out again as the current file, under the bucket lock. A version over
2 GiB could not be read that way, and because the new current version's
metadata was published before the file, the failure left the key pointing
at the promoted version while its current file still held the deleted
version's bytes.
The current file is now a hard link to the promoted version's file, the
way a versioned multipart upload already stores its current file, so a
version of any size is promoted without being read; in memory both
entries share the version's array, as they already did. The body is also
put in place before the metadata is published, the order PutObject
writes in, so a concurrent GET can no longer pair the promoted version
with the deleted version's bytes.
UploadSSHPublicKey, GetSSHPublicKey, ListSSHPublicKeys, UpdateSSHPublicKey
and DeleteSSHPublicKey, stored per user with the documented quota of five.
AWS accepts the body in ssh-rsa form or as PEM, so both are read, and the
body is kept exactly as it arrived: a caller that uploaded PEM gets that PEM
back rather than a re-encoding. GetSSHPublicKey converts, because Encoding is
required and decides the form of the response.
Fingerprint is the MD5 of the OpenSSH blob, confirmed by reproducing the
worked example in the IAM API Reference rather than assumed. It is not the
digest EC2 reports for the same key, which is taken over the DER: both are
sixteen bytes of colon hex, so the wrong one would look right.
The two rejection errors are kept apart the way the model separates them. A
body in neither accepted encoding is UnrecognizedPublicKeyEncoding; one in a
recognised encoding that will not parse, or that carries a key type other
than ssh-rsa, is InvalidPublicKey. An OpenSSH line is recognised by its
key-type token rather than by whether part of it base64-decodes, since a
short word often does.
DuplicateSSHPublicKey is per user, unlike the account-wide rule for signing
certificates, and compares fingerprints so the same key in the other
encoding still counts. A key blocks DeleteUser until removed and follows the
user across an UpdateUser rename, both under a lock taken in the same order
DeleteUser takes it.
* feat(apigatewayv2): implement UpdateVpcLink and VPC link tagging
* feat(cloudformation): provision AWS::ApiGatewayV2::VpcLink
* fix(cloudformation): keep VPC link and integration connection state on updates
* fix(cloudformation): restore the integration connection when its own update fails
ListTenants now honours Filter.TENANT_NAME_CONTAINS and Filter.SENDING_STATUS
the way SES v2 matches them, with the validation messages and precedence SES
answers: the filter's keys and values, then the page size and an empty token,
then the filter's values. The filter is applied before the page is cut, and a
token continues only the filter it was taken with.
UploadPartCopy loaded the whole source object into a byte array and parsed
x-amz-copy-source-range with Integer.parseInt, so a source of 2 GiB or
more, or any range offset past 2 GiB, failed as an internal error. A range
that ran past the end of the source was silently padded with zero bytes.
The source is now opened as a stream, the way GetObject serves it, and
only the requested range is read, with offsets parsed as longs. A bad
range gets the error S3 returns, as recorded in LocalStack's AWS-validated
snapshot for UploadPartCopy: anything but one bytes=first-last range with
first <= last is InvalidArgument naming the expected form, a range that
ends past the source is InvalidArgument naming its size, and one that
starts past it is InvalidRequest; the InvalidArgument errors carry
ArgumentName and ArgumentValue. A copied part is still held in a byte
array on its way into the upload, so a range over that limit returns
EntityTooLarge until UploadPart can store a part without one.
* fix(marketplace): serve Entitlement and Agreement in every region AWS publishes
GetEntitlements and the Marketplace Agreement API refused every region but
us-east-1, on the assumption that AWS Marketplace is commercial-only. AWS
publishes more endpoints than that: Entitlement also runs in cn-northwest-1
and eusc-de-east-1, and Agreement in us-iso-east-1, us-isob-east-1,
us-isof-south-1 and eusc-de-east-1 (botocore endpoints.json). Both now accept
exactly those regions and keep refusing the rest with AWS's message and error
code, so cn-north-1, which has neither endpoint, is still rejected.
* fix(marketplace): name the served regions in the Entitlement and Agreement refusals
Both refusals still said "available only in us-east-1" after the region sets
grew, so a caller in an unserved ISO, EUSC or China region was pointed at a
commercial region it cannot reach. Each message now lists the regions its
API serves, as Marketplace Discovery's already does. No reference source
carries AWS's text for these refusals, so the comment no longer calls it
AWS's.
Close-out items of the multi-partition initiative (#4272):
- Lambda layers were only tested across partitions negatively. A layer
published under a cn-north-1 scope now has its own test: the returned ARN
is arn:aws-cn:lambda:cn-north-1:..., GetLayerVersionByArn resolves it, and
a China function attaches it (BL-104).
- partitions.md names FLOCI_PARTITIONS_ALLOW_UNKNOWN_REGIONS under Related and
lists two more unsourced values: the EKS Pod Identity token audience
outside the commercial partition, and the exact error AWS WAF returns for
the CLOUDFRONT scope where the partition has no CloudFront (BL-105).
- AwsRegions.ALL, the commercial advertised list kept as a deprecated alias
during the partition sweep, had no caller left in src/main. It is removed
and its three tests call advertised("aws"); the KNOWN_IDS javadoc no longer
points at it (BL-106).
The EKS token webhook looked long-term keys up through findSecretKey,
which is account-scoped. k3s calls the webhook with no account routing,
so it saw only the default account's keys. A correctly signed
`aws eks get-token` from a user in any other account was rejected:
kubectl reported "the server has asked for the client to provide
credentials".
The webhook now uses a new IamService.findSecretKeyInAnyAccount. It
tries the request's account first and scans the other accounts only on
a miss. Inactive keys are still refused, and temporary (ASIA) keys never
reach the scan. findSecretKey itself stays account-scoped: the
ElastiCache, MemoryDB and RDS IAM-auth proxies verify through it and do
not compare the key's account with the cluster's.
Because a long-term key can now reach the webhook from any account, the
legacy identity (system:masters) is limited to long-term keys owned by the
cluster's account, or by the default account on unscoped webhook paths
that predate per-account clusters. This also tightens one existing case:
a default-account key used to get system:masters on clusters of every
account, and now gets it only on the default account's clusters.
Session credentials without an instance ID still map to the legacy
identity on any cluster; that predates this change and is left alone.
Co-authored-by: Robin Baeckman <27041454+RobinBaeckman@users.noreply.github.com>
UploadSigningCertificate, ListSigningCertificates, UpdateSigningCertificate
and DeleteSigningCertificate, stored per user with the documented quota of
two and account-wide duplicate detection compared on the encoded form.
The body is parsed on upload, because MalformedCertificate cannot be
answered without reading it. Status accepts Active, Inactive and Expired:
the API Reference gives all three as valid values even though the
parameter's prose explains only the first two. UserName is optional on
every operation and resolves from the access key that signed the request.
A certificate blocks DeleteUser until it is removed, which AWS lists as a
prerequisite, and follows the user across an UpdateUser rename rather than
being stranded on a name that no longer exists. The credential report's
cert_1 and cert_2 columns are backed by the store instead of always
reporting FALSE, reporting N/A for the rotation date unless the
certificate is Active, as the User Guide defines them.
* feat(cognito): provision user pool users
Add a CloudFormation provisioner for AWS::Cognito::UserPoolUser. Ref is the
username Cognito reports (the sub in an email-as-username pool). Every property
is createOnly: a changed custom-named user is refused as on AWS, any other change
replaces the user, and each delete targets the pool the user was created in.
* fix(cognito): refuse a RESEND user pool user that already exists
* fix(cognito): keep the user's pool out of Fn::GetAtt
* fix(cognito): keep only owed users in the pool record
* feat(wafv2): provision web ACL associations
WafV2CfnProvisioner now serves AWS::WAFv2::WebACLAssociation with Ref
ResourceArn|WebACLArn, as measured on AWS. Any property change replaces
the pair through ReplacementCleanup. Delete disassociates only while the
resource still uses that ACL, so cleanup of an old pair keeps the new one.
Rollback re-associates the restored pair.
* test(wafv2): cover ResourceArn replacement and read stack outputs with XmlPath
Under fan-out load the single Docker socket drops connections mid-call
(Broken pipe, Connection reset) and the operation fails. Split out of #2707.
- Retry transient I/O at the transport: RetryingDockerHttpClient retries
replay-safe control-plane calls with capped backoff (policy in
DockerRetry). Interrupted I/O is not retried, except
SocketTimeoutException, and the interrupt flag is kept.
- Split log-follow streams onto their own @StreamingDocker client and pool
(floci.docker.streaming-max-connections, default 512) so they cannot
starve create/start/stop calls. Exec and wait streams stay on the main
pool for now.
- Adopt the container a replayed named create already made (409 matched by
a per-attempt label) instead of failing and leaking it. Unnamed container
creates, network creates, restart and network connect/disconnect are
never replayed.
- Retry tar copies at the call site with RetryingTarCopier (Lambda
launcher, EC2 authorized_keys, EKS webhook kubeconfig and registries.yaml,
MWAA); a local tar-writer failure is reported at once.
- Send Connection: close on control-plane requests, since the Apache
transport reuses pooled sockets the daemon has already closed (Podman).
Hijacked requests and the streaming pool are unchanged.
* fix(ses): serve the POST list bindings and Filter of ListEmailIdentities and ListConfigurationSets
Since AWS SDK for Java 2.55.8 and botocore 1.43.105 the SES v2 model sends
ListEmailIdentities as POST /v2/email/list-identities and ListConfigurationSets
as POST /v2/email/list-configuration-sets, each with a new Filter member.
Floci only served the GET bindings, so these lists failed for current SDKs.
Both lists now answer on both bindings. The filter follows real SES, probed
on 2026-10-03: what it matches, its validation messages and their precedence,
and a NextToken that continues only the filter it was taken with. The filter
is applied before the page is cut, so filtered pages are exact.
* fix(ses): bind identity list tokens to an unambiguous filter scope
A name filter of "null" produced the same token scope as an absent name, so a
token from one filter continued the other. The scope now leads with the type
and status, which never hold the separator, and ends with the name. The name
filter also runs before the status refresh, so domains it excludes are not
checked against Route 53.
* docs(ses): mark the GET list bindings as the pre-Filter ones
Serve RestoreDBInstanceToPointInTime and RestoreDBClusterToPointInTime,
and report the restorable window: LatestRestorableTime on
DescribeDBInstances, EarliestRestorableTime and LatestRestorableTime on
DescribeDBClusters.
Requests are checked as the API reference describes: exactly one of
RestoreTime (RestoreToTime) and UseLatestRestorableTime, a time inside
the window or InvalidRestoreFault, PointInTimeRestoreNotEnabled for an
instance with backups off, and exactly one source. An instance source is
named by identifier or DbiResourceId, a cluster source by identifier, ARN
or DbClusterResourceId; automated backups ARNs answer
DBInstanceAutomatedBackupNotFound since no automated backups are kept.
Floci keeps no transaction log, so the target is seeded from a
pg_dumpall of the source taken when the request arrives, as read
replicas are. The restored data is the source's latest state for any
time in the window, and LatestRestorableTime is the current time. Only
PostgreSQL sources are accepted, as for CreateDBSnapshot.
Closes#4952
* feat(lambda): accept and echo DurableConfig on functions
CreateFunction and UpdateFunctionConfiguration take DurableConfig, PublishVersion snapshots it, and every read echoes it. ExecutionTimeout is required on create, RetentionPeriodInDays defaults to 14, a durable function's Timeout defaults to min(ExecutionTimeout, 900) and its logging to JSON. Update merges the members, and a function created without DurableConfig cannot gain one. KMSKeyArn is validated against its pattern and stored, the key itself is not looked up.
* chore(lambda): trim the DurableConfig tests to one case per rule
* feat(lambda): durable functions log in JSON format only
A durable function rejects LogFormat Text on create and update, and a LoggingConfig without LogFormat reads back as JSON. An empty KMSKeyArn means no key.
* chore(lambda): let the logging helpers own the durable JSON rule
validateLoggingConfig and applyLoggingConfig take the durable flag, so a durable function's default format and the Text rejection live in one place and a LoggingConfig without LogFormat keeps its log levels. applyDurableConfig sets the retention default and merges, and the test uses chainable helpers.
* chore(lambda): say why the durable compat test ignores a failed cleanup
CompleteMultipartUpload built the whole object as one byte array, so an
object over Integer.MAX_VALUE bytes failed with an ArithmeticException,
and anything smaller still needed the full object in the heap.
In the persistent, hybrid and wal modes the parts are now copied file to
file into one assembled file in the upload's directory, before the bucket
lock is taken, and that file is renamed into place under the lock. A
versioned bucket hard-links the current file to the versioned one rather
than writing a second copy, which is safe because object files are only
ever replaced by a rename, never modified in place.
The full-object checksum is combined from each part's CRC and size,
which is how S3 linearizes full-object checksums and why it offers them
only for the CRC algorithms, so the object's bytes are never read for it
and a mismatched expected checksum is rejected before assembly.
Since the ETag and checksum now come from the part records, each
UploadPart stores its bytes under its own storage ID kept on the record
and drops the bytes it replaced only after publishing the new record.
CompleteMultipartUpload reads each record once and assembles exactly the
bytes those records name, so an UploadPart racing a Complete makes that
Complete fail with InvalidPart instead of storing a checksum that
describes different bytes.
Memory mode still holds an object in one byte array, so an UploadPart
that takes an upload past the largest array the JDK allocates, or a
CompleteMultipartUpload over it, now fails with EntityTooLarge instead of
exhausting the heap or overflowing the array size.
Multipart uploads are tracked only in memory, so the part files under
.multipart are removed at startup and on reset. Without that, a crash
during assembly would leave a file as large as the object on disk for
good. The S3 docs describe the memory-mode limit, the disk space a
completion needs, and the operations that still read a whole object into
memory.
* feat(codepipeline): evaluate V2 stage conditions and rules
Evaluates beforeEntry/onSuccess conditions with VariableCheck and LambdaInvoke rules, records rule executions, and supports OverrideStageCondition.
* fix(codepipeline): bound MATCHES evaluation time and guard rule records and overrides against races
MATCHES: match against a deadline-checked CharSequence so a backtracking pattern fails the rule after 1s instead of hanging the run.
Rule records: mutate and serialize them under the execution lock, and build ListRuleExecutions from a locked snapshot.
OverrideStageCondition: when the run has failed on the condition but not yet left activeRuns, wait (bounded, outside the lock) so the override resumes it.
* fix(codepipeline): harden V2 stage conditions after review
Honor SKIP only before entry, resolve declared variable defaults, fail
rules on unresolved variable references, reject overrides after a pipeline
change, surface a busy-run override as a conflict, hide internal condition
state from GetPipelineExecution, and use the DeploymentWindow provider name.
* fix(codepipeline): keep an accepted stage-condition override when another waiter times out
* fix(codepipeline): reject stale OverrideStageCondition with ConditionNotOverridableException
* refactor(codepipeline): share the busy ConflictException across its four throw sites
* refactor(codepipeline): inject the override test hooks through the constructor
* fix(codepipeline): emit no stage events for a stage skipped by beforeEntry
AWS requires the principal to hold permission on the old name and the new
one, so that a rename into a name they may not write fails. ResourceArnBuilder
named only the stored certificate, so a Deny on the destination did not match
and the rename went through.
UpdateServerCertificate now names both the current ARN and the one the
request would produce, which the filter authorizes once per resource. The
destination is built beside the stored ARN so it keeps the certificate's
partition and account, and an update that renames and moves nothing still
names a single resource.
Replace the ListServerCertificates stub with the server-certificate
lifecycle: UploadServerCertificate, GetServerCertificate,
UpdateServerCertificate, DeleteServerCertificate, ListServerCertificates
and the tag operations.
The uploaded material is really parsed, because two of the upload's
modeled errors cannot be answered otherwise. CertificateBody, and every
certificate in CertificateChain rather than only its first block, must be
readable PEM or the upload is MalformedCertificate; the private key must
match the certificate's public key or it is KeyPairMismatch. The match is
a sign-then-verify check, so it holds for RSA and EC alike. All of it goes
through core.common.Pem rather than a second copy of the parsing.
Expiration is read from the certificate's own notAfter rather than stored
separately, so it cannot drift from what it describes. ServerCertificateId
uses AWS's ASCA prefix. The private key is stored and never returned: AWS
marks privateKeyType sensitive and models it only on the upload, so
neither reader echoes it back, and ListServerCertificates returns metadata
only as AWS documents.
Request shapes are enforced from the wire model: the 16384-character caps
on the body and key, the much larger 2097152 cap on the chain, and the
per-account quota of 20 that the User Guide's table publishes, counted
under the same lock as the write. A rename that only changes case is
allowed, excluding the certificate from its own duplicate check by id the
way updateUser does.
GetAccountSummary's ServerCertificates count is now backed by the store
instead of a hardcoded zero.
ResourceArnBuilder gains an iam case naming the certificate an operation
targets, so a policy statement scoped to one certificate constrains it
under enforcement. Every other IAM action still resolves to *, which is
long-standing behaviour rather than something this adds; documented in
docs/services/iam.md and tracked in #4979.
DeleteServerCertificate does not raise the in-use DeleteConflict AWS
returns when a load balancer still references the certificate. Floci
cannot determine that yet, because ELB Classic and CloudFront store
certificate identifiers without resolving them against IAM. Documented,
and tracked in #4875.
* fix(ecr): support image scanning configuration updates
* fix(ecr): validate scanning configuration booleans
* fix(ecr): accept null scan-on-push values
* docs(ecr): list the image scanning configuration actions
Add PutImageScanningConfiguration and BatchGetRepositoryScanningConfiguration
to the Supported Actions table. The table is not generated, so the docs check
does not catch a missing row.
ServiceQuotas only curated codebuild, lambda and organizations; every
other service code got three CRC-synthetic quotas, so real VPC codes
such as L-FE5A380F answered NoSuchResourceException from
GetServiceQuota and GetAWSDefaultServiceQuota. Terraform's
aws_servicequotas_service_quota reads exactly these codes before
requesting an increase.
Add a curated "vpc" entry, plus its service name:
- L-FE5A380F "NAT gateways per Availability Zone" = 5
- L-2AEEBF1A "Rules per network ACL" = 20
Values are the AWS defaults rather than the generous GENERIC_QUOTA_VALUE,
following the organizations entry (L-E619E033 = 50): callers compare a
desired value against these defaults to decide whether to request an
increase, so a realistic default keeps them on the path they take
against AWS. The emulator does not enforce either limit. The synthetic
quotas are still appended.
* fix(apigateway): map authorizer context in HTTP integrations
HTTP backends need verified authorizer context from parameter mappings. Resolve scalar context values and replace mapped headers regardless of casing so client claims cannot remain beside verified values.
* fix(apigateway): drop unresolved context headers
Remove inbound context-mapped headers even when verified context is absent or non-scalar. Cover missing authorizer claims, forged repeated headers, OPTIONS and unresolved method mappings.
* fix(apigateway): preserve original mapping inputs
Keep HTTP proxy header, query and path mapping sources separate from outgoing destinations. Cover both mapping orders with present and missing authorizer claims through both REST execution endpoints.
* feat(ses): apply the ListContacts filter
ListContacts now honours Filter.FilteredStatus and Filter.TopicFilter the way
SES v2 matches them, with the validation messages and precedence SES answers.
The filter is applied before the page is cut, so filtered pages are exact,
and a token stays a position in the list, as on SES, rather than being bound
to the filter.
* test(ses): name the filter unit test SesContactFilterServiceTest
Follow-up from the reviews of #4838 and #4839.
S3 checks a bucket policy itself in two places, and neither matched its
Principal the way the IAM evaluator does since #4839:
- The signed-request check (s3.enforce-auth) passed the caller to the IAM
evaluator as a bare ARN, so a role session was matched through a role ARN
rebuilt from the session ARN, which drops the role's path. A bucket policy
naming role/team/App never reached that role's sessions.
- The CopyObject/UploadPartCopy source check used S3's own matcher, which
compared each AWS entry with the caller's ARN as a string. A grant to the
caller's account, by id or root ARN, or to its role, never matched, so a
cross-account caller allowed to read an object could not copy it.
Both now pass the typed caller to the IAM evaluator, a role session with the
ARN of the role it assumed, through a RequestPrincipal.caller factory the
enforcement filter now uses too. The copy check's own matcher is gone: its
direct-grant rules (an exact user ARN, or "*" with aws:PrincipalArn pinned to
it) are the IAM evaluator's, and the unit tests that pinned them there move to
IamPolicyEvaluatorTest. S3PublicAccessEvaluator keeps its principal matching
for CloudFront's origin access identity check.
A CanonicalUser entry matched nothing since #4839, and docs/services/iam.md
described that as AWS behaviour. The IAM User Guide ("AWS account principals")
lets an S3 bucket policy name an account by its canonical user ID, which the
S3 User Guide describes as an obfuscated form of the account ID. It now
matches the IAM identities of that account, as an account principal does.
Floci's canonical ID for an account is its account id, the owner ID its S3 ACL
responses report.
Integration tests (IAM and S3 enforcement, real SigV4) read and copy across
accounts under bucket policies naming the caller's account, a role under a
path, and the account's canonical ID; each fails on main. docs/services/iam.md
and docs/services/s3.md describe the matching.
* feat(ses): paginate the contact, dedicated IP pool, suppressed destination and receipt rule set lists
Page ListContactLists, ListContacts, ListDedicatedIpPools, GetDedicatedIps,
ListSuppressedDestinations and v1 ListReceiptRuleSets with the probed bounds
and messages. ListContacts serves 50 by default and receipt rule sets 100, the
figure the model documents; the lists whose default could not be measured
serve up to 1000. Where SES's own order is not stable Floci keeps the order
its unpaged lists already had. A suppressed-destination token is bound to the
reason filter and tenant it was taken with, as on SES.
* test(ses): isolate the contact paging compat test and cover v1 receipt rule set paging on the wire
The contact paging compatibility test cleared every contact list in the
account before and after it ran; it now runs as its own account and removes
only the list it created. A new integration test pages 101 receipt rule sets
through the Query API, where the earlier coverage only reached the service.
* docs(ses): note that SES lists receipt rule sets by name
Floci pages ListReceiptRuleSets in the creation order its unpaged list already
had; the paging paragraph now says SES lists them by name.
* feat(ec2): support Dedicated Hosts (AllocateHosts, DescribeHosts, ModifyHosts, ReleaseHosts)
terraform's aws_ec2_host failed at create with "Operation AllocateHosts is
not supported". Add the four host actions following the Capacity
Reservation pattern: region-scoped store, dedicated-host tags through
TagSpecification and CreateTags, released hosts kept in DescribeHosts with
state "released", and unknown ids as InvalidHostID.NotFound on describe.
ModifyHosts and ReleaseHosts answer per host, putting an unknown, released
or (on release) occupied host in the unsuccessful set rather than failing
the call.
RunInstances now honours Placement.HostId and Placement.Tenancy: the host
must exist, tenancy defaults to "host", the zone defaults to the host's,
and DescribeInstances reports placement.hostId. DescribeHosts lists the
instances placed on each host.
* fix(ec2): default AllocateHosts AutoPlacement to off and drop the non-AWS host-recovery filter
AWS documents AutoPlacement as defaulting to off; the host record defaulted it
to on. host-recovery is not a DescribeHosts filter in the EC2 API, so it is no
longer matched.
* fix(ec2): validate Dedicated Host zone, settings and launch placement, serialise release against launch
RunInstances now rejects a host placement whose zone, tenancy or instance type
contradicts the host, re-checked under a lock shared with ModifyHosts and
ReleaseHosts. AllocateHosts rejects unknown zones; on/off host settings are
validated on allocate and modify. The hosts store is final again, braces and
the Consumer import follow AGENTS.md, and the RunInstances mock matcher in
Ec2RunInstancesPublicIpParamTest gains the two host parameters.
* test(ec2): pin exact host placement error codes and the in-lock host re-check
* fix(ec2): validate AllocateHosts zone against modelled zones, import classes
* style(ec2): fix import order and hostLock indentation, match AWS occupied-host message
* style(ec2): put java.util.Arrays after the non-java imports in the dedicated host test
* style(ec2): brace the host tag update and host tag lookup conditionals
* feat(kms): serve the AWS managed keys under alias/aws/* in every region
Every AWS account has a per-region AWS managed key for each service that
encrypts data on the account's behalf, published under a reserved
alias/aws/<service> alias. Floci had none, so a lookup that succeeds
against any real account failed here: DescribeKey on alias/aws/s3
returned NotFoundException and ListAliases returned nothing in that
namespace. Nothing declares these keys in a template, which is what made
their absence costly to diagnose. A module that leaves a service's
encryption at its default resolves one through a data source and fails at
plan time.
The catalog is data, in kms/aws-managed-keys.yaml, following the IAM
managed policy catalog: adding a service is a line there. A region's keys
are minted the first time anything reads that region's alias namespace,
which is ListAliases or a lookup naming one of the reserved aliases. That
mirrors AWS, where a service's key appears once the account first uses the
service, and it keeps an unused region free. Minting is idempotent, so the
ids survive a restart against persistent storage and ciphertext encrypted
under them keeps decrypting.
These are AWS's keys, not the account's, so DescribeKey now reports
KeyManager per key instead of the constant CUSTOMER it returned before,
GetKeyRotationStatus reports true for them, and the administrative
operations AWS reserves to a key's owner are refused with
AccessDeniedException: ScheduleKeyDeletion, CancelKeyDeletion,
PutKeyPolicy, UpdateKeyDescription, EnableKey, DisableKey,
EnableKeyRotation, DisableKeyRotation, RotateKeyOnDemand, TagResource and
UntagResource. The alias/aws/ namespace is reserved too: CreateAlias under
it is rejected with InvalidAliasNameException, and UpdateAlias or
DeleteAlias against one of these aliases with AccessDeniedException.
Cryptographic operations are unaffected, which is the point of the keys
existing.
Two deliberate simplifications, both documented: the key policy is the
standard account-root policy rather than the service-principal policy with
a kms:ViaService condition AWS attaches, and AWS distinguishes some of
those refusals as unsupported operations rather than access denials.
* fix(kms): seed only AWS managed keys, and rebuild them if the key store is lost
Five corrections to the alias/aws/* catalog and the code that mints it.
The catalog went from 40 entries to 23. An AWS managed key lives in the
customer's account and has an alias/aws/<service> alias; an AWS owned key
lives in an AWS-owned account and has no alias there, so DescribeKey on it
fails against a real account. Seeding the second kind makes a call succeed
here and fail against AWS, which is the worst error this emulator can
produce: a module looks compatible when it is not, and nothing reports it.
Seventeen entries could not be sourced to a customer-account context and
are gone, EKS among them, whose API-data envelope encryption uses an AWS
owned key by default. The YAML header now states the managed-versus-owned
test so the next line added has a bar to clear.
Minting is gated on the alias being present and the key that alias targets
being present, not on the alias alone. The two stores are different files
and PersistentStorage quarantines an unreadable one and starts that store
empty by itself, so a lost kms-keys.json used to leave every alias dangling
for the life of the instance: ListAliases advertised alias/aws/s3 while
DescribeKey on it reported NotFoundException. The catalog is in the
repository, so this is the one part of a damaged store that can rebuild
itself, and now it does.
ListKeys mints too. Real AWS returns the AWS managed keys from ListKeys
unconditionally, and a caller that reads ListKeys, then DescribeKey, then
filters on KeyManager saw them or not depending on whether something else
had read the alias namespace earlier in the same process.
Both stores are written once per region as a batch instead of once per
entry. PersistentStorage.put serialises the whole map, so the old path cost
two whole-file rewrites per catalog entry on the first read of every region,
while holding the mint lock. The aliases are written before the keys
deliberately: a crash between the two batches then leaves aliases whose
target is missing, which the gate above repairs, rather than keys with no
alias, which nothing repairs and which would sit in ListKeys forever.
CreateAlias and UpdateAlias no longer accept an AWS managed key as the
target. AWS excludes them, so a second alias on one of these keys is the
same false-pass shape as seeding a key AWS does not have. The refusal is
AccessDeniedException: it is an authorization outcome, the key's policy
grants the account nothing, and CreateAlias publishes no error code for
this case.
Two pre-existing tests asserted counts that ListKeys and ListAliases now
answer as AWS does; they select the customer-managed subset instead.
* docs(kms): group the AWS managed key catalog by the strength of its evidence
* fix(kms): drop alias/aws/elasticache and cite alias/aws/acm in the managed key catalog
The ElastiCache at-rest encryption guide describes the default as a
service managed key and serverless caches as using an AWS owned key; it
never names alias/aws/elasticache, so the entry failed the catalog's own
bar. The KMS ListAliases API reference prints alias/aws/acm with a
TargetKeyId in its example output, so acm joins the cited group.
* refactor(kms): fold requireCustomerManagedTarget into requireCustomerManaged
The two helpers had identical bodies. Also narrow the ensureAwsManagedKeys
Javadoc: writing aliases before keys helps only for a crash between the
two batches; losing kms-aliases.json alone still mints fresh keys and
orphans the old ones.
* fix(kms): refuse CreateGrant on AWS managed keys
An AWS managed key's policy allows kms:CreateGrant only via the owning
service (kms:ViaService), never to the account directly, so a direct
CreateGrant now gets AccessDeniedException like the other administrative
refusals.
* test(kms): concurrent cold reads mint each AWS managed key once
Sixteen threads read ListAliases on a cold region at once; the key store
must hold exactly the catalog's keys and each reserved alias must appear
once. Replacing the awsManagedKeyLock monitor with a fresh Object makes
this fail (138 keys minted against a 25-entry catalog).
* fix(kms): register the AWS managed key catalog for native and re-point squatted reserved aliases
- Add kms/*.yaml to quarkus.native.resources.includes. AwsManagedKeys reads
kms/aws-managed-keys.yaml through a constant, which native resource
analysis cannot follow (NativeImageResourceIncludesTest).
- Reconcile a reserved alias as present only when its target is an AWS
managed key. A store persisted before alias/aws/ was reserved could hold
alias/aws/s3 on a customer key, which DescribeKey then reported as
CUSTOMER and the AWS managed key guards let through.
- When the alias store is lost but keys survive, re-alias the surviving
AWS managed keys by description instead of minting a duplicate set.
* docs(kms): cite the sqs, sns, ses, s3 and ebs managed aliases
* feat(eks): name cluster nodes after their EC2 instance
* fix(eks): prune legacy hostname nodes on finalize and test container recreation
* fix(eks): preserve active nodes when pruning legacy cluster nodes
* fix(eks): delimit jsonpath node records with newline outside condition range
* fix(eks): name nodes using EC2 private DNS name format and align synthetic instance
* fix(eks): implement DnsRecordSource to resolve node private DNS names
* fix(eks): prevent VPC forwarding rules from bypassing node private DNS resolution
* fix(eks): scope node DNS system rules to matching VPC only
* feat(lambda): bound the warm pool globally with LRU eviction
Adds warm-pool-max-per-function (replaces the hardcoded max(4, cpus)) and warm-pool-max-total (0 = unbounded). When the total would be exceeded, the least-recently-used idle container of any function is stopped before the released one is pooled, so the function that just ran keeps its container. Busy containers are not counted; their ceiling is region-concurrency-limit.
WarmPool now takes a Clock so LRU order and the idle sweep are testable without sleeping.
Closes#4682
* fix(lambda): warn when warm-pool-max-total is negative instead of treating it as unbounded
Math.max(0, value) turned -1 into 0, the documented opt-out, so a mistyped cap silently restored the unbounded pool. Resolve it like warm-pool-max-per-function: a negative value is logged and the total stays unbounded.
* docs(lambda): state the warm-pool peak bound per region
region-concurrency-limit applies independently in each region while warm-pool-max-total is emulator-wide, so a single sum understated peak container count with more than one active region. Describe the cap as an idle-only, emulator-wide bound and the peak as the cap plus in-flight invocations across every active region. Also document that a negative value is ignored with a warning.
* fix(lambda): do not stop a drained container again from the global cap eviction
evictIdleBeyond snapshots each idle deque, then removes the chosen handles under the pool lock. drainEnvironment and drainFunction detach the deque from the pool and stop its contents themselves, so a drain between the snapshot and the removal left the eviction holding the orphaned deque: remove(handle) still returned true and the container was stopped a second time. Check the deque is still the live one for its environment before removing from it.