Commit Graph
520 Commits
Author SHA1 Message Date
TATSUNO “Taz” Yasuhiro 6e6ce61eea feat(lambda): durable function chained invokes (#5164)
* feat(lambda): durable function chained invokes

A CHAINED_INVOKE operation runs another function. A durable target
needs a version or alias and runs as its own durable execution with a
random name; its close completes the operation as SUCCEEDED, FAILED,
TIMED_OUT ("CHAINED_INVOKE timed out after N seconds.") or STOPPED. Any
other function is invoked once, and an output over 1 MB fails the
operation. A missing function or an unqualified durable one fails the
operation at once. Stopping the parent leaves the child running.

A plain chained invoke lost with the process runs again after a restart,
and a durable child that closed before its report reaches the parent
reports then.

* fix(lambda): close the gaps in durable chained invokes

A durable child that closes during a restart reports to its parent
under its own lock, and recovery triggers an execution once. A durable
target invoked without Payload starts its child with no input, while a
plain target gets {}. A target started in the batch that closes the
execution still runs and its result is ignored, as on AWS.

* fix(lambda): reject a chained invoke of another account or region

AWS rejects the checkpoint with InvalidParameterValueException "Cannot
start a CHAINED_INVOKE on a function in another account." or "... in
another region." Cross-account chained invocations are not supported.

* fix(lambda): keep durable chained invokes across a crash

The parent is saved before the child it starts, so a crash in between
leaves no child the parent does not know. On restart a child the parent
recorded but the store lost is started again under the same ARN, and a
plain target started by the checkpoint that closed the execution runs
again until its result is recorded. A child reports only to the
operation that started it.

* fix(lambda): recreate a lost durable child on the version its ARN names

An alias the chained invoke named may point to another version after a
restart, and a child recreated there would not match the ARN the parent
saved.
2026-10-06 08:17:51 -04:00
Priamo Germosen 9c0102559d feat(iam): model service-specific credentials (#5084)
Adds CreateServiceSpecificCredential, ListServiceSpecificCredentials,
UpdateServiceSpecificCredential, ResetServiceSpecificCredential and
DeleteServiceSpecificCredential, the five the wire model defines.

A credential takes one of two shapes, decided by the service: CodeCommit and
Keyspaces get a ServiceUserName and a ServicePassword, while the long-term API
key services get a ServiceCredentialAlias and a ServiceCredentialSecret and
accept CredentialAgeDays. The quota is two per service rather than two per user,
and the version behind a service user name's +n suffix is the lowest one free
rather than a count, so deleting out of order cannot mint a name already in use.

A credential blocks DeleteUser until it is removed, the last item on AWS's list
of what to delete first, and follows the user across an UpdateUser rename.
2026-10-05 22:57:54 -05:00
Kenshin Okinaka 3f6fb371d1 feat(ses): add the S/MIME identity certificate operations (#5111)
* feat(ses): add the S/MIME identity certificate operations

Implement AssociateEmailIdentityCertificate,
DisassociateEmailIdentityCertificate and ListEmailIdentityCertificates
as a control plane only: associations are stored per region and Floci
never signs mail.

Request validation, messages and precedence follow real SES: a domain
identity needs a FromAddress in the domain or a subdomain, one
certificate per address regardless of case, the request members are
checked before the identity, and the certificate is not inspected on
association. The reported status is Floci's own rule: ACTIVE while the
ARN names an issued, unexpired ACM certificate (with its expiry as
CertificateExpiryTime), FAILED otherwise. Disassociation is immediate
and idempotent, and the list pages through SesListPaging.

DeleteEmailIdentity now refuses an identity that still has a
certificate associated, as SES does. The v1 DeleteIdentity and
DeleteVerifiedEmailAddress share the identities and refuse it too.

* fix(ses): apply the documented S/MIME certificate requirements

ListEmailIdentityCertificates now reports ACTIVE only when the
association meets the SES Developer Guide's S/MIME certificate
considerations: the identity is verified, and the certificate is
currently valid, has an allowed key (RSA 2048/3072/4096 or EC P-256,
P-384, P-521, read from the certificate itself since ACM's stored key
algorithm folds other sizes into those) and an RFC822Name SAN equal to
the From address, case-sensitively. The docs link that section instead
of calling the criteria undocumented.

* fix(ses): require an email-signing end-entity S/MIME certificate

A probe against SES found requirements beyond the Developer Guide's
list: a CA certificate fails even with the right usages, and the
certificate needs both a key usage including digitalSignature and an
extended key usage including emailProtection, while other usages may
sit alongside them. ListEmailIdentityCertificates now applies them, and
the docs list them next to the guide's link.

* refactor(ses): reuse SesIdentityService's verified-identity check
2026-10-05 20:24:51 -04:00
David f157d354f2 feat(rds): Aurora custom cluster endpoints (#5090)
Serve CreateDBClusterEndpoint, DescribeDBClusterEndpoints,
ModifyDBClusterEndpoint and DeleteDBClusterEndpoint.

A custom endpoint is stored per Region with the rules from the API
reference and the Aurora user guide: type READER or ANY, a static or an
exclusion member list but not both, members that are instances of the
cluster, no writer in a READER endpoint, an RDS identifier stored lower
case and unique in the Region, and at most five per cluster. Its ARN
(cluster-endpoint:<id>) works with the tagging actions.

DescribeDBClusterEndpoints lists each cluster's built-in WRITER and
READER endpoints with its custom ones, and supports the cluster and
endpoint identifiers, the four documented filters and paging. Deleting a
cluster deletes its custom endpoints, and a deleted instance drops out of
the member lists.

Custom endpoints are modelled, not routed: one reports the cluster's own
endpoint host, so connections through it go where the cluster endpoint
sends them.

Closes #5072
2026-10-05 14:48:06 -04:00
Mario Toffia 4be8309e8d feat(cloudformation): provision AWS::IoT::Authorizer (#4830)
* test(cloudformation): cover AWS::IoT::Authorizer against AWS

* feat(cloudformation): provision AWS::IoT::Authorizer

CloudFormation stubbed AWS::IoT::Authorizer with a fake ARN and created
nothing. IotAuthorizerCfnProvisioner now creates a real authorizer
through IotAuthorizerService.

Ref is the authorizer name and Fn::GetAtt Arn the ARN. A missing
AuthorizerFunctionArn fails with the registry's model validation error
before any call. Status, EnableCachingForHttp, AuthorizerFunctionArn and
the token settings update in place, sending only the declared
properties, tags are reconciled, and a failed stack update restores
them from a snapshot. Changing AuthorizerName or SigningDisabled
replaces the authorizer and deletes the old one once the update
commits; a replacement that keeps an explicit name is refused. Delete
deactivates the authorizer first and tolerates one already gone.

Closes #4822

* chore(cloudformation): move the IoT authorizer snapshot constant

It sat at the same insertion point as other pull requests' snapshot constants, so they could not be merged together.

* fix(cloudformation): treat only an empty intrinsic result as AWS::NoValue for IoT authorizers

* fix(cloudformation): undo an IoT authorizer update whose tag reconcile fails

* fix(cloudformation): report a SigningDisabled change on an IoT authorizer as a replacement

* fix(cloudformation): create an IoT authorizer over a dispatcher stub and refuse declaring its generated name

* fix(cloudformation): refuse an IoT authorizer boolean that is neither true nor false

* fix(cloudformation): never delete a dispatcher stub's id in replacement cleanup

* fix(cloudformation): tell a stub from a migrated resource and roll back a stub migration that kept its id

* fix(cloudformation): name an unnamed IoT authorizer <LogicalId>_<12 chars> as CloudFormation does
2026-10-05 14:37:54 -04:00
vamsiakandVamsi Akavarapu d508a4e197 fix(apigateway): return embedded resource methods (#5109)
* fix(apigateway): return embedded resource methods

* fix(apigateway): guard method maps during concurrent reads

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-05 11:44:40 -04:00
TATSUNO “Taz” Yasuhiro a1ed65c51d feat(lambda): durable function callbacks (#5100)
* feat(lambda): durable function callbacks

A CALLBACK operation started at checkpoint gets a callback id that
SendDurableExecutionCallbackSuccess, Failure and Heartbeat complete or
keep alive, after which the function is invoked again to see it.
TimeoutSeconds and HeartbeatTimeoutSeconds time it out with
Callback.Timeout or Callback.Heartbeat. A completed, timed out or
stopped callback answers CallbackTimeoutException, an unreadable id
"Invalid callback id". The callback id carries the execution ARN, which
IAM authorizes the callback actions against.

Option range errors now name the update, as AWS does
("updates.1.member.waitOptions.waitSeconds").

* fix(lambda): name a repeated durable update as AWS does

AWS rejects two updates of one operation in a batch, other than a START
closed by its STEP or CONTEXT action, with "Cannot update the same
operation twice in a single request."

* fix(lambda): leave a durable execution waiting after a body-less callback failure

AWS marks a callback failed with an empty request body as FAILED but does
not invoke the function again, so the execution keeps waiting. The SDKs
send {} when Error is omitted, which does invoke it.

* fix(lambda): bound a durable callback failure's error at 1 MB

AWS rejects an Error over 1048576 bytes, measured as compact JSON, with
InvalidParameterValueException "Error object size must be less than or
equal to 1048576 bytes."

* test(lambda): keep a pending durable callback across a restart

* fix(lambda): reject a durable callback failure body that is not a JSON object

AWS treats only an empty body as a failure with no Error. Whitespace,
null or broken JSON get 400 SerializationException and leave the
callback open.

* docs(lambda): note the durable callback result limit AWS enforces
2026-10-05 10:27:50 -04:00
Aniket Shukla a6df1dbb12 fix(cloudformation): apply stack tags during updates (#5031)
* fix(cloudformation): apply stack tags during updates

* test(cloudformation): cover tags-only and failed stack updates

* fix(cloudformation): distinguish empty tags from omitted tags

* fix(cloudformation): reject implicit CREATE with previous template

* test(cloudformation): validate stack tag updates with AWS SDK

* test(cloudformation): fail on SDK cleanup errors

* fix(cloudformation): allow previous template with omitted type
2026-10-05 10:20:35 -04:00
Aniket Shukla b988a061b4 fix(apigateway): preserve and update method response parameters (#5030)
* fix(apigateway): preserve and update method response parameters

* fix(apigateway): serialize method response patches and decode header paths

* fix(apigateway): return created for method response updates
2026-10-05 09:38:09 -04:00
Kenshin Okinaka 1d44b5fc7c feat(ses): add UpdateConfigurationSet and MessageSecurityOptions (#5092)
The SES v2 model release of 2026-09-01 (botocore 1.43.86) added
UpdateConfigurationSet, a partial update whose only member is
MessageSecurityOptions, the S/MIME signing scheme of a configuration
set. CreateConfigurationSet accepts the same member and
GetConfigurationSet returns it.

Floci stores and returns the setting but never signs a message. Where
the API reference is silent, the request handling follows what SES
answered in us-west-2: an absent SigningScheme leaves the stored value
alone, an empty one resets it to DefaultScheme, both union members
store SmimeScheme, and a missing SignatureFormat stores DETACHED.
2026-10-05 01:06:59 -04:00
TATSUNO “Taz” Yasuhiro 6a3bc12769 feat(lambda): run durable functions with checkpoints, waits and step retries (#5047)
* feat(lambda): run durable functions with checkpoints, waits and step retries

Invoking a durable function starts a durable execution, through Invoke or through an ARN (EventBridge, Scheduler, function URLs, destinations). The function checkpoints through CheckpointDurableExecution and GetDurableExecutionState, and Floci re-invokes it when a wait or a step retry comes due. GetDurableExecution, GetDurableExecutionHistory, ListDurableExecutionsByFunction and StopDurableExecution read and stop executions. Timers are persisted deadlines fired by a background sweep, so an execution survives a restart. Callbacks and chained invokes are rejected at checkpoint time.

* fix(iam): authorize durable execution actions against the owning function

A durable execution route has no /functions/ segment, so its resource fell back to *. The function name now comes from the execution ARN in the path.

* fix(lambda): keep durable executions inside their account

The execution APIs took the account from the ARN in the path, so another account could read or stop an execution. An ARN of another account is now ResourceNotFoundException.

* fix(lambda): limit the error size of an EXECUTION checkpoint too

* fix(lambda): reject an EXECUTION close that carries the other result kind

AWS rejects SUCCEED with an Error and FAIL with a Payload on the EXECUTION operation, as it does for steps.

* fix(lambda): spend a durable wake-up when a failed invocation schedules its retry

* fix(lambda): keep a durable crash retry's backoff across a restart

* fix(lambda): bound the durable execution locks

A lock per execution ARN was kept forever, even for an ARN that did not exist. A fixed set of striped locks replaces it. Locks are never nested, so a shared stripe cannot deadlock.

* fix(lambda): accept PAUSED, PAUSING and DELETING as durable status filters

AWS accepts them and answers an empty list, since Floci never puts an execution in those states.

* fix(lambda): reject a non-finite durable list timestamp

* test(lambda): resume a durable execution from its JSON file after a restart

* fix(lambda): keep durable executions inside their region

An execution ARN of another region now answers ResourceNotFoundException "Function not found", as AWS does, instead of reaching the execution past the IAM check of the request region.

* fix(lambda): validate durable list parameters before an empty status filter answers

Statuses of only PAUSED, PAUSING or DELETING still checks MaxItems and Marker, as AWS does. The bad Marker message is "Invalid Marker".

* perf(lambda): skip the execution scan for a status filter that matches nothing

Statuses of only PAUSED, PAUSING or DELETING now checks MaxItems and Marker without listing the account's executions.

* test(lambda): drop durable tests that repeat other coverage

The in-memory restart test repeats the persistence test, and the Docker success case repeats the compat suite's checkpoint loop. The Docker test keeps the failure case.

* fix(lambda): re-attach a durable execution name only on the same version

AWS keeps execution names unique per function across versions. A sync Invoke of another version with the same name and payload is DurableExecutionAlreadyStartedException, not the existing execution.

* chore(lambda): simplify the durable execution engine

Drop stored fields nothing reads, share the unseen-operations and
page-cursor helpers, skip the name scan for a generated name, and save
an execution once per invocation instead of twice.

* fix(lambda): reject a non-integer durable MaxItems as AWS does

AWS answers MaxItems=x on the durable execution APIs with
SerializationException "'x' can not be converted to Integer".

* docs(lambda): list the durable execution size limits as not emulated

* fix(iam): authorize durable execution actions against the execution ARN

The durable execution actions take the durable execution resource,
function:name:version/durable-execution/name/id. A role allowed on
function:name:* may checkpoint, one allowed only on the unqualified
function ARN is denied.

* fix(lambda): answer an unknown durable execution on checkpoint as a bad token

CheckpointDurableExecution and GetDurableExecutionState do not model
ResourceNotFoundException. AWS answers InvalidParameterValueException:
"Checkpoint token is not valid for the durable execution ARN" for a
token minted for another execution, "Invalid checkpoint token" otherwise.

* fix(lambda): replay a durable checkpoint retried with the same ClientToken

AWS answers a retry of the last checkpoint with the same ClientToken
with the same state and a usable next token, even though the request
token is spent. A different ClientToken, a retry after the next
checkpoint, or a retry of the checkpoint that closed the execution is
still an invalid checkpoint token.

* fix(lambda): validate durable list filters as AWS does

ListDurableExecutionsByFunction takes one status at most and answers
more with InvalidParameterValueException "Cannot filter by more than one
status". An unreadable StartedAfter or StartedBefore is
SerializationException "'<value>' can not be converted to Date", and a
plain date is accepted. Type errors come first, then MaxItems and status
values, then the single-status rule, then the function lookup.

* docs(lambda): note the history IncludeExecutionData default

* fix(lambda): report durable MaxItems and Statuses errors as AWS does

AWS puts an invalid MaxItems and an invalid Statuses into one
ValidationException ("2 validation errors detected: ...; ..."), MaxItems
first. A negative MaxItems must be greater than or equal to 0. MaxItems
is checked before the execution or function is looked up.

* refactor(lambda): share one durable execution ARN pattern with IAM

IAM and the durable execution service now recognize an execution ARN
with the same pattern, the one AWS validates it with.

* fix(lambda): replay a durable checkpoint answer as it was sent

On AWS a retry with the same ClientToken returns the operations as the
first answer had them: a WAIT stays STARTED in the retry even after it
has elapsed, while a fresh checkpoint reports it SUCCEEDED.
2026-10-04 20:08:39 -04:00
Matheus Oliveira c6304a26c8 feat(cloudformation): provision AWS::Transfer::User (#5076)
* feat(cloudformation): provision AWS::Transfer::User

Adds the user type to TransferCfnProvisioner with in-place update and replacement.

* Fix #4655

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

* docs: count the IAM SSH public key operations in the service matrix

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

---------

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-04 18:19:43 -04:00
Mario Toffia fabcd6baf8 feat(iot): manage custom authorizers (#4826)
* 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.
2026-10-04 17:20:12 -04:00
Mario Toffia 2749cd6fcd feat(cognito): provision user group attachments (#4806)
* 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
2026-10-04 17:00:35 -04:00
Vũ Thế Huy 99a6b4050c feat(redshift-serverless): add running workgroups and Data API WorkgroupName support (#5012)
* 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
2026-10-04 15:34:24 -04:00
Mario Toffia 66f04cde25 feat(eventbridge): provision AWS::Events::Archive (#4818)
* 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.
2026-10-04 13:39:49 -04:00
Priamo Germosen fe296fda69 feat(iam): model SSH public keys (#5051)
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.
2026-10-04 10:37:38 -05:00
TATSUNO “Taz” Yasuhiro ace5cbfc63 chore(style): replace var in more files no open PR touches (#5071)
* chore: replace var with explicit types in src/main files no open PR touches

* chore: replace var with explicit types in src/test files no open PR touches

* chore: replace var with explicit types in sdk-test-java files no open PR touches
2026-10-04 10:08:48 -05:00
David 82977a7f03 feat(emr): resize instance groups and fleets, list bootstrap actions (#4900) 2026-10-04 09:52:41 -04:00
Vũ Thế Huy 06ceec2aee feat(redshift): materialize Glue external tables into PostgreSQL (#4996)
* feat(redshift): materialize Glue external tables into PostgreSQL

Add ExternalTableMaterializer, which loads a Glue-backed external table
into the cluster's PostgreSQL through a staging table, plus
SpectrumCatalogResolver (Glue binding first, phase-one catalog as a
fallback) and SpectrumGlueCsvAdapter (simple CSV tables keep the
streaming path and need no floci-duck sidecar).

The bound IAM role is enforced for every S3 object read, including
Iceberg metadata, manifests and data files, before DuckDB sees them.
SpectrumS3Reader now reads through the role as well, so a phase-one
external schema needs a real role associated with the cluster.

Spectrum semantics: hidden files and folder markers are ignored, a
partitioned table without registered partitions returns no rows, and a
sized string value wider than its column in bytes becomes NULL.

Also: PartitionProjection accepts IN lists for injected columns and
checks each table alias, S3Service hides the Spectrum scratch bucket from
ListBuckets, S3TransferException becomes public, and
FLOCI_SERVICES_REDSHIFT_SPECTRUM_MAX_ROWS is added.

* fix(redshift): harden external table loads against review findings

- A session outside a transaction waits for a slow load instead of
  failing after 30 seconds; only a session in a transaction keeps the
  timeout, since it can hold a PostgreSQL lock the Java lock cannot see.
- A missing S3 bucket is reported as XX000, not as access denied.
- A load failure goes to the log with its cause and returns a generic
  message, because the cause can carry DuckDB request text.
- The partition fingerprint includes input format and SerDe, so a format
  change at the same location reloads the table.
- A partition value wider than its sized string key becomes NULL, as a
  data column does, instead of failing the whole load.
- The first load of an account removes scratch objects left by a JVM
  that died mid-load, keeping those younger than an hour.
- Document why the phase-one reader enforces the role without the
  cluster association check.

* fix(redshift): use a real IAM role in the Spectrum compat test

The external schema now enforces its IAM role, so the compat test needs a
role that exists, trusts redshift.amazonaws.com and is associated with the
cluster. Create it through the IAM SDK client, pass it to CreateCluster and
delete it in the cleanup.

* fix(redshift): address review findings on the external table materializer

- PartitionProjection: a table name must end at an identifier boundary, comma
  separated sources are checked like FROM and JOIN sources, an unqualified
  injected column is accepted when exactly one source declares it, and a
  constant may be wrapped in parentheses.
- The partition fingerprint covers the whole descriptor (columns, formats,
  SerDe and parameters), and an Iceberg table is read on every query because
  its snapshot can change without any visible change to the Glue table.
- A transactional load that keeps the committed columns keeps the schema
  signature, so a view that depends on the table can still be refilled.
- Files under a hidden folder such as _temporary are ignored, not only
  hidden file names.
- The scratch bucket is told apart from a user bucket of the same name by a
  tag: a user bucket is listed, never written to, and never swept.
- Drop the SPECTRUM_MAX_ROWS row from the docs until routing makes the cap
  reachable.

* fix(redshift): verify slow-load wait with timeout
2026-10-04 09:20:44 -04:00
Hector Ventura fde5170335 test(compat): take the partition and region from TestFixtures in the last 33 suites (#5052)
Third and last batch of the cn-north-1 allowlist burn-down (#4272). The 41
remaining entries all pinned commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., arn:aws: prefix assertions, us-east-1 zones,
hosts and filter strings, and clients or signers created for us-east-1
next to the cn-north-1 fixture clients. Among them, the RDS IAM-token tests
signed their tokens for us-east-1, OrganizationsTest built its invited
account's client for us-east-1, Route53Test associated VPCs as us-east-1
that live in the fixture region, and SesEventPublishingTest failed in setup
on a us-east-1 event bus ARN.

All 33 classes now derive those values from TestFixtures, so the allowlist
is empty: any failure in the China nightly fails the run.
2026-10-03 23:46:21 -04:00
Hector Ventura 7ff3363899 test(compat): run the Marketplace Entitlement and Agreement tests in every region Floci serves (#5050)
Since #5028 Floci serves Entitlement in us-east-1, cn-northwest-1 and
eusc-de-east-1, and Agreement in us-east-1, the three ISO regions and
eusc-de-east-1. The compat guards still skipped both tests outside
us-east-1; they now take the same region sets, so a run in those regions
exercises the wider support.
2026-10-03 23:17:05 -04:00
Abhigya ae3adfe992 fix(apigateway): validate and cache REST Lambda authorizers (#5002)
* fix: evaluate and cache REST Lambda authorizer policies

* fix: share REST request context and complete parameter mappings

* fix: prevent stale REST authorizer caching after stage flush

* fix: use valid authorizer policies in REST import tests

* chore: align API Gateway imports with repository style

* fix(apigateway): isolate authorizer contracts and validate cached identities

* chore(apigateway): align restored context code with style guide

* chore: order API Gateway SDK test imports
2026-10-03 21:54:36 -04:00
Hector Ventura 6deb0d4d2b test(compat): run the China-absent tests per partition instead of allowlisting them (#5027)
* test(compat): run the China-absent tests per partition instead of allowlisting them

Third batch of the cn-north-1 allowlist burn-down (#4272): the 13 tests that
exercised something AWS does not offer in China. Seven keep running there
with the China shape:

- S3Test: only the us-east-1 endpoint creates a bucket in another region, so
  elsewhere the location-constraint round trip names the client's own region.
- StsTest: the SAML assertion's Recipient is the partition's console sign-on
  URL (the CDK region facts), signin.amazonaws.cn in China.
- Ec2Tests: China names its interface endpoint services cn.com.amazonaws, so
  the S3 gateway and interface offerings are two services there.
- IamTest: GetAccountSummary reports GlobalEndpointTokenVersion only in the
  commercial partition, the one with a global STS endpoint.

Six skip where the service has no endpoint: the five Marketplace tests (the
regions botocore publishes for each) and Lightsail (commercial only).

The allowlist's China-absent section is gone, 13 entries, 73 to 60.

* test(compat): derive VPC endpoint names from the DNS suffix and keep Marketplace guards to us-east-1

The ECR interface service is named under the partition's DNS suffix reversed
in every China, EUSC and ISO region (eu.amazonaws, gov.ic.c2s, ...), not only
in China, so describeVpcEndpointServices now takes that prefix from the SDK's
partition metadata. S3 keeps the China-only split, the only regions where
AWS lists it.

Floci serves Marketplace Agreement and Entitlement only in us-east-1, so
their guards no longer admit the other regions AWS runs them in; widening
both is a separate change.
2026-10-03 17:53:57 -04:00
Priamo Germosen 290f952cb1 feat(iam): model signing certificates (#5024)
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.
2026-10-03 15:46:37 -05:00
Mario Toffia ae0a591bb1 feat(cognito): provision user pool users (#4805)
* 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
2026-10-03 15:15:50 -05:00
TATSUNO “Taz” Yasuhiro bdab4448d6 perf(kms): drop unused BouncyCastle curves from the native image (#4868)
* perf(kms): build the KMS curves directly so unused BouncyCastle curves leave the native image

Any BouncyCastle named curve lookup reaches every curve the tables know,
including the binary SecT curves. BcEcKeys now builds the five curves KMS
uses from their own BouncyCastle classes and encodes keys itself, in the same
DER layout as before. RsaKeyType builds the PSS signer's key parameters from
the JDK key instead of going through BouncyCastle's key factories.

* test(compat): cover the KMS key paths that call BouncyCastle directly

secp256k1 signing, EC key import for every curve, and RSA PSS digest signing
had no test in the suite that runs against the native image.

* chore(kms): note where each curve generator comes from
2026-10-03 15:05:07 -05:00
Mario Toffia 9e178d77a0 feat(wafv2): provision web ACL associations (#4804)
* 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
2026-10-03 15:01:18 -05:00
Hector Ventura dfe2117fed test(compat): take the partition and region from TestFixtures in five more suites (#5025)
Second batch of the cn-north-1 allowlist burn-down (#4272). These tests pinned
the commercial partition, so they failed against a China deployment for the
test's own reasons, not Floci's:

- AppSyncTest asserted the arn:aws:appsync: prefix on four ARNs.
- Ec2DescribeSpotPriceHistoryTest filtered on us-east-1a and us-east-1b.
- PipesTest built its role, SQS and Kinesis ARNs in arn:aws and us-east-1.
- IamTest looked its user up by an arn:aws ARN; its AWS managed-policy prefix
  and the SimulatePrincipalPolicy source now follow the partition too.
- CloudWatchLogsMetricFilterTest replaced the recorded @aws.region dimension
  with us-east-1, and MetricFilterQueryAssertions signed its Query request for
  us-east-1, so it read another region's metrics.

All now derive the partition and region from TestFixtures. The allowlist drops
19 entries, from 73 to 54.
2026-10-03 15:54:55 -04:00
David 9c49ecf255 feat(rds): restore DB instances and clusters to a point in time (#4963)
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
2026-10-03 15:43:02 -04:00
TATSUNO “Taz” Yasuhiro 823f8751de feat(lambda): store DurableConfig on functions (execution later) (#5007)
* 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
2026-10-03 14:35:12 -05:00
Aniket Shukla ba944df922 fix(cloudformation): resolve change sets by ARN without stack name (#4885)
* fix(cloudformation): resolve change sets by ARN without stack name

* test(cloudformation): verify change set ARN execution with SDK

* test(cloudformation): wait for change set execution status

* fix(cloudformation): tighten change set ARN validation tests
2026-10-03 15:25:07 -04:00
Hector Ventura fa30cd7834 test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests (#5017)
* test(compat): take the partition and region from TestFixtures in SES and SSO Admin tests

The cn-north-1 nightly allowlists 25 cases in SesTagResourceTest,
SsoAdminAccountAssignmentTest and SesConfigurationSetEventDestinationTest
that fail only because the tests pin commercial values: ARNs built as
arn:aws:<svc>:us-east-1:..., the arn:aws: AWS-owned SSO application
provider and managed policies, and a us-east-1 primaryRegion. Floci answers
correctly in China.

TestFixtures gains region(), partition() (from the SDK's region metadata)
and arn()/globalArn() builders, and the three classes use them. The
rejected-bus cases move from @CsvSource, which only takes constants, to a
@MethodSource whose mismatched-region bus is another region of the fixture
partition. The 25 entries leave the allowlist (98 to 73). Part of BL-020.

* test(compat): keep the SES bus rejection cases running in a single-region partition

Greptile on #5017: the method source threw when the fixture partition has no
second region (aws-eusc and aws-iso-e list one), so the custom-bus and
mismatched-account cases, which need no second region, never ran there. The
other region is now optional: the two cases always run, and only the
mismatched-region case is left out of a single-region partition.
2026-10-03 14:12:29 -04:00
vamsiakandVamsi Akavarapu a18aa246d3 fix(eventbridge): preserve target role ARN configuration (#4946)
* fix(eventbridge): preserve target role ARN configuration

* fix(eventbridge): handle stored targets without an ARN

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-03 09:42:03 -04:00
Priamo Germosen d0c7c23f6b feat(iam): model server certificates (#4975)
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.
2026-10-02 23:51:47 -05:00
Vũ Thế Huy 543f01618f fix(ecr): support image scanning configuration updates (#4928)
* 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.
2026-10-03 00:01:40 -04:00
Kenshin Okinaka ef9ed50742 feat(ses): apply the ListContacts filter (#4981)
* 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
2026-10-02 20:32:49 -04:00
TATSUNO “Taz” Yasuhiro 4e842a85aa chore(style): replace var in files no open PR touches (#4789)
* chore(style): replace var with explicit types in src/main

Drop the NoVar suppressions of the src/main files that no open PR touches.

* chore(style): replace var with explicit types in src/test

Drop the NoVar suppressions of the src/test files that no open PR touches.

* chore(style): replace var with explicit types in sdk-test-java

Drop the NoVar suppressions of the compatibility test files that no open PR touches.
2026-10-02 17:45:36 -05:00
Kenshin Okinaka bb3dd2de92 feat(ses): paginate the contact, dedicated IP pool, suppressed destination and receipt rule set lists (#4877)
* 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.
2026-10-02 17:10:06 -05:00
Attila Kis 5de9b0d6c1 fix(dynamodb): match the AWS shape of the Kinesis destination responses (#4917)
DisableKinesisStreamingDestination now returns EnableKinesisStreamingConfiguration
with the precision the destination still carries, like AWS does.
Drop DestinationStatusDescription from the Enable and Disable responses. AWS carries
that member on DescribeKinesisStreamingDestination only, where it stays.
Build both responses from one snapshot taken while the call runs, so a concurrent
call on the same destination cannot change the status this answer reports.
Add an SDK compatibility test, because the SDK parses the typed response members
that handcrafted HTTP cannot check.
Document that Enable and Disable report the precision too.
2026-10-02 13:39:34 -04:00
vamsiakandVamsi Akavarapu 3ce093f208 fix(scheduler): validate expressions and target role ARNs (#4561)
* fix(scheduler): validate expressions and target role ARNs

* fix(scheduler): keep persisted weekly schedules firing

* test(scheduler): use valid role ARNs in SDK error cases

* fix(scheduler): validate rate units and format constraint errors

* fix(scheduler): match AWS validation message details

* fix(scheduler): exempt quoted model pattern from partition scan

---------

Co-authored-by: Vamsi Akavarapu <16164447+vamsiak@users.noreply.github.com>
2026-10-02 13:28:09 -04:00
David 044c700d68 feat(emr): scaling and termination policies and block public access (#4893)
Serve PutManagedScalingPolicy, GetManagedScalingPolicy,
RemoveManagedScalingPolicy, PutAutoTerminationPolicy,
GetAutoTerminationPolicy, RemoveAutoTerminationPolicy,
PutAutoScalingPolicy, RemoveAutoScalingPolicy,
GetBlockPublicAccessConfiguration and PutBlockPublicAccessConfiguration.

The managed scaling and auto termination policies are stored on the
cluster and the automatic scaling policy on its instance group, as the
JSON given. RunJobFlow and AddInstanceGroups accept the same policies
instead of dropping them, and ListInstanceGroups reports an attached
automatic scaling policy. Validation follows the API model: ComputeLimits
members and minimum not above maximum, IdleTimeout 60 to 604800 seconds,
automatic scaling only on core and task groups, port ranges within 0 to
65535. Block public access is kept per account and Region and starts at
the AWS default (public rules blocked, port 22 permitted).

The cluster mutators are synchronized, since each reads, changes and
stores the whole cluster.

Refs #4888
2026-10-02 10:37:45 -04:00
Hector Ventura c800cc375e test(compat): keep the China nightly allowlist free of an order-dependent entry (#4891)
The first Partition Compatibility run (36963820252) went red on one stale
entry: SsoAdminAccountAssignmentTest#createInstanceQuotaUsesAwsSdk passed. It
only fails when OrganizationsTest#testFullLifecycle leaves its organization
behind, which made the caller the management account for every later test,
and that happened because the organization's own assertions, including the
arn:aws: one that fails in cn-north-1, ran before the try whose finally
deletes it.

The assertions now run inside the try, so the organization is deleted however
they end, and the stale entry is gone from the cn-north-1 allowlist. Part of
#4272.
2026-10-02 09:28:41 -04:00
Vũ Thế Huy 436c15ca38 fix(sts): reject AssumeRole for roles that do not exist (#4463)
* fix(sts): từ chối AssumeRole khi role không tồn tại trong IAM

AssumeRole trước đây cấp credential cho mọi role ARN, kể cả role chưa
từng được tạo (iam:GetRole trả NoSuchEntity). Giờ trả AccessDenied như
AWS, bất kể enforcement có bật hay không; trust policy vẫn chỉ được
đánh giá khi enforcement bật. Các test cũ assume role chưa tạo được sửa
để tạo role trước.

Closes #4392

* fix(sts): so sánh chính xác role ARN và cập nhật compatibility tests

- StsQueryHandler: kiểm tra roleArn khớp chính xác role.getArn() để tránh chấp nhận role cùng tên khác path

- StsQueryHandlerTest: đổi tham số helper sang IamRole thay vì Optional, bổ sung test case từ chối role khác path

- AssumeRoleTrustPolicyIntegrationTest: sửa Javadoc mô tả đúng hành vi từ chối unknown role

- Cập nhật compatibility tests (Java, Node, Python, AWS CLI) để tạo role trước khi assume và kiểm tra lỗi 403 khi role không tồn tại

* fix(sts): accept partition-correct role ARNs and strictly catch cleanup exceptions

- StsQueryHandler: match role ARN structurally using AwsArnUtils to admit valid noncommercial partition ARNs

- StsQueryHandler: preserve caller partition when generating assumedRoleArn

- StsTest, test_sts.py, sts.test.ts: only ignore NoSuchEntity/EntityAlreadyExists in cleanup, re-raising unexpected errors per AGENTS.md

- StsQueryHandlerTest, AssumeRoleTrustPolicyIntegrationTest: add unit and integration coverage for partition-correct role ARNs

* fix(sts): preserve role partition in resolved session caller ARN

* fix(sts): preserve stored role partition in assumed identity

* fix(sts): validate web identity role ARN

* fix(sts): require role existence in AssumeRoleWithWebIdentity and reuse path helpers

* fix(sts): keep IAM ARN partition behavior unchanged

* fix(sts): derive trust caller account from identity ARN

* fix(iam): migrate legacy credential reports by partition

* fix(iam): serialize legacy credential report migration

* test(iam): make credential report race deterministic

* fix(sts): address review feedback

* fix(sts): reuse IAM role path normalization
2026-10-01 13:18:07 -04:00
Kenshin Okinaka a22e65f993 feat(ses): paginate the tenant and import job lists (#4819)
* feat(ses): paginate the tenant and import job lists

Page ListTenants, ListTenantResources, ListResourceTenants and ListImportJobs
on the shared SES paging, each with its own token namespace, and delete
SesTenantService.validateListPaging. The tenant lists answer the probed SES
rules: PageSize 1 to 100 with the Smithy validation messages, an empty
NextToken refused with its Smithy message before the tenant or resource is
looked up, an unreadable token answered "Invalid Next Token", tenants listed
by name, a tenant's resources by ARN and a resource's tenants in association
order. ListImportJobs could not be probed and is modelled on the tenant lists,
keeping Floci's oldest-first order. Without a PageSize all four lists serve up
to 100, a Floci assumption where nothing could be measured.

* fix(ses): follow the probed order, aggregation and token binding on the tenant lists

A second probe of real SES showed three differences on ListTenantResources and
ListResourceTenants: the tenant or resource is looked up, and the filter
checked, before the page size and token; a page size outside the bound and an
empty NextToken are reported together in one validation message; and a token
is refused once the tenant, resource or filter changes. ListImportJobs, which
cannot be probed, follows the same rules. The service docs keep the per-list
paging detail and gain a paragraph for these four lists.
2026-10-01 13:10:03 -04:00
XuJian b2dd5665db fix(s3): validate notification destinations before storing configuration (#4747)
* fix(s3): validate notification destinations before storing configuration

* test(s3): consume validation events before POST notifications

* fix(s3): preserve bucket lifecycle during notification validation

* fix(s3): enforce SQS queue policies for notifications

* fix(s3): align notification validation with IAM enforcement

* fix(test): stub IAM config for S3 failure delivery

* fix(s3): validate cross-account SNS without test publish

* fix(sns): recognize legacy topics during destination validation

* docs(s3): describe cross-account notification validation

* fix(s3): skip cross-account SNS notification test publishes
2026-10-01 11:35:16 -04:00
Aymen JAMAAOUI bc2592e300 fix(ecs): send container logs to the awslogs group and stream from the task definition (#4808)
* fix(ecs): send container logs to the awslogs group and stream from the task definition

* fix(ecs): keep console output for containers without awslogs
2026-10-01 10:39:44 -04:00
Mario Toffia fa4d4663a2 feat(lambda): honour the Invoke Qualifier and wait between asynchronous retries as AWS does (#4733)
* feat(lambda): honour the Invoke Qualifier query parameter

* feat(lambda): wait between asynchronous retries as AWS does

A failed Event invocation now waits floci.services.lambda.async-retry-delay-seconds before its first retry and twice that before its second (default 60, matching AWS), capped at the event's remaining maximum age. The concurrency permit is held only for each attempt, and an emulator reset drops retries still waiting.

* test(lambda): prove asynchronous retries end to end

* docs(lambda): document asynchronous retry timing and the Invoke Qualifier

* fix(lambda): drop retries of deleted functions and tighten async retry edges

- Drop a pending asynchronous retry when its function (or version) was deleted.
- Decide expiry once, on the injected clock, when a retry is scheduled.
- Check the reset generation at routing, so no stale outcome is delivered.
- Restore upstream behavior when an attempt throws: stop retrying and route
  the previous result, or UnknownError when there is none.
- Harden tests: in-order permit release, deterministic reset, error types
  and an unqualified-ARN Qualifier case for Invoke.

* fix(lambda): drop a deleted function's pending events on every path

Replace the store lookup with a per-function deletion counter, captured
when the event is invoked and checked wherever an event is attempted or
routed. This covers the expiry path, which bypassed the old check, and a
delete-and-recreate of the same name during the wait, which the lookup
could not see. Verified against AWS that DeleteFunction drops pending
retries without delivering a record.

* fix(lambda): clear deletion counts before bumping the reset generation

An invoke between the two statements of clear() captured the new
generation with a stale deletion count and its event was dropped.
The expiry-path deletion test now drops inside the first attempt,
so it no longer races the one-second maximum event age.

* fix(lambda): keep deletion counts across a reset

Clearing them while the old generation was still current let a
deleted function's pending event see a zero count and be routed.
A reset now only bumps the generation, in one atomic step.

* fix(lambda): drop an Event invoke that races DeleteFunction

An Event invoke that resolved the function just before a concurrent
DeleteFunction could take its deletion-count snapshot after the delete
had already moved the count. The event then never looked stale, so the
deleted function could still be started and a failure record could
still reach its destination.

DeleteFunction now moves the deletion count only after the function has
left the store, and an Event invoke checks that the function is still in
the store after it takes its snapshot and before it queues the event.
Either the check sees the function gone and the invoke answers 202
without queueing anything, or the snapshot predates the count change and
the event is dropped as stale later.

* fix(lambda): validate the Invoke Qualifier query parameter

Invoke treated an empty or blank Qualifier as if none had been given
and ran $LATEST, and it passed a qualifier longer than 128 characters on
to the lookup, which answered 404. AWS rejects both with a 400.

A supplied Qualifier must now be 1 to 128 characters of letters,
digits, $, _ and -, or Invoke fails with ValidationException. The
controller reads the parameter from the raw query, because @QueryParam
reports a present but empty value as null and the check could not see
it.

* fix(lambda): stop pending events before a delete or reset removes state

DeleteFunction moved a function's deletion count only after it had
removed the function's code and store entry. A retry whose timer fired
in that gap still passed the staleness check, tried to start a function
with no code, and could deliver a failure record to its destination. An
attempt that finished in that gap could deliver its OnFailure record.
DeleteFunction now moves the count before it deletes anything, which
stops every queued or running event, and again after the store entry is
gone, which stops an Event invoke that read the count in between.

An emulator reset wiped storage before the executor's clear() moved the
reset generation, so a retry firing during the wipe could run or deliver
against half-cleared state. The executor now also moves the generation
in beforeReset(), which runs before the wipe. clear() still moves it, to
drop events accepted between the two.

* test(lambda): fix a doc comment and name the tolerated Docker ping failure

The class comment now reads "wait as they do on AWS". The Docker ping
check names its caught exception "expected" and says why returning
false is safe: the test is then skipped rather than failed.

* fix(lambda): count version and alias invokes against the function's reservation

Routing the Invoke Qualifier to a published version meant a qualified
invoke took its permit against the version's snapshot, which carries no
reservation, so a reserved concurrency of 0 on the function no longer
throttled it and a positive one stopped counting those invokes. The
name-qualified path (fn:1, fn:alias) already had the same gap.

Reserved concurrency is function-wide in AWS, so the executor now takes
the permit against the function's $LATEST record, which holds the
reservation. That covers direct Invoke with a Qualifier, qualified names
and ARNs, aliases, event source mappings and asynchronous retries alike.
It reads the stored record rather than the limiter's region registry
because event source pollers can invoke before LambdaService has
rehydrated that registry after a restart.

* fix(lambda): drop a deleted function's pending events before draining its containers

DeleteFunction drained the warm pool before fencing pending asynchronous
events, and draining blocks while idle containers stop. A retry whose
timer fired in that window still passed the staleness check and could
cold-start a container after the drain, leaving it warm for a function
that no longer exists. The fence now goes up first.
2026-10-01 10:00:47 -04:00
Priamo Germosen cf04f433b6 fix(iam): give a role session's aws:PrincipalArn as its role's ARN under enforcement (#4810)
Follow-up from the review of #4716.

The enforcement filter put the assumed-role session ARN
(arn:aws:sts::<account>:assumed-role/<role>/<session>) in aws:PrincipalArn for a
caller using role-session credentials. AWS puts the ARN of the role that was
assumed there, path included ("For IAM roles, the request context returns the
ARN of the role, not the ARN of the user that assumed the role", IAM User Guide,
global condition keys). So an identity or resource policy keyed on the role's
ARN never matched its sessions: an Allow scoped that way refused them and a Deny
written that way never fired, while a condition naming the session ARN, which
AWS says not to use for this key, matched.

The filter now reads both values from one lookup of the key, through a new
IamService.resolveCallerArns: the caller ARN, still the session ARN for a role
session, and the principal ARN, the role ARN the session recorded when it was
issued (#4716). A user's key and the account-root principal give the same value
for both. One lookup matters: two could straddle the session's expiry, answer
the first and not the second, and leave a fallback to fill aws:PrincipalArn
with the session ARN, so a Deny keyed on the role's ARN would miss.
resolveCallerArn and resolvePrincipalArn now read through it, and the STS trust
check, which made the same two lookups, uses it too. Both places the filter
fills the key (the request's own authorization and authorizeAdditionalResource)
take it from there. The session ARN stays the caller's principal for matching a
resource policy's Principal, which is a separate change.

docs/services/iam.md describes the key for role sessions and drops the caveat
about the session name, which no longer applies to it.

The integration test covers both paths: IAM calls whose policy is keyed on the
role's ARN, and an SSM GetParameter on a Secrets Manager reference, whose
secretsmanager:GetSecretValue check goes through authorizeAdditionalResource.
The SDK compatibility suite's IamEnforcementTest gets the same IAM checks with
AWS SDK clients; like the rest of that class it runs only against a Floci with
IAM enforcement on.
2026-10-01 07:50:19 -05:00
Mario Toffia 0a54d0708e feat(eventbridge): execute target retry and dead-letter policies (#4736)
* feat(eventbridge): execute target retry and dead-letter policies

PutTargets now validates, stores and returns a target's RetryPolicy and
DeadLetterConfig. Failed deliveries from PutEvents and scheduled rules are
retried with backoff within the configured attempts and event age, and
exhausted or non-retryable events are sent to the standard SQS dead-letter
queue with the AWS failure attributes.

* fix(eventbridge): order target retries by due time and honour a lowered retry limit

Pending retries are kept in a queue ordered by their next attempt, so each wake-up
takes only what is due instead of scanning every pending retry. The clock is read
again for each retry, so a slow target cannot let a later retry run past its event
age, and a reset mid-tick stops the remaining retries. A retry now checks the
target's current MaximumRetryAttempts before invoking it, as it already did for
MaximumEventAgeInSeconds.

* fix(eventbridge): drop a target retry that outlives a reset

An attempt still running when the emulator resets can fail afterwards. Its retry
or dead-letter delivery is now dropped, so a rule and target recreated under the
same names after the reset do not receive a pre-reset event. A scheduled retry
wake-up keeps only its due time, not the event.

* fix(eventbridge): wake a target retry at its due time after a slow attempt

The retry delay was measured from when the failed attempt started but counted from
when it failed, so every retry after a slow attempt woke late by the attempt's
duration, and an expired event reached its dead-letter queue late.

* fix(eventbridge): drop a removed target's retries and drive retries from one tick

RemoveTargets now drops the removed targets' pending retries, so a target re-added
under the same Id does not receive an event from before its removal. Pending retries
are taken by one periodic tick, as in the scheduler's dispatcher, instead of a timer
per retry, so a reset leaves no timers behind.

* fix(eventbridge): warn about a blank dead-letter queue ARN

PutTargets accepts a whitespace-only DeadLetterConfig Arn, since AWS constrains only
its length. Delivery skipped it without a word; it now gets the same WARN as any other
dead-letter queue that is not a standard SQS queue in the rule's region.
2026-10-01 07:59:18 -04:00