Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ddb ttl resource-exceptions for inexistent tables #9038

Merged
merged 1 commit into from Sep 1, 2023

Conversation

ackdav
Copy link
Member

@ackdav ackdav commented Aug 31, 2023

Motivation

This PR addresses that the DDB operations DescribeTimeToLive and UpdateTimeToLive both had no checks in regards to the existence of the table, as highlighted in #9030.

The ResourceNotFoundException message might look peculiar, but this is due to parity:

$ aws dynamodb describe-time-to-live --table-name test

An error occurred (ResourceNotFoundException) when calling the DescribeTimeToLive operation: Requested resource not found: Table: test not found

$ aws dynamodb update-time-to-live --table-name test --time-to-live-specification Enabled=true,AttributeName=ttl

An error occurred (ResourceNotFoundException) when calling the UpdateTimeToLive operation: Requested resource not found: Table: test not found

I would've liked to prove this via a snapshot test, but the refactoring was out of scope for this simple patch.

fixes: #9030

Changes

  • add resource checks for both operations
  • add a simple check to the test

@ackdav ackdav added the semver: patch Non-breaking changes which can be included in patch releases label Aug 31, 2023
@ackdav ackdav added this to the 2.3 milestone Aug 31, 2023
@ackdav ackdav self-assigned this Aug 31, 2023
@coveralls
Copy link

Coverage Status

coverage: 80.439% (-0.01%) from 80.451% when pulling a6a6362 on fix_ddb_ttl_default into 5217b87 on master.

@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 25m 45s ⏱️
2 151 tests 1 677 ✔️ 474 💤 0
2 152 runs  1 677 ✔️ 475 💤 0

Results for commit a6a6362.

@ackdav ackdav merged commit 6918416 into master Sep 1, 2023
29 checks passed
@ackdav ackdav deleted the fix_ddb_ttl_default branch September 1, 2023 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: describeTimeToLive should throw resource not found
3 participants