如何每天执行AWS SSM自动化文档脚本?

How to execute AWS SSM automation document script daily?

背景: 我正在尝试快速生成补丁合规性数据报告。为了做到这一点,我正在使用 terraform 我已经在 S3 存储桶中添加了所有库存数据。

我创建了 Athena 自动化文档,该文档使用 S3 存储桶数据在 Athena 中创建 database/tables。现在我想添加一些 terraform 代码,每天按计划时间执行自动化文档。 有关此任务的更多信息:https://reinvent2019.awsmanagement.tools/mgt410/en/cont.html

问题: 我可以创建维护 window 来为自动化任务定义 crone 作业,但我没有要添加的目标。 我的 Athena Automation 脚本只是 creating/updating database 在 Athena.There 这里没有 target 的作用。

有人可以指导我解决这个问题吗? 提前谢谢你

您可以创建 CloudWatch Event that triggers on schedule and calls Lambda function, that in turn invokes you Athena logic. Here is the good example: https://thedataguy.in/automate-aws-athena-create-partition-on-daily-basis/

关于 QuickSight 的注意事项 - 如果您使用的是 Spice,而不是直接查询 - 您还需要管理 Spice 重建。这可能很棘手...默认设置仅允许按计划每天重建一次。