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 support for DynamoDB TTL #12530

Closed
danthegoodman opened this issue Mar 8, 2017 · 10 comments
Closed

Add support for DynamoDB TTL #12530

danthegoodman opened this issue Mar 8, 2017 · 10 comments

Comments

@danthegoodman
Copy link

AWS recently announced the ability to set a TTL on items in a DynamoDB. It requires an additional property to be set for the dynamo table, which I'd like to control via Terraform.

Affected Resource(s)

  • aws_dynamodb_table

References

https://aws.amazon.com/about-aws/whats-new/2017/02/amazon-dynamodb-now-supports-automatic-item-expiration-with-time-to-live-ttl/

@glasser
Copy link
Contributor

glasser commented Mar 8, 2017

Yeah, I'd use this too.

I guess we'd add a time_to_live_attribute string which names the attribute to use for this? And would we want to have every Read call invoke DescribeTimeToLive even if time_to_live_attribute isn't set, in order to turn it off if it's there?

@rog555
Copy link

rog555 commented Mar 17, 2017

+1

2 similar comments
@umeat
Copy link

umeat commented Mar 20, 2017

+1

@roylines
Copy link

+1

@apparentlymart
Copy link
Contributor

apparentlymart commented Apr 4, 2017

Hi @danthegoodman! Thanks for this feature request.

@glasser, your characterization of the implementation approach feels right to me. Based on a quick skim of the API docs for this, I think the right mapping would be a new ttl block in the resource which mirrors the structure of TimeToLiveSpecification:

ttl {
  attribute_name = "foo"
  enabled = true
}

As @glasser noted, it would be important to call DescribeTimeToLive during Read in order to update Terraform's state to match the real resource. Additionally, it looks like changes to the TTL config apply asynchronously so to preserve Terraform's expected behavior (resource changes aren't complete until they are confirmed committed to the real API) it will be necessary for Update to poll DescribeTimeToLive until TimeToLiveStatus settles on either "ENABLED" or "DISABLED" (depending on what direction we're moving in).

The Terraform team isn't likely to work on this in the near future, but if someone had the time and motivation to write a pull request for it we'd be happy to review it.

@marksailes
Copy link

+1

2 similar comments
@joshdurbin
Copy link

+1

@joncarter51
Copy link

+1

@radeksimko
Copy link
Member

Merged and released in 0.9.5:
#14104

@ghost
Copy link

ghost commented Apr 12, 2020

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.

@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests