hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.77k stars 9.12k forks source link

[Enhancement]: Add Option to Restore a DynamoDB Table From a Backup (not PITR) #29883

Open lobsterdore opened 1 year ago

lobsterdore commented 1 year ago

Description

In addition to PITR, DynamoDB supports backup and restoration from traditional snapshots/backups, usually taken via AWS Backup. The aws_dynamodb_table resource currently lacks the ability to create/restore a table from a backup, offering only PITR options at present.

A backup_arn option could be added that would use the RestoreTableFromBackup API to restore a table.

Affected Resource(s) and/or Data Source(s)

Potential Terraform Configuration

resource "aws_dynamodb_table" "example" {
  name             = "example"
  hash_key         = "TestTableHashKey"
  billing_mode     = "PAY_PER_REQUEST"
  stream_enabled   = true
  stream_view_type = "NEW_AND_OLD_IMAGES"

  backup_arn       = "arn:aws:dynamodb:us-east-1:123456789012:table/example/backup/01489173575360-b308cd7d"

  attribute {
    name = "TestTableHashKey"
    type = "S"
  }
}

References

Would you like to implement a fix?

No

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue