Commit Graph
35 Commits
Author SHA1 Message Date
TATSUNO “Taz” Yasuhiro 60252c9b7f feat(dynamodb): serve DescribeLimits and DescribeEndpoints (#8099)
* feat(dynamodb): serve DescribeLimits and DescribeEndpoints

DynamoDB reports the default quotas of 80,000 read and write capacity
units per account and 40,000 per table. It names its Regional endpoint
with a cache period of 1,440 minutes.

* fix(dynamodb): name Floci's own address in DescribeEndpoints

With endpoint discovery on, the AWS SDK for Java 2.x sends later
requests to the address DescribeEndpoints names, even when the client
sets an endpoint. The Regional AWS host sent them to real DynamoDB.
2026-11-12 09:10:59 -04:00
Andre Kurait b954b4fb87 fix(dynamodb): honor OR in legacy Query and Scan filters (#8031)
* fix(dynamodb): honor OR in legacy Query and Scan filters

Pass ConditionalOperator to the shared legacy read-filter evaluator while retaining default AND behavior and read-before-filter pagination. Reuse one nested-map fixture builder for the four existing expressions. Separate follow-up requested in upstream #8023.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(dynamodb): validate legacy binary filters before matching

Validate every legacy QueryFilter and ScanFilter binary operand through the existing attribute validator before evaluating items. Keep ConditionalOperator validation first and retain valid-filter short circuit behavior. Add actual JSON wire invalid and valid binary controls.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-11-11 12:46:45 -04:00
Andre Kurait 918c57a64e fix(dynamodb): authorize ListTables against its regional collection (#7336)
* fix(dynamodb): authorize ListTables against its regional collection

* test(dynamodb): reject ListTables authorization through ignored selectors

* fix: generate the DynamoDB ListTables request resource

Record the measured table collection as a generated correction and dispatch table-owned operations before hand-built fallbacks. Preserve batch, transaction and PartiQL resource extraction.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

---------

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
2026-11-02 22:24:56 -04:00
Ovidiu (Ovi) 6abdb4cc44 feat(redshift): take a DynamoDB table and a Serverless namespace in zero-ETL integrations (#7332)
* feat(redshift): take a DynamoDB table and a Serverless namespace in zero-ETL integrations

CreateIntegration took only a DynamoDB stream ARN as SourceArn and a provisioned cluster ARN as
TargetArn. AWS takes the table ARN and a Redshift Serverless namespace ARN (its model allows no
cluster: ARN), so a Terraform aws_redshift_integration written for AWS failed to create.

Both AWS forms are now accepted and the original ones are kept. A missing table is
IntegrationSourceNotFoundFault and a missing namespace IntegrationTargetNotFoundFault, as the API
reference lists. A namespace is written through its workgroup into the namespace's database. A
table source reads changes from the table's latest stream, following one turned on after the
integration was created.

Stream records never landed: the writer bound ApproximateCreationDateTime as an Instant, which the
PostgreSQL driver refuses, so only backfilled items reached the landing table. It now binds an
OffsetDateTime as TIMESTAMPTZ.

* fix(redshift): drain a table's replaced stream and match the source table ARN

A table source moved to the table's latest stream as soon as it changed, dropping records the old
stream still held, and moved to no stream when DynamoDB Local reported none for a table whose streams
were turned off. It now reads the followed stream until a read comes back empty, or until the stream
has expired, before moving, keeps it while the table reports no stream, and persists the move.

A source table ARN was resolved by its table name alone, so a table of another account, or an ARN
with more after the name, was taken for the caller's table of that name. The resolved table must now
have the supplied ARN. The docs no longer promise IntegrationSourceNotFoundFault for a missing stream.

* test(redshift): use the shared Docker probe and Query request helpers in the zero-ETL test
2026-11-02 21:13:21 -04:00
Ovidiu (Ovi) bb5e692b87 feat(dynamodb): emulate Contributor Insights on tables and global secondary indexes (#7326) 2026-11-02 11:30:29 -04:00
Mohith 5f89a70095 perf(dynamodb): retain the live item map in memory mode instead of copying the table (#6915)
Keep memory item storage current by retaining the concurrent live map. Preserve snapshots for durable backends and cover writes, reloads, restore, and account-scoped storage.

Refs #1292
2026-10-29 08:07:42 -04:00
Andre Kurait 52c9c51a7b fix(dynamodb): enforce the default Select for IAM (#6702)
* fix(dynamodb): enforce effective read selection in IAM policies

Preserve generated action and request-member coverage, effective read projections, PartiQL attributes and independent BatchGetItem contexts. Rebase on current main and scope condition data verification to its vendored file, generator, tests and imported modules, retaining all existing IAM data gates.

Signed-off-by: Andre Kurait <akurait@amazon.com>

* fix(dynamodb): derive transaction read conditions from modeled members

Use the generated transaction Get member paths before GetItem IAM extraction, so ignored legacy projection members cannot authorize whole-item reads.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-27 10:05:55 -04:00
TATSUNO “Taz” Yasuhiro 3dc5d356d0 feat(dynamodb): export the changes of a period as an incremental export (#6480)
* feat(dynamodb): export the changes of a period as an incremental export

* fix(dynamodb): write characters above U+FFFF in export lines as UTF-8

* feat(dynamodb): refuse incremental export periods over 24 hours

* fix(dynamodb): wait for unfinished writes when an incremental export reads items

* fix(dynamodb): write no incremental export record when only the order of set members changes
2026-10-25 07:38:55 -04:00
TATSUNO “Taz” Yasuhiro ed21e67cd4 feat(dynamodb): export tables in the ION format (#6429)
* feat(dynamodb): export tables in the ION format

* chore(dynamodb): check the ION export file without polling

* chore(dynamodb): share the export file reader in the compatibility test
2026-10-24 18:25:41 -04:00
TATSUNO “Taz” Yasuhiro 023cb8341b feat(dynamodb): write export files and descriptions as AWS does (#6400)
* feat(dynamodb): write export files and descriptions as AWS does

* fix(dynamodb): check export prefixes as AWS does

* fix(dynamodb): abort the upload of an export file that fails

* chore(dynamodb): share the timed id of backups and exports

* chore(dynamodb): let tests run exports on the calling thread
2026-10-24 08:38:15 -04:00
TATSUNO “Taz” Yasuhiro 05d4786138 feat(dynamodb): restore backups across regions (#6349)
* feat(dynamodb): restore backups across regions

* fix(dynamodb): refuse restores across partitions
2026-10-23 20:51:42 -04:00
Ben Wart 4c49f23c80 feat(dynamodb): journal per-table items one record per item in wal mode (#6310)
* feat(dynamodb): journal per-table items one record per item in wal mode

With the per-table item layout, wal mode still kept the single-file
WalStorage, whose log record for any item write is the whole table and
whose compaction rewrites a snapshot of every table.

Give the partitioned item store a journal mode for wal. Each write
appends one record per changed item to dynamodb-items/journal.wal, and
compaction, on the WAL compaction interval, rewrites only the shards
changed since the last one and then empties the journal. Load replays
the journal over the shard files.

- Writes hold off compaction while they change memory and append their
  record, so the journal never drops a record whose change is not yet
  in a shard file; compaction waits until load has replayed the journal
- A change the journal cannot take is compacted into its shard at once,
  and the write fails if that fails too
- Replay stops at a torn or unreadable record, including one that
  decodes to null, and cuts it off
- A journal that cannot be emptied is reopened, so later writes are
  still appended

Part of #6293

* fix(dynamodb): journal changes to one key in the order they were applied

Changes held only the shared side of the compaction lock, so a second
write to the same item could update memory after the first and still
append its record ahead of it. Replay follows the journal, so a restart
before compaction restored the older value.

Hold a per-key lock across the in-memory update and the journal append.
Changes to different keys commute and stay concurrent.

* fix(dynamodb): stop appending to a journal after a failed write

A failed append could leave part of its record in the file while the
writer stayed open. If the fallback compaction also failed, the next
append succeeded behind the torn record, and replay cut it off with it,
losing a write the caller saw succeed.

Close the writer when a write fails, so every later change falls back to
compaction until a compaction replaces the file and reopens the journal.

* fix(dynamodb): treat a journal key that is not UTF-8 as unreadable

Replay decoded keys leniently, so corrupt key bytes became U+FFFD and
the record was applied to a different key, then kept by the next
compaction.

Decode journal strings with a strict UTF-8 decoder and end replay at a
record whose key or entry key does not decode, like any torn record.

* fix(dynamodb): fail load when the journal cannot be read

Replay logged an I/O error (or a failure to read the journal's size)
and returned normally, so load marked the store ready with records left
unapplied. The next compaction then wrote the partial state to the shard
files and emptied the journal, deleting writes that had been
acknowledged.

Replay now throws on any failure other than a torn or undecodable tail,
and load turns that into a startup failure that leaves the journal
untouched, as a failed migration does. A directory where the journal
goes still counts as holding no records.

* fix(dynamodb): fold a leftover wal journal when per-table runs in another mode

Only wal mode read journal.wal. A wal-mode run that ended without
compacting left its changes there, and a restart in persistent or
hybrid mode ignored them: they were lost, and a later return to wal
replayed them as stale changes over newer shard files.

On load in another mode, replay a non-empty journal.wal, write the
shards it changed and remove it. Fail to start, keeping the file, if a
shard cannot be written or the file cannot be removed.
2026-10-22 22:27:08 -04:00
Ben Wart 7635345474 feat(dynamodb): opt-in per-table item files, split into shards (#6303)
* feat(dynamodb): opt-in per-table item files, split into shards

Every table's items live in one dynamodb-items.json, and any item write
rewrites all of them. A small table that changes often, such as a node
heartbeat table, then keeps rewriting every large table beside it.

Add an opt-in item layout. With item-layout: per-table, items are stored
under dynamodb-items/ as item-shards files per table, and a write saves
only the items it touched:

- persistent rewrites the one shard file that holds the item before the
  write returns, and fails the write when that file cannot be written
- hybrid marks the shard dirty and writes dirty shards on the flush
  interval; an explicit flush or shutdown reports shards it could not
  write
- wal keeps the single-file layout for now and logs a warning

The default, single-file, is unchanged.

On first start, an existing dynamodb-items.json, or a wal snapshot and
log, is migrated through a staging directory moved in place in one step
and then renamed .migrated; a failed migration stops startup and leaves
the old files untouched. DynamoDbService writes single items through the
new MapEntryWriter, and the TTL sweeper removes each item under its item
lock.

Part of #6293

* test(storage): skip read-only directory tests where POSIX permissions are missing
2026-10-22 21:27:19 -04:00
jwoa95 5419b3cfd1 fix(dynamodb): authorize PartiQL statements by operation (#6168)
* fix(dynamodb): authorize PartiQL statements by operation

* fix(dynamodb): authorize a statement the tokenizer refuses as ExecuteStatement

* fix(dynamodb): enforce PartiQL permissions on CBOR requests

* refactor(iam): share JSON and CBOR request parsing
2026-10-22 09:42:42 -04:00
TATSUNO “Taz” Yasuhiro da66550c70 fix(dynamodb): export the table as of ExportTime (#6132)
* fix(dynamodb): export the table as of ExportTime

* refactor(dynamodb): share the epoch seconds conversions

* fix(dynamodb): treat a table that is still being created as not found on export

* docs(dynamodb): note the writes made before point-in-time recovery is enabled

* fix(dynamodb): round timestamp inputs to milliseconds as AWS does

* fix(dynamodb): check the ListBackups time range limits

* fix(dynamodb): check the ListBackups ExclusiveStartBackupArn length

* refactor(dynamodb): reuse requireBackupSource for the export table lookup
2026-10-22 07:31:07 -04:00
TATSUNO “Taz” Yasuhiro 1dce18e766 feat(dynamodb): add point-in-time recovery restores (#6110)
* feat(dynamodb): add point-in-time recovery restores

* feat(dynamodb): record a point-in-time change before the write

* feat(dynamodb): authorize RestoreTableToPointInTime on its source table

* perf(dynamodb): store each point-in-time change on its own

* feat(dynamodb): delete system backups that have expired

* chore(dynamodb): take point-in-time times from a clock in tests

* chore(dynamodb): share the duplicated test helpers and table name pattern
2026-10-21 01:09:06 -04:00
TATSUNO “Taz” Yasuhiro 9b59b8997e feat(dynamodb): add on-demand backups (#6052)
* feat(dynamodb): add on-demand backups

Add CreateBackup, DescribeBackup, ListBackups, DeleteBackup and
RestoreTableFromBackup. A backup keeps a copy of the table settings and
items from the time of the call, and it outlives the table.

The restored table keeps the keys, indexes, billing mode, throughput and
encryption. It drops the stream, TTL, point-in-time recovery, tags,
deletion protection and table class, as on AWS. A GSI or LSI override
must match a source index by key schema and projection, and a vector
index override must match one by name. Error wording and check order
follow AWS.

A restore finishes before the response is sent. The response still says
CREATING with RestoreInProgress true, as on AWS.

Part of #4521.

* feat(dynamodb): check the throughput members of a restore override

* test(dynamodb): tolerate only missing resources in the backup test cleanup

* feat(dynamodb): follow the AWS rules for on-demand restore overrides
2026-10-20 07:18:23 -04:00
Andre Kurait 0a37ea830b fix(dynamodb): support legacy table discovery and batch cleanup (#5986)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-19 13:30:04 -04:00
Aniket Shukla e919560e3c fix(dynamodb): keep expired items visible until TTL deletion (#5555)
* fix(dynamodb): keep expired items visible until TTL deletion

* fix(dynamodb): count items after legacy query filters
2026-10-13 08:07:30 -04:00
Andre Kurait 255ad96168 fix(dynamodb): validate legacy Expected operands without rejecting Value (#5508)
Signed-off-by: Andre Kurait <akurait@amazon.com>
2026-10-12 15:08:18 -04:00
Mario Toffia 9a7ec1c9d0 fix(dynamodb): mark time-to-live deletions on the stream as AWS does (#4930)
AWS writes a TTL deletion to the table's stream as a REMOVE record whose
userIdentity names the DynamoDB service. A DeleteItem removal has none.
The member names depend on where the record is read:

- The DynamoDB Streams API (GetRecords) capitalises them, as the SDK's
  Identity shape expects:
  {"PrincipalId": "dynamodb.amazonaws.com", "Type": "Service"}.
- The Lambda and EventBridge Pipes event record and the Kinesis Data
  Streams destination payload use lowercase names,
  {"type": "Service", "principalId": "dynamodb.amazonaws.com"}, the
  shape the developer guide's TTL filter pattern matches.

With the DynamoDB Local engine, Floci passed Local's record through as
is: eventName UNKNOWN_TO_SDK_VERSION and no userIdentity.
DynamoDbLocalBackend now rewrites such records in a successful Streams
GetRecords reply to REMOVE with the Streams API identity, the one place
the public API, the Lambda poller, Pipes and the Redshift zero-ETL
consumer all read through.

The native engine wrote REMOVE but no identity, so a TTL deletion could
not be told from a DeleteItem. The sweep now marks its stream records
(a new in-memory DynamoDbStreamRecord flag) and its Kinesis CDC records.
GetRecords writes the Streams API identity, and the Kinesis record the
lowercase one.

The Lambda event source mapping poller and the Pipes poller rename the
Streams API identity to the event record shape before filtering and
delivery. DynamoDbTtlIdentity.Shape holds the member names of every
output. DeleteItem removals are unchanged.
2026-10-11 09:42:23 -04:00
Attila Kis 5de9b0d6c1 fix(dynamodb): match the AWS shape of the Kinesis destination responses (#4917)
DisableKinesisStreamingDestination now returns EnableKinesisStreamingConfiguration
with the precision the destination still carries, like AWS does.
Drop DestinationStatusDescription from the Enable and Disable responses. AWS carries
that member on DescribeKinesisStreamingDestination only, where it stays.
Build both responses from one snapshot taken while the call runs, so a concurrent
call on the same destination cannot change the status this answer reports.
Add an SDK compatibility test, because the SDK parses the typed response members
that handcrafted HTTP cannot check.
Document that Enable and Disable report the precision too.
2026-10-02 13:39:34 -04:00
Mario Toffia c326dce977 feat(dynamodb): optional DynamoDB Local backend (#4504)
* feat(dynamodb): add the external Local operation client

Adds DynamoDbLocalClient, which forwards DynamoDB and DynamoDB Streams
wire calls to an external DynamoDB Local over SigV4-signed HTTP/1.1.
The caller's account becomes the access key and its region the signing
region, so Local keeps each account and region apart. Requests are
never retried.

Reply.successBody now owns the AWS error body conversion, which the
API stream reader reuses.

* feat(dynamodb): add the DynamoDB Local backend

Adds DynamoDbLocalBackend, a DynamoDbBackend that forwards every wire
call to an external DynamoDB Local through DynamoDbLocalClient.

- Namespaces: the caller's account and region select the Local
  namespace; table and stream ARNs from another account or region are
  rejected.
- Identities: table, index and stream ARNs in replies are rewritten
  from Local's fixed ddblocal shape to public ARNs, and stream records
  carry the caller's region.
- Metadata: tags live in a Floci store because Local keeps none;
  replica updates are refused; a global table is its single-region
  table; stream enable and disable are idempotent like native.
- Lifecycle: startup waits up to 30s for Local to accept connections,
  and emulator resets are refused because the data lives outside
  Floci.

DynamoDbBackend groups the four seam interfaces so one object is the
whole engine.

* feat(dynamodb): enable the optional Local backend

floci.services.dynamodb.backend selects the engine: native (default)
or local, which forwards to the DynamoDB Local at local-endpoint.
Both engines are client proxies, so the unselected one is never
constructed. With local selected, the stream reader keeps checkpoints
for the life of the stream, and /_floci/info reports the backend in
dynamodb_backend.

DynamoDbLocalBackendIntegrationTest runs against a real DynamoDB Local
when FLOCI_SERVICES_DYNAMODB_LOCAL_ENDPOINT is set.

* docs(dynamodb): document the DynamoDB Local backend

* fix(dynamodb): harden the Local backend endpoint check, stream paging and startup probe

Reject AWS endpoints in every partition, with a trailing dot, and endpoints with user info.
Translate ListStreams paging ARNs, retry any I/O failure until the startup deadline, and
call DescribeTable outside the tag lock.

* fix(dynamodb): tighten Local ARN ownership, batch table names and global TableId

A table ARN of another account or partition is ResourceNotFoundException, a stream ARN of
another partition is refused, and a batch naming one table twice is a ValidationException
instead of a dropped entry. A global table on Local has an empty TableId instead of a random
one. Document the Resource Explorer limit.

* fix(dynamodb): mark the Local readiness probe region as partition-invariant

* test(dynamodb): pin the table record of an untagged typed Local create

* docs(dynamodb): state the Local readiness bound and stack delete protection

* fix(dynamodb): lift deletion protection on the Local direct delete and cap the readiness probe

- DynamoDbTableAccess.deleteTable is the direct engine delete with no
  deletion-protection check. The Local backend now clears
  DeletionProtectionEnabled before DeleteTable, so CloudFormation deletes
  behave the same on both backends. The wire DeleteTable still enforces it.
- Each readiness probe is bounded by the remaining 30 second budget and never
  exceeds the configured request timeout, so startup fails within the budget.

* fix(dynamodb): align Local tag errors with the native wire path

- ListTagsOfResource on a missing table is AccessDeniedException, as on the
  native wire path.
- A table ARN whose partition is not an AWS partition is a
  ValidationException instead of a foreign resource.
- Tag operations report a table ARN of another region as
  ResourceNotFoundException, as native does; TableName fields keep the
  region-mismatch ValidationException.
- Document which regions Resource Explorer searches, and note that a failed
  direct delete leaves deletion protection off.

* docs(dynamodb): state the tested DynamoDB Local version
2026-09-28 22:54:00 -05:00
Mario Toffia d658c75a41 refactor(dynamodb): scope runtime work to the selected backend (#4401)
Add DynamoDbRuntime and a DynamoDbBackendLifecycle seam so the emulator lifecycle starts, resets and stops only the selected backend.
Native start initializes the engine before persisted stream consumers and schedules the TTL sweep, which never ran because its bean was unused.
Reset gains a checkReset preflight that runs before anything is stopped or cleared, and native reset now drops streams, item caches, idempotency tokens and forwarder queues.
Reset also pauses the TTL sweep and waits out in-flight zero-ETL writes before Floci storage is cleared.
Shutdown stops the Lambda DynamoDB poller, the Redshift zero-ETL consumer and the Kinesis forwarding drains before the final flush, and the Redshift consumer is now Resettable.
2026-09-26 16:24:03 -05:00
lex00 72231c09cf feat(dynamodb): add the legacy global table operations (#4288)
* feat(dynamodb): add the 2017.11.29 global table operations

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

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

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

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

Two gaps on the new operations.

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

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

Tests assert the codes rather than the status, cover both replica faults
including a re-add of the home region, and pin that UpdateTable still accepts
the same re-add.
2026-09-24 08:22:20 -04:00
TATSUNO “Taz” Yasuhiro 133ef62d27 feat(dynamodb): vector indexes and SearchVectors (#4215)
* feat(dynamodb): define vector indexes on the table control plane

* feat(dynamodb): serve SearchVectors against vector indexes

* feat(dynamodb): validate vector attributes on write

* feat(dynamodb): report vector write capacity on writes

* fix(dynamodb): reject a PartiQL read of a vector index

* test(dynamodb): cover vector search in Floci's own suite

* fix(dynamodb): match AWS on vector member paths and the f32 number format

* fix(dynamodb): match AWS on the vector search validation gaps

* perf(dynamodb): stop retaining and recomputing per candidate in vector search

* docs(dynamodb): document that indexes are not stored
2026-09-23 08:57:08 -04:00
Attila Kis 5d23a70cc0 fix(dynamodb): honor MICROSECOND ApproximateCreationDateTimePrecision for Kinesis destinations and streams false enablement (#3874)
* fix(dynamodb): honor MICROSECOND ApproximateCreationDateTimePrecision for Kinesis destinations

Store the precision requested in EnableKinesisStreamingConfiguration, echo it in the
enable response, and return it from DescribeKinesisStreamingDestination, so Terraform
no longer destroys and recreates the destination on every apply.
Stamp ApproximateCreationDateTime in epoch microseconds for MICROSECOND destinations,
with a shared eventID per change across destinations.
Reject precisions other than MILLISECOND and MICROSECOND with ValidationException.
Add forwarder unit and end-to-end integration coverage, and document the behavior.

* fix(dynamodb): stop enabling DynamoDB Streams with a Kinesis destination

EnableKinesisStreamingDestination turned on DynamoDB Streams for the table.
Kinesis forwarding does not need it, and Terraform saw stream_enabled drift
on aws_dynamodb_table on every run.
Leave the table's stream setting as the caller configured it.

* test(dynamodb): add Terraform compat test for Kinesis destination precision

Apply a Kinesis streaming destination with MICROSECOND precision and check that
it reads back, that a second plan is clean, and that a precision change
replaces the destination once and then settles.
2026-09-19 15:55:44 -04:00
Vũ Thế Huy 29b601834b feat: add DynamoDB to Redshift zero-ETL replication (#3872)
* feat: add DynamoDB to Redshift zero-ETL replication

* fix(redshift): preserve zero-etl account polling state

* fix(redshift): preserve zero-etl target account
2026-09-18 22:35:10 -04:00
TATSUNO “Taz” Yasuhiro cbec02df04 feat(dynamodb): import tables from S3 and report new exports as IN_PROGRESS (#3138)
* feat(dynamodb): import tables from S3 and report new exports as IN_PROGRESS

ExportTableToPointInTime handed its worker the same description object it
returned, so a small export could already read COMPLETED in the initial
response. The worker now mutates a copy and runs under the request account.

ImportTable creates the table in CREATING, loads DynamoDB JSON lines from
every object under the S3 prefix on a virtual thread, and flips the table
to ACTIVE when done. DescribeImport and ListImports report it. DYNAMODB_JSON
with NONE or GZIP compression is accepted. CSV, ION and ZSTD are rejected
with a ValidationException.

* fix(dynamodb): item calls on a CREATING table return ResourceNotFoundException

* fix(dynamodb): concurrent ImportTable calls with one ClientToken share one import

* fix(dynamodb): import reads S3 as the caller and denies another account's bucket
2026-09-07 22:25:24 -05:00
Guilherme Scaranse a9df872956 fix(dynamodb): route Kinesis CDC to the table owner's account and retry failed forwards (#3063)
* fix(dynamodb): resolve Kinesis CDC forwards against the table owner's account

DynamoDB->Kinesis CDC forwarding resolved the target stream against the ambient
account. Out of request scope -- notably the TTL sweep, which forwards a REMOVE per
expired item after the request completes -- the ambient account falls back to the
default, so CDC records could be written into the default account's same-named stream
(a cross-tenant leak) or dropped as ResourceNotFound. This was a live bug on the TTL
path.

- Add KinesisService.putRecordForAccount: resolve, append and persist against a
  specified account (a null account preserves the ambient behavior). It keeps the
  per-stream append lock keyed on region+stream (not account) so explicit-account
  appends stay serialized with request-path producers, preserving the concurrent-
  append fix; and it migrates a legacy unprefixed stream into the account partition on
  write (ownership validated by the stream's ARN/account) so installs upgraded from
  pre-multi-account storage keep forwarding.
- KinesisStreamingForwarder.forward now takes the table owner account and forwards via
  putRecordForAccount.
- DynamoDbService passes the owner account at every forward site: the request paths use
  the request account; the TTL sweep uses the account it derives from the storage key.

AWS Compatibility: CDC records land in the table owner's stream, matching AWS
per-account isolation. Known residual: the DynamoDB Streams subsystem
(DynamoDbStreamsService) has the same ambient-account exposure and is not addressed
here.

* fix(dynamodb): retry and park failed Kinesis CDC forwards instead of dropping them

Change data capture forwarding to a Kinesis streaming destination dropped the
change event whenever putRecord threw, so a transient Kinesis error silently
lost DynamoDB INSERT/MODIFY/REMOVE (and TTL) events.

Forwarding is now a bounded best-effort, in-process retry queue. The write path
only enqueues (it never blocks or throws), and a per-destination single-flight
background drain performs the send outside the lock:

- transient/unknown failures retry with capped exponential backoff (250ms->8s,
  up to 10 attempts) instead of dropping on the first exception;
- deterministic terminal failures (Validation/InvalidArgument) drop only the
  poison record without wedging the queue behind it;
- per-destination FIFO is preserved across retries;
- the buffer is bounded (1000 records per destination, oldest evicted on
  overflow);
- after the retry budget is exhausted the episode gives up, and a later event
  starts a fresh episode that self-heals once the stream recovers.

Disabling a destination or deleting the table discards its buffered records and
stops all future sends for it (a send already in flight may still complete).
Dropped records are counted and per-destination delivery health
(forwarded/retried/dropped, queue depth, last error) is tracked for inspection.
Buffered records are in memory only and are not durable across restarts.

* style(dynamodb): remove em dashes from lines this branch adds

AGENTS.md requires colons, commas or periods instead of em dashes. Comment,
javadoc and docs prose only; no code or string literals change.

* fix(kinesis): resolve the stream inside the append lock, not before it

putRecordInternal resolved the stream before taking the per-stream monitor. That
resolve is not a read: for a legacy unprefixed stream it migrates the entry, and
the two migration paths disagree. The explicit-account path moves it into the
account partition behind an ownership predicate and is synchronized on the
backend, while AccountAwareStorageBackend.get adopts it into the request account
with no ownership check and no synchronization. Racing outside the monitor, an
ambient producer and the owner's CDC producer could migrate the same stream
concurrently, forking it across partitions or adopting it into the default
account, which is the cross-account leak this branch set out to close.

Resolve and validate inside the monitor instead. The separate pre-lock resolve is
gone, so there is one resolve rather than two, and deleteStream holding the same
monitor still makes a concurrently deleted stream fail cleanly.

Residual, pre-existing and not addressed here: AccountAwareStorageBackend.get
still adopts an unprefixed entry into the request account unchecked and
unsynchronized for callers that do not hold a per-resource lock.

* fix(storage): migrate a legacy unprefixed entry under the account monitor

AccountAwareStorageBackend has two migrate-on-read paths that disagree.
getForAccountMigratingLegacy is synchronized and ownership-gated; get is neither.
Because get does not take the monitor the migrating variants hold, two readers
resolving the same pre-multi-account key from different account contexts can each
copy it into their own partition, and the two copies then diverge independently.

The migration branch now runs under that same monitor and re-checks the prefixed
key inside it, so a reader that lost the race returns the winner's entry instead
of migrating again. The hit path stays outside the monitor, so only a miss pays
for it.

This closes the fork for every caller rather than one at a time. The preceding
commit fixed it for KinesisService.putRecordInternal by resolving inside the
append lock, but the Kinesis batch PutRecords handler and roughly twenty read
paths (DescribeStream, GetRecords, GetShardIterator, tag reads) resolve without
any per-resource lock and were still exposed.

Not addressed here: get still adopts an unprefixed entry into whatever account
the request context resolves to, with no ownership check. get is generic over the
stored type and has no notion of an owner, which is why getForAccountMigratingLegacy
takes the predicate from its caller. Gating it generically needs a per-resource-type
predicate and is filed separately.
2026-09-05 21:20:44 -04:00
Vũ Thế Huy 80725e6f48 fix(dynamodb): flush persistence once per affected table in batch and transact writes (#2998)
* test(dynamodb): add tests asserting single persistence flush per table in batch and transact writes

* fix(dynamodb): flush persistence once per affected table in batch and transact writes (#2995)

* docs(dynamodb): document batch persistence and recommend wal/hybrid for write workloads (#2995)

* fix(dynamodb): pre-validate operations and guarantee persistence flush in batch and transact writes (#2995)

* fix(dynamodb): reject duplicate items in transaction and rollback partial writes on failure
2026-09-04 14:06:13 -04:00
Hector Ventura 9e35046647 Docs/enviroment instead yml (#764)
* docs: moving all config to env instead of yml
* docs: sync with main and new features
* docs: reverting docker-compose.yml
2026-05-10 11:53:31 -05:00
Hector Ventura f30bd79d67 chore: release 1.5.10 2026-04-30 00:59:04 -05:00
TiM a32b7f1f3b docs: comprehensive audit sweep + CHANGELOG backfill (1.1.0-1.5.2) (#326)
CHANGELOG.md was empty for the 1.1.0-1.5.2 release cycle and service docs
had drifted from code behaviour. This sweep reconciles docs against the
current codebase on upstream/main.

- Backfill CHANGELOG.md for 1.1.0 through 1.5.2 from git history
- Correct exact operation counts in docs/services/index.md: S3 (~30 -> 58),
  Lambda (~25 -> 30), API Gateway v1 (~24 -> 62). Counts now come from the
  actual dispatch handlers rather than @Path annotation counts.
- Rewrite README "Supported Services" table to drop per-service op counts
  (they drift too fast); point readers at docs/services/index.md
- Update 24 service docs for accuracy, add "Not Implemented" sections
  where relevant (s3.md, lambda.md, api-gateway.md)
- Refresh configuration and getting-started docs
- Add EventBridge Scheduler and AppConfig to mkdocs nav
- Add AppConfig / AppConfigData rows to README and services index
  following the 1.5.2 upstream release
2026-04-10 10:52:34 -05:00
Hector Ventura 61433f59ab firt commit 2026-03-15 17:43:56 -05:00