-
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
provider/aws: aws_dynamodb_table Add support for TimeToLive #14104
Conversation
Also, it seems the test pass...!
|
} | ||
|
||
if *ttlDescription.AttributeName != "TestTTL" { | ||
return fmt.Errorf("AttributeName was %s, not TestTTL!", ttlDescription.AttributeName) |
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.
The 2 if statements above fail on the build because of the following...
arg ttlDescription.TimeToLiveStatus for printf verb %s of wrong type: *string
Not sure, what's the best way here?
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.
You can dereference the pointer in the Errorf
argument so the type is truly a string
and not *string
.
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.
LGTM, pending vet fixes
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.
LGTM, thanks!
@@ -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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, opened #14492 to address.
ttl { | ||
attribute_name = "TimeToExist" | ||
enabled = false | ||
} |
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".
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This addresses #12530
I'm a bit of a noob at Go (done the whole tutorial + making a few things) and the whole open source thing, so let me know if this is the correct way!