Skip to content

fix(dynamodb): honor MICROSECOND ApproximateCreationDateTimePrecision for Kinesis destinations and streams false enablement - #3874

Merged
pgermosen merged 3 commits into
floci-io:mainfrom
atosz33:fix/kinesis-creation-date-precision-microsecond-support
Sep 19, 2026
Merged

pgermosen merged 3 commits into
floci-io:mainfrom
atosz33:fix/kinesis-creation-date-precision-microsecond-support

Conversation

@atosz33

@atosz33 atosz33 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Heey,

While testing my service, I found an issue with the ApproximateCreationDateTime precision of Kinesis streaming destinations. My infra uses MICROSECOND instead of MILLISECOND, but Floci did not support it, so I added it.

Floci ignored the precision and always reported MILLISECOND. The Terraform provider marks this field as ForceNew, so a MICROSECOND destination was destroyed and recreated on every apply.

While looking around, I also found a second issue: enabling a Kinesis streaming destination also turned on DynamoDB Streams for the table. On AWS these two features are separate, and Kinesis forwarding in Floci does not need DynamoDB Streams. Because of this, Terraform planned to turn the stream off on aws_dynamodb_table on every run.

What changed

  • EnableKinesisStreamingDestination stores ApproximateCreationDateTimePrecision, and returns it in its response and in DescribeKinesisStreamingDestination.
  • For MICROSECOND destinations, ApproximateCreationDateTime in the Kinesis record is in epoch microseconds.
  • A precision other than MILLISECOND or MICROSECOND is rejected with ValidationException.
  • Enabling a Kinesis streaming destination no longer changes the table's DynamoDB Streams setting.

Type of change

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

Incorrect behavior before this PR:

  • DescribeKinesisStreamingDestination always returned ApproximateCreationDateTimePrecision: MILLISECOND, even when the destination was enabled with MICROSECOND.
  • Records were always stamped in milliseconds.
  • EnableKinesisStreamingDestination turned on DynamoDB Streams (NEW_AND_OLD_IMAGES) on the table.

Behavior change

Enabling a Kinesis streaming destination no longer turns on DynamoDB Streams. If someone relied on this, they need to enable streams on the table themselves (StreamSpecification).

Tests

  • Unit and integration tests for storing, returning and apply
  • Integration test that DynamoDB Streams stays off after enabling a Kinesis destination.
  • New Terraform compat test (compatibility-tests/compat-terraform/test/dynamodb_kinesis_precision.bats): apply, second plan is clean, and a
    precision change replaces the destination once and then settles. It fails on main and passes on this branch.

Checklist

  • ./mvnw test passes locally
  • New or updated integration test added
  • Commit messages follow Conventional Commits

… 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.
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.
…cision

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.
@atosz33 atosz33 changed the title Fix/kinesis creation date precision microsecond support fix(dynamodb): honor MICROSECOND ApproximateCreationDateTimePrecision for Kinesis destinations and streams false enablement Sep 18, 2026
@hectorvent hectorvent added bug Something isn't working dynamodb Amazon DynamoDB labels Sep 19, 2026
@atosz33
atosz33 marked this pull request as ready for review September 19, 2026 15:50

@pgermosen pgermosen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find, and good that you chased the second issue too. I went through it against the DynamoDB model and the provider source: the precision enum, the EnableKinesisStreamingConfiguration in the Enable response and the field in Describe all match, and the provider does mark approximate_creation_date_time_precision as ForceNew, so the replace-once assertion in the Terraform test is right. The forwarder handling is careful (a snapshot of each destination's precision, one eventID shared across precisions, exact microsecond math), and old persisted destinations read back as MILLISECOND. I also looked for anything that relied on enabling a Kinesis destination turning DynamoDB Streams on and found nothing, and you called out the behavior change in the description, which is what it needed. The Terraform test now runs and passes in CI.

I corrected the test path in the description, it pointed at compat-terrs_precision.bats and the file is compatibility-tests/compat-terraform/test/dynamodb_kinesis_precision.bats.

A few things that don't need to hold this up, for follow-ups:

  • The real API also has UpdateKinesisStreamingDestination, which changes the precision on an active destination. Floci doesn't dispatch it yet. Terraform doesn't call it, so this PR isn't affected.
  • The local test run box in the checklist is unticked, worth ticking if you ran it.
  • Not about this PR, but the native image artifact in the compatibility workflow has a one day retention, so re-running just a failed job after a day fails at the download step. That's what tripped the CI here.

@pgermosen
pgermosen merged commit 5d23a70 into floci-io:main Sep 19, 2026
74 of 78 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dynamodb Amazon DynamoDB

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants