amazon-web-services - 使用 PITR 恢复 DynamoDB 表并更新 Cloudformation/CDK/其他服务引用

标签 amazon-web-services amazon-dynamodb aws-cloudformation aws-cdk pitr

我的环境中,我的 DynamoDB 表是一些服务(一些 lambda、kinesis 和 firehose)的核心。所有这些都由 AWS 的 CloudFormation/Typescript CDK 管理。

该表启用了 PITR,据我所知,只能通过将恢复的数据转储到新表中来执行 PITR。这就是痛苦开始的地方:

  1. 创建新表后 AWS 的文档不存在!
  2. 如何更新所有其他服务上新表格的引用?
  3. 我应该“删除”旧表并导入恢复的表吗?
  4. 这是否意味着我需要关闭服务才能恢复?
  5. 这里的“标准”或“最佳实践”是什么?

非常感谢社区! :D

最佳答案

您必须恢复到新表,是的。有一些方法可以克服您所描述的问题。首先,当您恢复到新表时,您将需要 import that resource到您的 CDK 堆栈。

Parameter Store

使用参数Store来保存您的表的最新名称,您的所有下游应用程序将通过查询参数存储来解析表名称。

Lambda Env Variable

将表名称动态设置为 lambda 的环境变量,与其他方法相比,这会减少延迟,但它仅适用于 Lambda 或允许您设置环境变量的服务。

内嵌答案以确保完整性

AWS's documentation after the creation of the new table is INEXISTENT!

如果您认为缺少相关信息,请直接在文档页面上分享反馈。

How can I update the references for the new table on all other services?

上面提到的两个选项是最常见的方法。

Should I just 'erase' my old table and import the recovered ones?

这会导致应用程序停机,如果您能负担得起,那么这将是一个简单的方法。如果没有,请按照上述建议进行操作。

Wouldn't this means that I would need to take my service down to recover it? What is the "standard" or "best practice" here?

是的,如上所述。

关于amazon-web-services - 使用 PITR 恢复 DynamoDB 表并更新 Cloudformation/CDK/其他服务引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75259636/

相关文章:

reactjs - AWS Amplify React App 部署错误 - 重定向或 AWS build设置过多

javascript - DynamoDB batchWriteItem 在 node.js 中崩溃

amazon-web-services - 用于将新 EBS 卷附加到 Windows 和分区的 AWS CloudFormation 模板

amazon-web-services - 如何更新 DynamoDB 中的所有记录?

javascript - 从浏览器使用 DynamoDB 的最简单方法是什么?

json - cloudformation 模板中的 opsworks 参数和资源

amazon-web-services - Cloudformation如何保护Elasticsearch集群数据?

amazon-web-services - 无论用户访问的内容类型如何,将 CloudFront 定位在 ALB 前面是否更好?

go - Dynamodb 解码映射到结构

aws-cloudformation - 如何为多个现有资源编写CloudFormation模板文件以进行一键部署