-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: aws_dynamodb_table Add support for TimeToLive #14104
Merged
grubernaut
merged 3 commits into
hashicorp:master
from
rlweb:feature/aws_dynamodb_table-add-timetolive
May 1, 2017
+254
−0
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,11 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { | |
type = "N" | ||
} | ||
|
||
ttl { | ||
attribute_name = "TimeToExist" | ||
enabled = false | ||
} | ||
|
||
global_secondary_index { | ||
name = "GameTitleIndex" | ||
hash_key = "GameTitle" | ||
|
@@ -72,6 +77,7 @@ The following arguments are supported: | |
* `type` - One of: S, N, or B for (S)tring, (N)umber or (B)inary data | ||
* `stream_enabled` - (Optional) Indicates whether Streams are to be enabled (true) or disabled (false). | ||
* `stream_view_type` - (Optional) When an item in the table is modified, StreamViewType determines what information is written to the table's stream. Valid values are KEYS_ONLY, NEW_IMAGE, OLD_IMAGE, NEW_AND_OLD_IMAGES. | ||
* `ttl` - (Optional) Indicates whether time to live is enabled (true) or disabled (false) and the `attribute_name` to be used. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's more typical for the docs to more explicitly list the sub-attributes, eg in a nested list? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, opened #14492 to address. |
||
* `local_secondary_index` - (Optional, Forces new resource) Describe an LSI on the table; | ||
these can only be allocated *at creation* so you cannot change this | ||
definition after you have created the resource. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was confused by the example attribute name and the way Amazon calls this a Time To Live. In fact the data stored here should be a unix timestamp of when the record expires, not an amount of time (seconds? ms?) for which the data should "live" or "exist". This might be more clear if the
attribute_name
was something along the lines of "ExpirationTimestamp".