Commit Graph
1034 Commits
Author SHA1 Message Date
Mario Toffia c1cd5af2bd fix(ecr): advertise the registry at the published address (#4863)
ECR built repositoryUri, the GetAuthorizationToken proxyEndpoint and
the Lambda and ECS image rewrites from floci.port, the port Floci
listens on inside its own container. The Docker daemon performs login,
push and pull, and reaches Floci through the host port that container
publishes. When Floci ran as docker run -p 54321:4566, every advertised
address named port 4566 on the host, where nothing answers, so docker
login, CDK container asset publishing and ECS or Lambda image pulls
failed.

EcrRegistryManager now has advertisedPort(): the host port Floci's
container publishes for floci.port, read through the existing
CurrentContainerNetworkResolver.resolvePublishedPort as RDS does for
its proxy endpoint, or floci.port when Floci is not in a container or
the port is not published. repositoryUri (hostname and path style,
plain and TLS URI mode), proxyEndpoint and rewriteImageUri all use it.

The EKS registry mirror keys must match the URIs pods name, so they
use the same advertised port. The mirror endpoint stays Floci's
in-network address on floci.port.

The resolver now caches every published-port answer, "not published"
and a failed inspect included, as it already caches the network: a
running container's port bindings cannot change, and an inspect that
fails fails the same way next time. ECR requests therefore do not
inspect the container each time.
2026-10-08 20:11:30 -04:00
Allen Sanborn e22bd2c59a feat(ec2): support transit gateway peering attachments (#5122)
* feat(ec2): support transit gateway peering attachments

Add CreateTransitGatewayPeeringAttachment, DescribeTransitGatewayPeeringAttachments,
AcceptTransitGatewayPeeringAttachment and DeleteTransitGatewayPeeringAttachment, the
calls the Terraform provider's aws_ec2_transit_gateway_peering_attachment and
_accepter resources make. Previously each answered UnsupportedOperation.

An attachment is created in pendingAcceptance and moves to available when accepted
from the accepter's region. One attachment id serves both sides, so a cross-region
peering is visible from either region and the transit-gateway-id filter matches either
side's gateway, which is how the accepter finds it. Tags come from the shared tag
store, so CreateTags on the accepter side round-trips through describe.

* style(ec2): order the TransitGatewayPeeringAttachment import

* fix(ec2): hold peered transit gateways and accept peerings only as the peer

DeleteTransitGateway now refuses with IncorrectState while a non-deleted
peering attachment names the gateway at either end, as it already does for
VPC attachments; creation takes the same topology lock so neither lands in
between.

A peering is stored under the requester's account, so lookups search every
account's partition and admit only the two parties, as VPC peering does.
Accept requires the caller to be the accepter's account in the accepter's
region, so a requester can no longer accept its own cross-account request,
and the peer account can now see and accept it. The local-owner-id and
remote-owner-id filters are relative to the viewer's side.

* test(ec2): cover transit gateway peering attachments in the AWS CLI compatibility suite

* style(ec2): drop em dashes from the peering attachment comments

* refactor(ec2): make the peering attachment store final and pass it through the constructor

The StorageFactory constructor now hands the factory-backed store to the
terminal constructor, and the hermetic overload passes an InMemoryStorage,
the same way the other EC2 stores are wired.

* fix(ec2): clear both sides' tags when a cross-account peering attachment is deleted

Tags are per account: each party to a peering sees the tags its own account
set. Deleting the attachment cleared only the caller's, so the other
party's tags outlived it.

* fix(ec2): let a pending peering's accepter delete its transit gateway

Anyone can name any gateway as their peer, so a peering that has not been
accepted no longer holds the accepter's gateway. Deleting that gateway
declines the peering, leaving it rejected. Accepted peerings still hold
both ends, and a pending one still holds its requester's.

* fix(ec2): accept a transit gateway peering only for a gateway the accepter owns

The peer gateway is recorded unresolved at create, so an account could name
another account's gateway as the peer with its own account as PeerAccountId,
accept it, and pin that gateway against its real owner's DeleteTransitGateway.
Accepting now requires the peer gateway to exist in the caller's account and
region, the same lookup create makes for the requester's gateway.

* fix(ec2): route transit gateway peering actions to ec2 without a credential scope
2026-10-08 19:59:39 -04:00
Vũ Thế Huy dc41417e79 fix(ec2): avoid Docker waits on the first CreateVpc (#5179)
* fix: avoid Docker waits on first EC2 CreateVpc

* fix(ec2): reseed default VPC resources after a state reset

Ec2Service now implements Resettable: clear() forgets the seeded account
scopes and seeds the default region again, so a reset followed by
DescribeVpcs still returns the default VPC and subnets.

Also run Ec2CreateVpcLatencyTest in the non-mock EC2 compatibility job,
where VPC planning is active and a regression of the first-call Docker
wait would be caught.

* refactor(ec2): share one default-region seeding method between startup and reset

Ec2Startup and Ec2Service.clear() repeated the same enabled check and seed call. Both now go through Ec2Service.seedDefaultRegionIfEnabled() so they cannot drift apart. Also reorder the Resettable import.
2026-10-08 19:25:31 -04:00
Mario Toffia 8b1ece9c24 fix(ecr): retry occupied registry ports (#4857)
* fix(ecr): retry occupied registry ports

The backing registry reserved one port from the configured range and gave
up when Docker refused to publish it, although the next port was free. The
allocator's probe races `docker run`, and from inside a container it cannot
see a host process holding the port, so a refusal is expected and not fatal.

A start Docker refuses as a host-port collision now moves on to the next
port in the range; any other failure still fails at once. Refused ports stay
reserved until the start finishes so each is tried once, then are released.
When the range runs out the error names the refused ports. EC2's collision
check moves to PortAllocator so both callers share it.

Closes floci-io/floci#4856

* chore(ecr): keep the port retry tests independent of host ports

The unit tests now use an allocator that skips the host probe, so a busy
6100 or 6101 on the machine cannot change their outcome. The integration
test picks its port pair with the Docker-aware allocator, so a container
already publishing a port is skipped as well, and drops its logger.

* docs(ecr): say other registry start errors still fail at once

The paragraph said startup fails only when the range is full, but a daemon
or image failure still fails without trying another port. The exhaustion
tests now also allocate the last refused port, so releasing only some of
them fails.

* refactor(ec2,ecr): share the port retry loop in PortAllocator

Review asked for the allocate, start and retry loop itself to live in one
place, not just the collision check. PortAllocator.allocateAndStart takes
the start as a callback, moves past ports Docker refuses as in use, and
releases the refused ports when it returns. ECR and EC2 both call it.

EC2 used to mark a refused SSH port reserved for the life of the process.
It now releases it after the launch, as ECR does, so a port whose holder
goes away is usable again.

With the loop moved, a launch cancelled between attempts can now reach
the worker's failure path. When Docker is also gone that path marked the
instance running without a container, so it now goes through markRunning
and leaves a cancelled instance terminated.

* test: share one host-blind PortAllocator across the port tests

PortAllocatorTest, EcrRegistryManagerTest and the ECR port-conflict
integration test each built their own allocator that skips the host
probe. HostBlindPortAllocator replaces the three copies.
2026-10-08 15:31:03 -04:00
Mario Toffia f248eb51af fix(cloudformation): send the stack's StackId to custom resources (#4861)
AWS documents StackId in every Create, Update and Delete request as the
ARN of the stack that contains the custom resource, and handlers rely on
it. #4973 now passes the engine's stack id and stashes it for Delete, but
an engine with no stack ARN still leaks a non-ARN: Cloud Control's
standalone engine uses the stack name as its id, so its custom resources
got StackId "cloudcontrol".

A stack id is now minted when there is no stack ARN to send. A resource
created through Cloud Control has its minted id stashed at Create, so its
Delete repeats it. A resource stashed by an earlier release with no
__FlociStackId, or with a non-ARN one, gets a freshly minted ARN on
Delete, because the delete path does not reach the stack.

An integration test drives Create, Update and Delete through a mocked
handler and checks the event's StackId against Ref AWS::StackId and
DescribeStacks, including a nested stack's own id, and the docs say so.
2026-10-08 14:43:01 -04:00
Simone Primarosa 6fc957a3b4 feat(eks): join EC2 instances to a cluster as nodes (#5091)
Support joining real EC2 instances to an EKS cluster as Kubernetes nodes.
Inspect instance user data during RunInstances for bootstrap scripts or
nodeadm YAML targeting an EKS cluster, recording pending joins and
reconciling node registration asynchronously via the readiness poller.

Ensure RunInstances returns without blocking on kubectl or shared locks,
and guard storage mutations under the deletion lock so deleted clusters
cannot be resurrected. Scope restoration tracking per account.
Support AL2023 MIME multipart nodeadm configurations, and share the
in-use IP check and cursor loop between subnet and subnetless launches.

Update node metadata derivation to match AWS conventions, using instance
private DNS names for node names and aws:///<az>/<instance-id> for
provider IDs, with topology and instance-type labels.
2026-10-08 11:56:43 -04:00
Hector Ventura 0d4b8cda74 fix(route53): return the health check on a CreateHealthCheck retry (#5298)
* fix(route53): return the health check on a CreateHealthCheck retry

CreateHealthCheck refused any CallerReference already in use with
HealthCheckAlreadyExists. AWS treats the same reference with the same
settings as a retry and returns the health check it already created;
only different settings are refused. The Go SDK resends the same input
after a transient failure, so a Terraform or OpenTofu apply failed on
Floci where it succeeds on AWS. A matching retry now returns the
existing health check, and the docs note that a deleted health check's
reference is reusable at once here, while AWS keeps refusing it.

* fix(route53): compare a CreateHealthCheck retry on every setting it sends

The retry check compared only the seven HealthCheckConfig fields Floci
models, so two requests that differed in an unmodelled setting such as
EnableSNI passed as a retry, and a retry stating RequestInterval or
FailureThreshold at its default was refused as different from one that
omitted it. The controller now records the request's settings in a
canonical form, every value under HealthCheckConfig sorted (Regions and
ChildHealthChecks are sets), with an omitted RequestInterval or
FailureThreshold counted as AWS's default of 30 or 3 except for
RECOVERY_CONTROL, and a retry must match it. A non-numeric Port,
RequestInterval or FailureThreshold is now InvalidInput instead of being
dropped.

* refactor(route53): read the health check settings with XmlParser.extractElementTree
2026-10-08 11:39:52 -04:00
Vũ Thế Huy d39c7e1381 fix(s3): reject unverified credentials and malformed auth in account routing (#4825) (#5059)
* fix(s3): enforce SigV4/SigV4A algorithm prefix in AccountResolver

* fix(s3): require X-Amz-Algorithm in AccountContextFilter presigned query resolution

* fix(s3): reject malformed Authorization header in S3HeaderSignatureFilter

* fix(s3): reject query presigned requests missing X-Amz-Algorithm in PreSignedUrlFilter

* test(s3): add reproduction tests for unverified credential account routing (#4825)

* fix(s3): isolate presigned query auth and permit SigV4A headers (#4825)

* fix(s3): gate signature checks on validation setting and restore unsigned presigned steering (#4825)

* fix(s3): stop unverified credentials from selecting an account (#4825)

Account selection now requires a SigV4/SigV4A Authorization scheme or a
query string carrying X-Amz-Algorithm. A bare "Credential=" header or an
X-Amz-Credential without X-Amz-Algorithm keeps feeding region resolution
only, so it can no longer steer a request into another account.

Credentials rebuilt outside the header (IAM presigned query, presigned
POST form) now carry the AWS4-HMAC-SHA256 scheme so IAM enforcement still
recognises them. With signature validation on, a query holding only
X-Amz-Signature is rejected with AuthorizationQueryParametersError.

* fix(s3): ignore unsupported Authorization headers for region and keep credential-only download URLs working (#4825)

A header without a SigV4/SigV4A scheme now selects neither account nor
region, so it cannot misattribute S3 data events to another region.

Floci's own download URLs (Lambda layers, Kubernetes init containers)
carry only X-Amz-Credential, so that parameter steers the account and
region again without X-Amz-Algorithm.

* fix(s3): let a present Authorization header win over X-Amz-Credential in account routing (#4825)

IamEnforcementFilter reads the query credential only when no Authorization
header exists. AccountContextFilter fell back to the query whenever the
header was unrecognised, so a malformed header plus X-Amz-Credential picked
an account that IAM then skipped. Both filters now use the same precedence.

* fix(s3): treat a whitespace-only Authorization header as absent in account routing (#4825)

S3's authorization parser ignores a blank header and uses the presigned
query credential, so AccountContextFilter must do the same instead of
falling back to the default account.

* fix(iam): treat a whitespace-only Authorization header as absent in IAM enforcement (#4825)

AccountContextFilter and S3 already ignore a blank header and use the
presigned query credential. IamEnforcementFilter only checked for null, so
a blank header made it find no access key and skip authorization for the
account the query credential had selected. All three now agree.

* fix(s3): presign internal lambda download URLs

* test(macie2): include SigV4 algorithm in account routing check

* docs(s3): list the SigV4A and incomplete presigned URL 400s under signature verification (#4825)

* docs(s3): say Floci does not verify SigV4A signatures yet instead of cannot
2026-10-08 10:58:38 -04:00
Priamo Germosen df4fa58ea1 fix(iam): take service-linked role names and suffix support from AWS evidence (#5293)
CreateServiceLinkedRole guessed both things it cannot derive. The role name came
from capitalising the principal, which is wrong for 141 of the 162 services the
table covers: acm.amazonaws.com is AWSServiceRoleForCertificateManager on AWS and
was AWSServiceRoleForAcm here. And a CustomSuffix was accepted for every service,
where AWS refuses one for 68 of the 71 it has been recorded against, so the
emulator minted roles AWS would have rejected outright.

Both now come from iam/service-linked-roles.tsv, generated by
tools/slr/service_linked_roles.py and gated by make slr-check. One table, because
both facts come out of one pass over the same AWS-validated snapshot: the name
from a recorded create response, the suffix verdict from the test's own
parameterisation. Writing either by hand only captures what someone noticed, and
every finding behind this change came from grepping.

Sources, each row recording its own: recording, actual create responses and the only
source that can establish suffix support; policy-documents, role ARNs in the vendored
AWS managed policies, names only; and docs, from AWS's own service-linked role
pages, quoted and linked in the generator. Counts live in the table's header, where
this script keeps them right.

Two shapes in the policy documents have to be refused rather than read, and both
were being read. A name followed by `*` is a prefix pattern: the policy writes
AWSServiceRoleForAmazonCognitoIdpEmail* where the recorded create returns
AWSServiceRoleForAmazonCognitoIdpEmailService, so reading the prefix invents a role
AWS never mints. Twenty-one principals rested on nothing but such a prefix. And a
role name is unique per account, which these documents ignore: they point
maintenance.elasticbeanstalk at the parent's AWSServiceRoleForElasticBeanstalk, so
taking that at face value made the sibling's create fail as a duplicate of a role
it does not own. A collision guard drops the weaker row back to the derived
fallback and says so; an unresolvable collision is an error for a human.

KNOWN_SOURCE_CONFLICTS is empty as a result. Its one entry was never a
disagreement between sources, only that truncated prefix read as a name. The
mechanism stays for a real one.

make slr-check runs offline: policy-documents rows must still match the vendored
JSON, every vendored service must be in the table, it must be sorted, and a suffix
verdict on a non-recording row is an error because nothing but a recording can
establish one. Three extraction traps have a test each, all three being ones the
real data walked into: an underscore can be part of a name, so splitting on the
CustomSuffix separator truncates ApplicationAutoScaling_CassandraTable; a policy
matching suffixed roles writes the prefix with a trailing separator; and a
wildcard ARN names a role without saying which principal mints it, which is how an
earlier pass handed plain GuardDuty the MalwareProtection role's name.

The name was not only wrong against AWS, it was inconsistent within the tree.
ConnectService built an ARN for AWSServiceRoleForAmazonConnect while
CreateServiceLinkedRole minted AWSServiceRoleForConnect for the same principal:
two roles for one purpose. GuardDutyService, MacieController and RamController
each hard-coded their own name too, and all four were right where IamService was
wrong. They read the table now, and a test fails if a principal any of them builds
an ARN for loses its row, since the fallback would quietly derive a name again.

ApplicationAutoScalingService was wrong a different way. It maps a namespace to a
dimension itself, and had no arm for appstream, cassandra, ec2 or sagemaker, so
all four fell to CustomResource where AWS names them AppStreamFleet,
CassandraTable, EC2SpotFleetRequest and SageMakerEndpoint. It prefers the table
now and keeps its switch for the namespaces nothing records, where the shape is
right even when the dimension is a guess. Its dynamodb arm is gone with the rest:
the table covers that namespace, so the arm was unreachable and a second copy of a
fact the table owns, free to disagree with it while never running. A test pins
dynamodb resolving through the table, since removing the arm is what left nothing
else covering it.

Two behaviour changes worth calling out. rds.amazonaws.com is AWSServiceRoleForRDS
rather than the derived Rds, which flipped one existing expectation. And two table
names are long enough that a suffix alone breaches the 64-character RoleName
limit, ApplicationDiscoveryService's ContinuousExport role leaving three
characters and SageMakerEndpoint six, so that check now reports "The role name"
rather than "The derived role name", which stopped being true.

cloud9 is in the table because deleting IamService's three-entry override map
dropped it: autoscaling and ram were covered, cloud9 was not, and it regressed to
the derived AWSServiceRoleForCloud9. Two tests caught it. Rather than restore the
literal, which is the circular sourcing this work exists to remove, its User Guide
settles it and the row carries that citation.

The table is registered in quarkus.native.resources.includes rather than exempted
from it. AwsManagedPolicies is exempt because parsing its 3.5 MB at image build time
and keeping the result in the heap beats shipping the source twice; at 13 KB that
saving is not worth depending on the static initialiser running at build time, and
NativeImageResourceIncludesTest is the thing that says so.

The header records the sha256 of the snapshot the recording rows came from, because
that half cannot be rechecked offline and --check can only say so rather than fix
it. A digest makes the next --refresh a diff against a known source: an unchanged
digest means any difference in the table came from the vendored policy documents,
and a changed one says the recordings moved with it. --check cannot verify the
digest without the snapshot, but it does reject a table that has quietly lost the
line, or one claiming no snapshot while carrying recording rows.

Refs #5084
2026-10-08 07:49:50 -05:00
Priamo Germosen e452ce8671 feat(codeartifact): add DescribePackage for all package formats (#5308)
DescribePackage returns a package's format, namespace, name, and origin
controls, and answers ResourceNotFoundException for a package that does not
exist. Existence is checked where the package actually lives: stored
generic-format package versions for generic, and each format's sidecar for
maven, npm, and pypi. A package whose name merely starts with another's name
does not match it.

Origin controls are reported as publish ALLOW and upstream BLOCK, the default
CodeArtifact assigns to a package whose first version was published directly.
Floci never ingests packages from upstream and does not store origin controls,
so these values are fixed.

For maven, npm, and pypi the existence check starts that repository's sidecar
if it is not already running, the same side effect the asset bridge has.
RepositorySidecarManager gains packageExists, implemented by each sidecar client.
2026-10-08 07:49:38 -05:00
Clement 0848fa6a48 feat(elasticache): add user groups and associate them with replication groups (#4435)
CreateUserGroup, DescribeUserGroups, ModifyUserGroup and DeleteUserGroup
returned UnsupportedOperation, and ModifyReplicationGroup read
UserGroupIdsToAdd as user ids, so RBAC could not be set up the way AWS
and Terraform (aws_elasticache_user_group, user_group_ids) do it.

User groups are now stored resources. CreateReplicationGroup takes
UserGroupIds and ModifyReplicationGroup adds and removes user groups; the
proxy authenticates the members of a replication group's user groups, read
at AUTH time so a ModifyUserGroup applies at once, each by its own
authentication mode. A replication group with a user group associated
admits only its members, even while the group is empty. An id in
UserGroupIdsToAdd that names no user group but names a user still
associates that user directly, so existing setups keep working.

A cache uses either its AUTH token or user groups, as on AWS: while a user
group is attached the token is not accepted and AuthTokenEnabled reads
false. ModifyReplicationGroup takes AuthTokenUpdateStrategy DELETE, which
removes the token and is only allowed together with a user group, and
RemoveUserGroups. Removing the last user group leaves the cache without
access control, still encrypted in transit; a token that was never deleted
applies again. The proxy reads the cache's auth mode per connection, so
these changes take effect without a restart.

Validation follows the RBAC rules: a redis user group needs a user named
default (DefaultUserRequired), members cannot share a user name
(DuplicateUserName), valkey users only join valkey groups, a valkey group
cannot hold a no-password user or serve a redis cache, association needs
in-transit encryption, and a user group in use cannot be deleted
(InvalidUserGroupState). ModifyUser refuses an engine or authentication
change that a user group holding the user would reject. Deleting a user
removes it from its user groups.
2026-10-08 00:24:28 -04:00
Hector Ventura da53fc1c05 docs(partition): document deployment, test coverage and known gaps (#5292)
* docs(partition): document deployment, test coverage and known gaps

partitions.md said every partition-dependent rule had integration tests
over all eight partitions and that the China compat allowlist only
shrinks. Neither is accurate now: most services are tested in China
alone, and the allowlist is empty. The page now states the coverage as
it is (unit tests over every partition, IAM, Step Functions and the
cross-service smoke test through the emulator, China end to end), gives
a recipe for running a China, GovCloud, ISO or EUSC deployment, and
lists the known gaps: global state shared across partitions in one
process (now naming the Identity Center instance, which the smoke
test's inventory exempts for that reason), the commercial managed-policy
catalog, and client tooling untested outside the commercial partition.

API Gateway, IAM and Step Functions gain a Partitions section, and the
WAFv2 scope note names the partition's CloudFront region and where the
CLOUDFRONT scope exists.

* docs(partition): say only custom domains refuse EDGE, and when FLOCI_HOSTNAME is enough

The API Gateway Partitions section said EDGE was refused outside the
commercial partition and that REGIONAL and PRIVATE worked everywhere.
Only custom domains are checked: createRestApi and the REST API update
path accept EDGE in any partition, and createDomainName refuses PRIVATE
in all of them. The section now says so.

The deployment recipe offered FLOCI_HOSTNAME for a different port, but
it replaces only the host and keeps FLOCI_BASE_URL's port, so a
different port needs FLOCI_BASE_URL.
2026-10-07 23:47:52 -04:00
Priamo Germosen 1f1d4f94dd fix(cloudfront): stream origin responses and viewer request bodies (#5278)
A distribution read every origin response whole before answering the
viewer: an S3 origin's object through getObject, a custom origin's body
through the HTTP client into a byte array. A viewer's POST, PUT, PATCH
or DELETE body was likewise read whole before it was forwarded. So an
object or upload of about 2 GiB or more failed, and a smaller one could
run the heap out of memory.

S3 origins now open the object as a stream, the snapshot GetObject
serves, and custom origins return their response before its body is
read; either body is written to the viewer as it arrives, with its
Content-Length, or chunked as the origin sent it. A viewer's body is
streamed to the custom origin with its Content-Length, or chunked when
the viewer sent it chunked or, as HTTP/2 allows, with no length.

An origin response closed before its end, as when the viewer goes away
or a custom error page replaces it, cancels its request instead of
reading the rest of the body to reuse the connection. Since a streamed
response holds its connection for the whole transfer, one origin may
now use the whole connection pool, as CloudFront sets no per-origin
limit.
2026-10-07 18:02:42 -05:00
yarammanasa2001-maxandyarammanasa2001-max 9934b39a42 feat(redshiftserverless): add snapshot and restore operations (#5184)
* feat(redshiftserverless): add snapshot and restore operations

Adds CreateSnapshot, GetSnapshot (by name or ARN), ListSnapshots (filterable
by namespace), DeleteSnapshot and RestoreFromSnapshot on top of the existing
workgroup support. A snapshot is AVAILABLE as soon as it is created, so a
snapshot created in a standby region stands in for a cross-region copy.
RestoreFromSnapshot restores into an existing namespace and workgroup and
never creates either.

* docs(redshiftserverless): document snapshot and restore actions

* docs(redshiftserverless): update service matrix operation count

* fix(redshiftserverless): validate snapshot restore and ARN lookup

Reject a RestoreFromSnapshot workgroup that belongs to another namespace,
resolve snapshotArn only for this account and Region, and register the
snapshot model for reflection so persisted snapshots survive a native restart.

* fix(redshiftserverless): harden snapshot restore and add lifecycle tests

Validate namespaceName and snapshot names, accept snapshotArn on
RestoreFromSnapshot, read the snapshot once during restore, and cover the
handler with an integration lifecycle test and a Java SDK compatibility test.

* feat(redshiftserverless): dump and restore snapshot data and model retention, tags and filters

CreateSnapshot dumps a running workgroup with pg_dump and RestoreFromSnapshot
empties the public schema and replays the dump, reusing the provisioned
Redshift container manager. Snapshots now report adminUsername, kmsKeyId and
retention, accept tags (taggable by ARN), ListSnapshots filters by
namespaceArn, ownerAccount and a time window, and RestoreFromSnapshot rejects
snapshotName and snapshotArn together.

* fix(redshiftserverless): make snapshot restore atomic and strict

Dump the current contents before a restore and put them back when the replay
fails, drop every user schema rather than only public, run psql with
ON_ERROR_STOP so a failing statement fails the restore, and fail a restore
whose recorded dump file is missing.

* fix(redshiftserverless): keep the catalog bootstrap schema out of snapshot restore

The reset dropped floci_internal and with it the pg_catalog svv_external_*
views, so the strict replay failed. Leave that schema out of the reset and
out of the dump.

* fix(redshiftserverless): drop large objects when resetting before a restore

* refactor(redshift): share container lookup and defaults in the container manager

* docs(redshiftserverless): document the bootstrap schema left out of snapshots

* style(redshiftserverless): order imports in the runtime test

---------

Co-authored-by: yarammanasa2001-max <271440416+yarammanasa2001-max@users.noreply.github.com>
2026-10-07 17:08:39 -04:00
Sam Fakhreddine f661923faf feat(codepipeline): roll back a single stage from a successful target execution (#4618)
* feat(codepipeline): roll back a single stage from a successful target execution

RollbackStage now validates the stage and target, then re-runs only the source stages and the target stage as a ROLLBACK execution.

* fix(codepipeline): keep a rollback's stage filter across restart and retry

Persist the rolled-back stage name and derive the include-stages filter from it on start, resume and retry.

* fix(codepipeline): tighten RollbackStage eligibility, trigger type, events and source pinning

* fix(codepipeline): report a busy pipeline from RollbackStage as ConflictException

* fix(codepipeline): refuse rollbacks of source stages, rollback targets and running stages

RollbackStage now answers UnableToRollbackStageException when the stage is a source stage, when the target execution is itself a ROLLBACK execution, or when another execution is still running the stage, per the CodePipeline User Guide considerations for rollbacks.

* fix(codepipeline): reject RollbackStage on PARALLEL pipelines and close the concurrent rollback window

RollbackStage now answers ValidationException for PARALLEL pipelines, checks for a running stage (including a rollback still fetching sources) under the pipeline start lock, records the manual-start triggerDetail instead of the target id, and shares one source-action helper.
2026-10-07 15:54:47 -04:00
Kenshin Okinaka 86371d86cb fix(ses): match AWS tag ARN parsing and configuration set name errors (#5235)
* fix(ses): match AWS tag ARN parsing and configuration set name errors

The SES v2 tag endpoints rejected malformed ARNs with messages that were
never checked against AWS, refused ARNs whose service was not "ses", and
compared the region before checking the resource exists. Configuration
set names were rejected with an invented message on both APIs.

Probed against AWS in us-west-2:

- Every malformed ARN (missing partition, service, account or resource
  name, unknown type, ":" or "/" in the name) is BadRequestException
  "ResourceArn is not the expected format", including an unknown type,
  which was a 404.
- The partition and service are required but never compared.
- An invalid configuration-set name in the ARN is a message-less
  ValidationException after the account check.
- TagResource and UntagResource check existence before the region.
- An omitted ResourceArn on Tag/Untag is a message-less
  ValidationException. ListTagsForResource keeps a 400 where AWS
  answers 500.
- "ResourceArn=" is read raw, since @QueryParam binds an empty value
  as null.
- Configuration set names use AWS's three messages on every v1 and v2
  operation, including sends: must be specified, cannot exceed 64
  characters, and invalid characters.

* refactor(ses): share the configuration set name check and map tag domains by type

The v1 helper and the v2 CreateConfigurationSet handler now call the
service's validateName instead of repeating the empty-name check, and the
name pattern no longer restates the 64-character limit the length check
owns.

The seven taggable domain services implement SesTaggable, and SesService
keys them by ARN type in one map. That map replaces the type set and the
three dispatch switches, whose default arms could no longer be reached.
2026-10-07 14:27:36 -04:00
Salil Chincholikar 74b3cecf78 feat(ses): support Content.Simple.Attachments in SESv2 SendEmail (#5190)
* feat(ses): support Content.Simple.Attachments in SESv2 SendEmail

Parse and validate Simple attachments, assemble them into one MIME message
with the relay's encoder, run the content scan over it as for raw sends,
relay them over SMTP, and expose them in the /_aws/ses mailbox as an
Attachments summary plus the base64 MIME message in RawData.

* fix(ses): sort SesService imports and document attachment encoding and RawData recipients

RawData keeps the To and Cc recipients the request named, including any
suppression later kept from delivery, and ContentTransferEncoding is validated
but every attachment part is base64-encoded. Both are now stated in the SES docs.

* fix(ses): reject line breaks in attachment MIME header members

ContentType, ContentDescription and ContentId are written verbatim into the
attachment part's MIME headers, so a CR or LF in any of them added header lines
to that part. They are now refused with BadRequestException by the same rule
MessageHeader.isSafe applies to custom headers. missingHeaderMember now builds
its message through constraintViolation.

* fix(ses): refuse attachments with unsupported file extensions

SES does not accept attachments whose file names end in one of the
extensions listed under "SES unsupported attachment types" in the developer
guide. The content scan now walks the parsed MIME for attachment file names,
from Content-Disposition or the Content-Type name parameter, and both the
Simple-with-attachments and raw send paths refuse such a message with
MessageRejected before anything is recorded.

* refactor(ses): share one MIME part walk between the content scans

hasBlockedAttachment repeated the worklist entityContains already used.
Both now go through anyPart, which walks every part, forwarded messages
and multiparts included, and runs the given check on each.
2026-10-07 14:22:34 -04:00
TATSUNO “Taz” Yasuhiro ee2d1a68a6 feat(cloudformation): pass Lambda DurableConfig through (#5218)
* feat(cloudformation): pass Lambda DurableConfig through

AWS::Lambda::Function.DurableConfig reaches CreateFunction and
UpdateFunctionConfiguration. As on AWS, a RetentionPeriodInDays the
template leaves out is 14 on update too, a durable function created
without Timeout gets min(ExecutionTimeout, 900), and adding or removing
DurableConfig replaces the function.

* test(terraform): cover aws_lambda_function durable_config

The provider creates a durable function, reads it back without a diff,
updates execution_timeout in place, and before destroy stops a RUNNING
durable execution through ListDurableExecutionsByFunction,
StopDurableExecution and GetDurableExecution.

* fix(cloudformation): honor AWS::NoValue, cleared keys and large numbers in DurableConfig

A DurableConfig that Fn::If removes with AWS::NoValue leaves the
function plain. A KMSKeyArn the template leaves out or sets to "" clears
the key, as CloudFormation does on AWS, since Lambda keeps a stored key
when the update omits the member. A number beyond an integer reaches
Lambda unchanged, so its range check rejects it.

* fix(cloudformation): reject a DurableConfig that is not an object

Only an intrinsic that resolves to AWS::NoValue removes DurableConfig.
CloudFormation rejects a string, number or list in its schema check
before the function is touched, so an update with one no longer
replaces and deletes a durable function.

* test(cloudformation): cover Lambda DurableConfig with the AWS SDK

The CloudFormation and Lambda SDK clients create a durable function,
update DurableConfig in place, and remove it by replacing the function.

* fix(cloudformation): require ExecutionTimeout and known members in DurableConfig

CloudFormation checks DurableConfig against the schema on update too: an
update without ExecutionTimeout, or with a member the schema does not
list, fails before the function is touched. Floci let such an update
through and kept the old timeout.

* refactor(cloudformation): look up a Lambda function once per deploy

The name choice and the replacement decision now share one lookup and one
durable check, so they cannot disagree.
2026-10-07 12:39:36 -04:00
jwoa95 1199f3a790 fix(rds): forward PostgreSQL startup parameters through the proxy (#5151)
* fix(rds): forward PostgreSQL startup parameters through the proxy

The RDS proxy parsed the client's StartupMessage but opened the backend
session with only user and database, so options, application_name and
every other run-time parameter were silently dropped.

Forward them in the order the client sent them. The proxy keeps setting
user and database itself, and drops _pq_. protocol extension requests,
which it does not negotiate with the backend.

An IAM login for a role other than the master still sends only user and
database: its backend session is the master's until the handover, and a
startup "-c role=<master>" would outlive SET SESSION AUTHORIZATION, so
RESET ROLE would regain the master. Redshift keeps today's behaviour, as
its drivers send parameters PostgreSQL rejects.

* fix(rds): relay PostgreSQL's refusal of the backend login to the client

Forwarding startup parameters makes new backend refusals possible, such as
replication=true with no pg_hba.conf entry allowing it. PostgreSQL answers
those with an ErrorResponse where the proxy expected an Authentication
message, and the proxy reported only "Backend database authentication
failed". Every read that expects an Authentication message now reads a
refusal whole and the proxy sends it to the client unchanged, so the client
sees PostgreSQL's SQLSTATE and reason. This covers a refusal before the
password exchange and one after it. Other unexpected replies keep the
generic error.

* test(rds): reuse the IAM auth harness and the handler's startup parser

Fold the IAM startup-parameter check into iamSessionRunsAsTheRoleNamedInTheToken, let backendStartupFor start its auth thread through startIamAuth, and make PostgresProtocolHandler.parseStartupParams package-private so the test no longer keeps its own copy.
2026-10-07 10:42:11 -04:00
Allen Sanborn 73133b472a fix(mq): return CreateBroker members from DescribeBroker (#5211)
* fix(mq): return CreateBroker members from DescribeBroker

CreateBroker accepted securityGroups, subnetIds, logs,
maintenanceWindowStartTime, storageType, authenticationStrategy,
encryptionOptions and configuration, but discarded them, so
DescribeBroker never returned them. Carry them through
CreateBrokerParams to the persisted Broker and into the DescribeBroker
response, with configuration reported as configurations.current as in
the AWS shape. Absent members are omitted, and brokers persisted before
this change still load.

RabbitMQ users stay out of DescribeBroker (#1951).

* fix(mq): report DescribeBroker logs as a LogsSummary

general and generalLogGroup are required in LogsSummary; general defaults
to false and the log group is /aws/amazonmq/broker/<broker-id>/general.
audit/auditLogGroup are reported only when audit logging was requested.

* fix(mq): report only the general log group in LogsSummary

Audit logs are ActiveMQ-only, and Floci emulates RabbitMQ brokers.
Document DescribeBroker's logs as a LogsSummary rather than an echo.

* fix(mq): stream broker logs to the general log group DescribeBroker reports

RabbitMqManager streamed container logs to /aws/amazonmq/broker/<id>
while DescribeBroker named /aws/amazonmq/broker/<id>/general. Both now
take the name from Broker.generalLogGroup().
2026-10-07 09:14:41 -04:00
Priamo Germosen 5fc8b0418c fix(iam): separate a constraint failure from an invalid value in PutAccountProperties (#5240)
The key pattern and length checks answered InvalidInput while carrying the
"failed to satisfy constraint" wording that every other constraint check in
IamService pairs with ValidationError. The model declares InvalidInputException
on the operation and says nothing about which code a pattern miss produces, so
the two had drifted apart with nothing to settle them.

The API Reference settles it in Common Error Types rather than the operation's
own error table. ValidationError is a common error for every action, defined as
"The input doesn't meet the required format or constraints", 400. InvalidInput,
the one the operation declares, is "an invalid or out-of-range value was supplied
for an input parameter". PutAccountProperties publishes a Key Pattern of
^[A-Za-z][A-Za-z0-9/_-]*$, a key length of 1 to 50 and a value length of 1 to
1024, and the model declares all three on accountPropertyKeyType and
accountPropertyValueType. Violating a published pattern or length is a format
failure; a value that satisfies them and is still wrong is not.

So it is a split rather than a rename. The key pattern and length, and the value
length, are now ValidationError and keep the constraint wording, which was
already right for them. The Namespace/PropertyName rule stays InvalidInput: the
published pattern admits a key with no slash, with several, and with a trailing
one, so that rule only applies once the format is already good. Its message drops
the constraint wording and reads as prose, since that wording is what made the
pair look inconsistent. The same-namespace rule is unchanged.

aMalformedKeyIsRejected asserted one code for seven keys that fall on both sides
of that line, so it splits in two, each asserting its own code and the absence of
the other. As written it could not tell a pattern failure from the slash rule.

Not touched, though the same reading would question it: createServiceLinkedRole
answers InvalidInput for a check that is exactly the declared constraint on
AWSServiceName. Its message is prose rather than the front-end format, there is
no recording either way, and CreateServiceLinkedRole's error table is structured
identically to this one, so it proves nothing. Left alone rather than changed on
inference.

Refs #5177
2026-10-07 08:03:02 -05:00
Priamo Germosen 3a8f974554 fix(iam): answer AWS's own errors for a malformed service-credential id, and for DeleteUser (#5239)
Three answers on the service-specific credential operations did not match what
AWS sends. All three are recorded against real AWS in LocalStack's IAM snapshots,
under @markers.aws.validated.

A ServiceSpecificCredentialId that does not match the model's [\w]+ was looked up
regardless, so it came back NoSuchEntity 404. AWS checks the format first and
answers ValidationError 400 quoting the pattern, on UpdateServiceSpecificCredential,
ResetServiceSpecificCredential and DeleteServiceSpecificCredential alike. A
malformed id and an unknown one are different mistakes, and they now get
different answers.

An id that does satisfy the pattern and names no credential of that user was
"The Service Specific Credential with id <id> cannot be found." AWS says "No such
credential <id> exists", still NoSuchEntity 404.

DeleteUser named the credential in its refusal: "must delete service-specific
credentials first." This case gets no message of its own on AWS, unlike the
access-key and policy cases beside it, and falls back to the generic "Cannot
delete entity, must remove referenced objects first.", DeleteConflict 409.

The API Reference publishes a length of 20 to 128 on the id as well as the
pattern, so both are now enforced, and an id breaking both is reported as two
validation errors rather than one, which is what the counted prefix is for. Only
the pattern message is recorded; the length wording is the form AWS uses for a
member carrying both bounds, which validateLoginProfilePassword already spells
the same way.

The same snapshots show an invalid Status answered with "1 validation error
detected: Value at 'status' failed to satisfy constraint: Member must satisfy
enum value set", naming neither the offending value nor the permitted set, where
the code named both. statusType is one shape, validated by one front end, and
UpdateSigningCertificate, UpdateSSHPublicKey and UpdateServiceSpecificCredential
all take it, so the recording of one is the rendering of all three. They had the
same message copied three times and now share a helper, placed ahead of all three
rather than inside one family's section. Elsewhere in the tree this message does
carry the permitted set, and those are other services with their own renderings,
so they are left alone.

UpdateSSHPublicKey had no test for a status outside the enum at all, and the two
that did have one asserted only the code, so the message none of them pinned
could have been reverted with the suite still green. All three now assert the
counted prefix and the absence of both the value and the set.

UpdateAccessKey takes the same shape and is further off: "Status must be Active
or Inactive." is not AWS's format at all, it refuses the Expired that statusType
allows, and it validates the status only after looking the key up, so a bad key
and a bad status answer NoSuchEntity where the front end would answer
ValidationError first. That is a behavioural change with its own tests to write,
so it is not folded in here.

Refs #5084
2026-10-07 08:02:43 -05:00
danielxoi bcfb9c786c fix(cognito): surface sign-in denials with the exception classes Cognito uses (#5223)
* fix(cognito): surface sign-in denials with the exception classes Cognito uses

A disabled user was rejected with UserNotConfirmedException ("User is disabled");
Cognito returns NotAuthorizedException with "User is disabled.". A PreAuthentication
trigger that returned an error payload surfaced as NotAuthorizedException; Cognito
returns UserLambdaValidationException with "PreAuthentication failed with error
<errorMessage>.", the same mapping floci already applied to PreSignUp on
AdminCreateUser. PreSignUp on SignUp is aligned the same way (it reported
NotAuthorizedException "PreSignUp trigger denied signup: ...").

The five duplicated eligibility checks now share requireSignInEligible /
requireEnabled, and the three blocking triggers share blockingTriggerFailure.
Integration tests that pass against AWS failed on these two codes.

* test(cognito): cover trigger invocation failures and assert the SDK exception classes

PreAuthentication and PreSignUp now get cases for an uninvokable function
(UnexpectedLambdaException) and a malformed response
(InvalidLambdaResponseException). A new sdk-test-java compat test asserts
NotAuthorizedException for a disabled user and UserLambdaValidationException
for a PreAuthentication trigger that raises, through the AWS SDK v2 client.

* test(cognito): drop the em-dash from the compat test display name
2026-10-06 23:28:03 -04:00
Salil Chincholikar c0b2b299b0 feat(sns): sign deliveries with a served RSA certificate like AWS (#5189)
* feat(sns): sign deliveries with a served RSA certificate like AWS

Replace the EXAMPLE Signature and SigningCertURL placeholders with real
signatures over the documented canonical string. Notifications and
subscription confirmations delivered to HTTP/HTTPS endpoints, Lambda
records and non-raw SQS envelopes are signed with SHA1withRSA, or
SHA256withRSA when the topic sets SignatureVersion to 2.

The RSA 2048 key and its self-signed certificate are kept in SNS storage
and the certificate is served at
/_aws/sns/SimpleNotificationService-<fingerprint>.pem, so a new key always
gets a new URL. The SQS envelope now carries UnsubscribeURL and the Lambda
record a real UnsubscribeUrl, as on AWS.

* fix(sns): drop a delivery when signing fails and regenerate the key on reset

A signing failure in the Lambda, SQS and HTTP builders was caught with the JSON
fallback and delivered an empty placeholder as if it had succeeded. Only a JSON
serialization error falls back now; a signing failure fails that delivery.

SnsMessageSigner is now Resettable: a reset drops the cached key instead of
writing it back to the cleared store, so the next delivery generates a new one.

* style(sns): sort SnsService imports

* refactor(sns): build the SQS envelope with the builder Firehose uses

buildSnsSqsEnvelope duplicated buildSnsEnvelope apart from the signature and UnsubscribeURL. buildSnsEnvelope now takes the subscription ARN and signature version and adds both only when a subscription is given, so SQS and Firehose share one builder again.
2026-10-06 22:50:56 -04:00
Priamo Germosen a0a2a5f0d6 fix(s3): run S3 Select over CSV and JSON a record at a time (#5178)
SelectObjectContent loaded the whole object into a byte array and built
the whole response before sending it, so an object over about 2 GiB
failed with an internal error, and a large object or result could run
the heap out of memory.

The object is now opened as a stream, the snapshot GetObject uses. The
Java evaluator parses the statement before reading anything, then reads
CSV a line at a time and JSON a line or an array element at a time,
stops once a LIMIT is reached, and writes the result as it goes, in
Records events of whole records, then Stats and End. Queries floci-duck
runs read the object themselves and no longer load it just to count
BytesScanned.
2026-10-06 20:32:13 -05:00
Priamo Germosen 04a3b97346 feat(iam): model account properties and outbound web identity federation (#5177)
Adds GetAccountProperties, PutAccountProperties, SetSecurityTokenServicePreferences,
EnableOutboundWebIdentityFederation, DisableOutboundWebIdentityFederation and
GetOutboundWebIdentityFederationInfo, which completes step 9f of the IAM gap plan.

A property key is Namespace/PropertyName with exactly one forward slash and
neither a leading nor a trailing one, and every key in one request must share a
namespace, which AWS states directly. A request mixing namespaces is rejected
whole rather than partly applied.

Enabling federation twice is FeatureEnabled 409 and disabling it twice is
FeatureDisabled 404, an asymmetry AWS documents. The getter answers
FeatureDisabled too when the feature is off, reusing the disable operation's own
wording, which is matched rather than improved.

The issuer URL is derived from the request's partition rather than the literal in
the API Reference's example: api.aws is only the commercial partition's dual-stack
suffix. It is minted once per account and survives a disable, since a relying
party verifying tokens will have pinned it. AWS documents neither that nor
JwtVendingEnabled's source, so both are recorded in the docs as choices.

The OIDC discovery endpoints the issuer is documented to host, and the
GetWebIdentityToken API the feature references, are not modelled: these six are
the management operations only.
2026-10-06 20:32:03 -05:00
outofplace a5db3975c4 feat(cognito): support TOTP MFA when MFA is optional (#5101)
* feat(cognito): store software-token MFA preferences and report MFA settings

* feat(cognito): challenge users with TOTP turned on when MFA is optional

* docs(cognito): document optional TOTP MFA and MFA preferences

* fix(cognito): report required TOTP and keep email-code sign-in for email MFA users

* docs(cognito): describe required TOTP reporting and the USER_AUTH choice
2026-10-06 17:33:00 -04:00
Vũ Thế Huy 950b6fe774 feat(redshift): add relational queries for Redshift Spectrum (#5095)
* feat: add relational queries for Redshift Spectrum

* fix(redshift): harden Spectrum relational query preparation

Catch RuntimeException during preparation so the client gets an ErrorResponse
instead of a dropped connection, skip preparation while the backend discards
until Sync, defer schema binding until the transaction commits, make the
catalog functions SECURITY DEFINER, and track COMMIT and ROLLBACK from the
command tag.

* fix(redshift): address review findings on transaction handling in Spectrum relational queries

- Undo Glue tables created inside a rolled back transaction (Data API batch and wire proxy)
- Keep bindings and Glue tables on ROLLBACK TO SAVEPOINT; only a closed transaction discards them
- Report the real transaction status for locally handled simple queries instead of idle
- Use a switch expression in BackendResponseCoordinator
- Map host.docker.internal into the floci-duck container on Linux

* fix(redshift): undo Glue tables across sessions and on rollback to savepoint

- Scope staged Glue tables by the backend socket so the proxy rollback finds tables created by another session
- Track SAVEPOINT, ROLLBACK TO and RELEASE so a Data API batch undoes only the tables created after the savepoint

* fix(redshift): defer Glue undo on rollback to savepoint until the backend confirms and bundle bootstrap catalog in native image

* fix(redshift): reject CREATE EXTERNAL TABLE inside a transaction like AWS

AWS does not allow CREATE EXTERNAL TABLE inside a transaction block, and a
Data API batch runs as one transaction. Return SQLSTATE 25001 instead of
staging Glue tables and undoing them on rollback, which removes the savepoint
tracking and cross-session undo code. Reuse ExternalTableMaterializer.quote.

* fix(redshift): reject CREATE EXTERNAL TABLE in a transaction for legacy schemas too
2026-10-06 15:30:53 -04:00
jwoa95 45f45e590e fix(cognito): send email from the pool's EmailConfiguration sender (#5150)
* fix(cognito): send email from the pool's EmailConfiguration sender

Cognito email always came from no-reply@verificationemail.com. It now
follows EmailConfigurationType: with DEVELOPER, From when set, otherwise
the SourceArn identity's address; with COGNITO_DEFAULT, the SourceArn
address. A domain identity takes its address from From. Without a
SourceArn, the default address is kept.

* test(cognito): read captured mail without the ?email= filter

* fix(cognito): send from the configured sender only when SES has verified it

A pool's EmailConfiguration sender is now used only when its SourceArn
names an SES identity in the pool's account that SES has verified in the
SourceArn Region (the pool's Region for a wildcard Region), and a From
that supplies the sender is one mailbox at that address or in that
domain. Anything else sends from no-reply@verificationemail.com and logs
a warning, so a pool can no longer send as an address its account has
not verified.

When From has a sender name, the bare address now goes in ReturnPath.
SES takes Source as the default return path, so the captured message's
ReturnPath, and the envelope sender handed to the SMTP relay, was
"Name <address>". The relay's mail client happened to strip the name
from MAIL FROM; the envelope no longer depends on that.

* style(cognito): use one parameterised message in the sender fallback log

* fix(cognito): accept subdomains of a domain identity and match email identities exactly

A verified SES domain covers its subdomains, so a From in one of them now sends instead of falling back. Email address identities are case sensitive, domain part included, so the From must equal the identity. The SourceArn must also be in the user pool's partition, not only its account.

* refactor(ses): keep one definition of a verified identity

SesService.isVerifiedIdentity now delegates to SesIdentityService.isIdentityVerified, made package-private, instead of repeating its check.
2026-10-06 13:51:51 -04:00
Mario Toffia a33eea05cd feat(iot): enforce custom authorizer decisions on MQTT connections (#4835)
* test(iot): cover custom authorizer invocation and enforcement against AWS

* feat(iot): enforce custom authorizer decisions on MQTT connections

Serve TestInvokeAuthorizer and invoke an authorizer's function on an MQTT
CONNECT that names it, on the plaintext listener and the /mqtt WebSocket
bridge. The event, the request and answer checks, signed-token
verification and the refusal per MQTT version follow what was measured
against AWS IoT Core. The bridge hands the upgrade's headers, query and
server name to the broker keyed by its connection's local address.

Closes #4823

* fix(iot): evaluate WebSocket custom authorizer policies against the client's address

* docs(iot): note that a non-UTF-8 MQTT password reaches the authorizer altered

* test(iot): cover custom authorizer CONNECTs on the plain MQTT listener

* fix(iot): refuse TestInvokeAuthorizer tokens and signatures outside their length bounds

* fix(iot): refuse authorizer JSON with trailing content

TestInvokeAuthorizer, CreateAuthorizer and UpdateAuthorizer bodies, a custom authorizer's answer and each policy document it returns are now read with FAIL_ON_TRAILING_TOKENS, as the shared JSON controllers do, so a valid prefix followed by junk is refused instead of half-read.

* fix(iot): keep address literals out of the WebSocket server name

Over WSS without SNI the bridge fell back to the Host header unfiltered,
so a client dialing an IP got that IP as tls.serverName in the authorizer
event and as iot:DomainName in policy evaluation. Apply the same address
literal filter SNI already uses. Also name the context validation ceiling
in TestInvokeAuthorizer's ponytail note.
2026-10-06 10:44:28 -04:00
jwoa95 69b4d17c67 fix(cognito): run the PreSignUp trigger on AdminCreateUser (#5149)
* fix(cognito): run the PreSignUp trigger on AdminCreateUser

AWS invokes the pre sign-up trigger when AdminCreateUser creates a user,
with triggerSource PreSignUp_AdminCreateUser, the request's ValidationData
and ClientMetadata, and ignores the response's autoConfirmUser,
autoVerifyEmail and autoVerifyPhone. A trigger error refuses the user.

The trigger runs before anything is stored, so a refused ForceAliasCreation
request no longer moves the alias off the existing user.

* fix(cognito): invoke PreSignUp outside the user lock on AdminCreateUser

AdminCreateUser held the lock stripe of the requested username while
the pre sign-up trigger ran. A function that called back into the pool
for an identifier on the same stripe, such as AdminCreateUser for the
same username, waited for that lock until the invocation timed out.

The trigger now runs with no lock held. A taken username or alias is
still refused before the trigger is invoked, and the checks run again
under the lock once it accepts, so a user created while the trigger ran
still fails the request with UsernameExistsException.

With ForceAliasCreation, the alias holder was read before the trigger
and written back after it, which could undo a change made to the holder
in the meantime or restore a deleted holder. The holder is now looked up
under the lock after the trigger, just before its alias is moved.

* fix(cognito): run PreSignUp once per in-flight AdminCreateUser username

With the pre sign-up trigger running outside the user lock, two
overlapping AdminCreateUser requests for the same free username could
both pass the existence check and both invoke the trigger. The later
one was then refused under the lock after its function had already run,
or failed with the function's own error instead of
UsernameExistsException.

AdminCreateUser now claims the username before checking it and gives
the claim up once the user is stored or the request fails. An
overlapping request for the same username, including one the function
makes for the username it was given, is refused with
UsernameExistsException before it invokes the trigger.
2026-10-06 08:18:14 -04:00
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 8fee66ae61 fix(s3): stream UploadPartCopy ranges into the part (#5162)
UploadPartCopy read the copied range into a byte array and stored it
through the byte-array UploadPart path, so one copied part was capped
near 2 GiB with EntityTooLarge, while S3 allows a part of up to 5 GiB.

The range is now read from the source stream as it is needed, by a new
CopyRangeInputStream that skips to the range on its first read and ends
after its last byte, and written straight into the part through the
streaming UploadPart path, so neither the source nor the part has to
fit in memory in the disk-backed modes. A range over S3's 5 GiB part
limit is rejected with EntityTooLarge, as the S3 API Reference error
table words it, before anything is copied. Memory mode keeps its limit
of about 2 GiB.
2026-10-05 23:04:48 -05: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
Priamo Germosen a3118eb42b fix(sts): evaluate GetSessionToken and GetFederationToken sessions as the user that minted them (#5081)
Under IAM enforcement, credentials from the two STS operations that mint a
session from a long-term key were evaluated as the wrong identity:

- A GetSessionToken session was stored with no role ARN, which
  resolveCallerContext answered with null, and the enforcement filter lets a
  known credential it cannot map to policies through. A user allowed only
  sts:GetSessionToken got credentials that passed every check, IAM calls
  included, and since the session had no caller ARN, AssumeRole took it for
  the account root and let it assume any role whose trust policy names the
  account. AppSync's IAM authorization and RDS IAM database authentication
  also read a null context as allowed, so they let these sessions through too.
- A GetFederationToken session was stored with the federated user's ARN where a
  role session keeps its role's, and its permissions were read from the role
  whose name followed the last slash. A user allowed only
  sts:GetFederationToken that federated under an existing role's name got that
  role's permissions; any other name got none, even with a session policy.

The STS API Reference says GetSessionToken credentials "have the same
permissions as the IAM user", and that a GetFederationToken session with no
session policy "has no permissions", and otherwise the intersection of "the IAM
user policies and the session policies". Both handlers now record the identity
whose key signed the request. An active key of a user in the request's account
names that user, by ARN and unique ID. A key no account holds, the legacy test
key or the account id among them, names the account root, which is how Floci
already treats such a key.

A GetSessionToken session is evaluated as that user, policies and boundary
included, or as the root, whose context the filter still bounds by the
account's service control policies. A federated session is evaluated as that
user intersected with its session policy. Without one it has no permissions of
its own, but keeps the Deny statements of its user's policies and boundary: a
resource policy naming the federated user grants to the session past implicit
denies, not past explicit ones (IAM User Guide, "Resource-based policies for AWS
STS federated user principal sessions"). Whatever its policies allow, a
federated session cannot call any IAM operation, nor any STS operation except
GetCallerIdentity (STS API Reference, GetFederationToken), so its context
always carries an explicit Deny for iam:* and sts:*; the filter answers
GetCallerIdentity before reading any policy.

A session whose issuer is gone is no credential at all, refused like an unknown
access key, so neither a resource policy nor S3's fallback to the account root
acts on its behalf. That covers a session minted with any other key IAM holds
(another session's, which AWS does not accept here, or an inactive key or
another account's, which account routing can land in the default account), a
session whose user was deleted and recreated under the same name, and one
stored before the issuer was recorded.

The caller identity follows: a GetSessionToken session's caller and principal
ARN are its user's, and a federated session's are its federated-user ARN, with
account:name as its user ID, as GetCallerIdentity reports for a federated user.

The unit test that pinned the GetSessionToken bypass now checks that a session
stored without an issuer is no credential; unit tests cover each kind of
issuer, the deny-only context of a federated session without a policy, and
that the issuer survives persistence. Integration tests (IAM and S3
enforcement, real SigV4) cover the role-name federation, the intersection, the
no-policy session, the GetSessionToken session and its AssumeRole, a
bucket-policy Deny keyed on the user's aws:PrincipalArn, both kinds of session
staying within the user's permissions boundary, a session of a recreated user
under a bucket policy granting everyone, and a bucket policy naming a federated
user against its user's explicit Deny, and a federated session refused IAM
and AssumeRole although both its user and session policy allow them; the SCP integration test now also checks
a root-minted session. All of them fail on main. Tests that built an STS
session credential as a role-less session with no issuer, a shape Floci no
longer creates, now build one the account root minted, or a presigned-URL
session, as production does.
2026-10-05 17:12:00 -05:00
Priamo Germosen 583de3010c fix(s3): stream PutObject and UploadPart bodies to disk (#5106)
The object PUT endpoint took its body as a byte array, so a single
PutObject or UploadPart was held whole in the heap and capped near 2 GiB.

The body is now read as a stream. A streaming aws-chunked payload is
decoded as it arrives, and Content-MD5 and x-amz-checksum-* are checked
on the way through. In the disk-backed modes the body is staged under
.multipart/.incoming with no lock held, then a part is moved into its
upload under the upload's lock and an object is stored like an
assembled multipart object. Checks the request alone decides (bucket,
SSE-C headers, checksum algorithm, write preconditions, a malformed
Content-MD5) run before any of the body is read. Memory mode reads the
body into a capped array and fails past about 2 GiB with EntityTooLarge.
2026-10-05 17:11:47 -05: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
Allen Sanborn e7ca2ece22 feat(dms): add endpoint, replication instance and replication task lifecycles (#5001)
* feat(dms): add endpoint, replication instance and replication task lifecycles

DMS dispatched only replication subnet groups and tagging, so CreateEndpoint,
CreateReplicationInstance, CreateReplicationTask and their siblings answered
UnknownOperationException and no aws_dms_endpoint, aws_dms_s3_endpoint,
aws_dms_replication_instance or aws_dms_replication_task could be applied.

Adds Create/Describe/Modify/Delete for endpoints, replication instances and
replication tasks, plus Start/StopReplicationTask, which the provider calls for
start_replication_task and before modifying or deleting a running task.

- Resources are ARN-addressed (endpoint:, rep:, task:) with a 26-character
  generated id or the caller's ResourceIdentifier, and tagged through the
  existing tagging operations.
- Instances are available and tasks ready from creation, the states the
  provider's waiters target; describe filters follow the API reference and a
  filter that matches nothing is ResourceNotFoundFault.
- Endpoint settings structures round-trip, minus every SecretString member;
  ModifyEndpoint merges them unless ExactSettings is true.
- Deleting an endpoint or instance a task uses, a subnet group an instance
  uses, or a running task is InvalidResourceStateFault.

The unsupported-operation test now uses CreateReplicationConfig, which is still
unimplemented.

* style(dms): order DmsService imports alphabetically

* docs(dms): list CdcStartTime and the missing describe actions as unimplemented

* test(dms): cover tag add and remove on endpoint, instance and task ARNs

* fix(dms): runtime-init DmsService, resolve the default subnet group, reject reversed task endpoints

- Register DmsService under --initialize-at-run-time: its static SecureRandom
  otherwise lands in the native image heap (guard test and native builds).
- Store only the three members KerberosAuthenticationSettings models instead of
  a deep copy of whatever the caller sent.
- An instance created without a subnet group now describes the "default" group
  in full (VPC, subnets, status) from the region's default-VPC subnets.
- CreateReplicationTask rejects a source ARN that is not a SOURCE endpoint and a
  target ARN that is not a TARGET endpoint.

* fix(dms): name the swallowed default-subnet exception, sync the DMS matrix count

The default-subnet fallback deliberately swallows AwsException; name it
`ignored` and say why that is safe, per AGENTS.md.

docs/services/index.md listed DMS at 6 operations; the handler dispatches 20.

Add the reverse of the reversed-endpoints test: a source endpoint passed as
TargetEndpointArn, which is the only test reaching the TARGET type check.
2026-10-05 14:14:15 -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
Vũ Thế Huy 840d1bb6c1 fix(sqs): set SenderId from caller principal instead of queue owner (#5066)
* feat(sqs): thread accessKeyId through RequestContext and AccountContextFilter

* fix(iam): resolve caller user id and align assumed role id with role id

* feat(sqs): stamp senderId on Message model and in SqsService

* feat(sqs): return message-specific senderId in SQS query and JSON handlers

* test(sqs): add integration tests for SenderId caller principal (#4829)

* fix(sqs): guard against unsatisfied CDI instance in resolveCurrentSenderId

* fix(sqs): address review findings and fix CI for caller principal SenderId

- Catch RuntimeException in SqsService to prevent compiler incompatibility
- Fallback SenderId to queue owner account when outside request context
- Deliver SNS fanout messages with SNS service principal SenderId
- Support presigned requests without X-Amz-Algorithm in AccountContextFilter
- Populate assumedRoleId and roleSessionName for ECS, EKS and Lambda sessions

* fix(sqs): validate session token for temporary credentials and fix CI regressions

- Validate session token matching when resolving caller principal for temporary credentials
- Generate unique session names for EKS Pod Identity to avoid sender ID collision
- Restore default floci-session session name for Lambda execution role sessions
- Align SqsService mock in SnsServiceTest with 9-parameter sendMessage signature

* fix(sts,lambda): pass sessionToken to resolveCallerUserId and scope Lambda assumed role IDs

* fix(lambda): align execution role session name and assumed role ID with function name

* fix(sqs): resolve SenderId caller in SQS handlers, not in sendMessage

Internal producers (S3 notifications, EventBridge, SNS) call sendMessage
on the thread of the request that triggered them, so SenderId picked up
that caller's role session. Resolve the caller in the SQS Query/JSON
handlers where a real SendMessage call is known, and pass it down.
sendMessage without an explicit senderId now defaults to the queue owner.
2026-10-05 11:36:34 -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
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
Priamo Germosen d97b21ae62 fix(s3): copy objects over 2 GiB without reading them into memory (#5080)
CopyObject read the whole source into a byte array with getObject and
wrote it back out for the copy, so a source of 2 GiB or more failed as an
internal error, even though S3 copies objects up to 5 GiB in one call.

In the disk-backed modes the source is now pinned with a temporary hard
link to the file generation its metadata describes, taken through the
same optimistic snapshot GetObject uses, and that link is moved into
place as the copy's file. The copy's ETag and checksum are prepared
before any bucket monitor is taken, and the pinned file is read, once and
streamed, only for what cannot carry over: a single-part source's ETag is
the MD5 of its bytes and is kept, while a multipart source needs the MD5
computed, and a requested or composite checksum becomes a full-object one
through a new incremental S3Checksum.Calculator. A failed copy removes its
pinned link. Memory mode still copies the byte array.

As on S3, a CopyObject source larger than 5 GiB (5368709120 bytes) is now
rejected with InvalidRequest, "The specified copy source is larger than
the maximum allowable size for a copy source: 5368709120"; such an object
is copied with UploadPartCopy.
2026-10-04 21:25:51 -05:00
Abhigya 1320995d70 fix(apigatewayv2): evaluate HTTP and WebSocket authorizer policies (#5020)
* fix(apigateway): evaluate Lambda authorizer policies with one evaluator

HTTP API (payload 1.0 and 2.0) and WebSocket $connect authorizers now
evaluate every policy statement against the execute-api ARN, instead of
reading only the first statement's Effect.

REST, HTTP and WebSocket APIs share AuthorizerPolicyEvaluator: one
validator and one set of condition keys (aws:SourceIp from the transport
address, aws:SecureTransport, aws:CurrentTime). IAM CIDR conditions now
match IPv6 ranges.

* fix(apigateway): reject malformed authorizer policy conditions

A Condition operator IAM does not know, an operator without keys, or a key
without values evaluated as a non-match or an unconditional match, so a
malformed Deny could be skipped and a malformed Allow could grant access.
Validate each operator and its values and return 500 instead. Numeric and
boolean condition values are now compared rather than dropped.

* fix(iam): leave scalar condition values to #5086

The numeric and boolean condition-value parsing moves to its own pull
request, together with the numeric and date comparison fixes it needs.

* docs: update the IAM operation count in the Service Matrix
2026-10-04 20:59:04 -05:00
Simone Primarosa b2e3870c06 feat(logs): deliver log events through subscription filters (#5021) 2026-10-04 20:43:00 -05:00
iam-ssrivastav 8ea033d9fd feat(cognito): implement DeleteUser self-service API action (#4493) 2026-10-04 20:09:58 -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
Simone Primarosa 383c32443d feat(eks): apply nodegroup labels, taints and capacity type to the node (#5063)
* feat(eks): apply nodegroup labels, taints and capacity type to the node

* fix(eks): address review feedback on nodegroup metadata injection

* fix(docs): sync IAM operation count in service matrix

* fix(eks): use single string literals without concatenation in log messages

* chore(eks): resolve phantom nodegroup review finding

* docs(eks): document CAPACITY_BLOCK capacity type for nodegroups
2026-10-04 18:29:03 -04:00