简体   繁体   English

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

[英]How to execute AWS SSM automation document script daily?

Background: I am trying to generate patch compliance data report in quicksight.背景:我正在尝试快速生成补丁合规性数据报告。 In order to do it I am using terraform I have added all inventory data in S3 bucket.为了做到这一点,我使用了 terraform,我在 S3 存储桶中添加了所有库存数据。

I have created Athena automation document which creates database/tables in Athena using S3 bucket data.我创建了 Athena 自动化文档,该文档使用 S3 存储桶数据在 Athena 中创建数据库/表。 Now I want to add some terraform code which execute automation document daily on scheduled time.现在我想添加一些在预定时间每天执行自动化文档的 terraform 代码。 For more information about this task: https://reinvent2019.awsmanagement.tools/mgt410/en/cont.html有关此任务的更多信息: https : //reinvent2019.awsmanagement.tools/mgt410/en/cont.html

Problem: I can create maintenance window to define crone job for automation task but I do not have target to add.问题:我可以创建维护窗口来定义自动化任务的 crone 作业,但我没有要添加的目标。 My Athena Automation script is only creating/updating database in the Athena.There is no role of target here.我的 Athena 自动化脚本只是在 Athena 中创建/更新数据库。这里没有目标角色。

Can someone guid me on this issue?有人可以指导我解决这个问题吗? Thank you in advance先感谢您

You can create a CloudWatch Event that triggers on schedule and calls Lambda function, that in turn invokes you Athena logic.您可以创建一个按计划触发并调用 Lambda 函数的CloudWatch 事件,该函数进而调用您的 Athena 逻辑。 Here is the good example: https://thedataguy.in/automate-aws-athena-create-partition-on-daily-basis/这是一个很好的例子: https : //thedataguy.in/automate-aws-athena-create-partition-on-daily-basis/

Note on QuickSight - if you are using Spice, instead of direct query - you need to manage Spice rebuild too.关于 QuickSight 的注意事项 - 如果您使用的是 Spice,而不是直接查询 - 您也需要管理 Spice 重建。 Which might be tricky... The default setting only allow for once-a-day rebuild on schedule.这可能很棘手......默认设置只允许按计划每天重建一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS SSM 文档自动化循环 - AWS SSM Document Automation loop AWS SSM 自动化:如何在 aws:executeScript 调用的脚本中正常失败 - AWS SSM Automation: How to gracefully fail in script invoked by aws:executeScript 我在哪里/如何在 AWS SSM 自动化文档中定义 NotificationConfig? - Where/how do I define a NotificationConfig in an AWS SSM Automation document? 使用参数从 AWS SSM 自动化执行 Lambda - Execute Lambda from AWS SSM Automation with Parameters AWS Cloudformation SSM 自动化文档 | 与 aws cloudformation package 一起使用 - AWS Cloudformation SSM automation document | use with aws cloudformation package AWS-RunShellScript 中的 ssm 自动化文档输入不替换变量 - ssm automation document input in AWS-RunShellScript not substituting variable 如何从AWS SSM文档中正确引用Powershell脚本? - How do I properly reference a Powershell script from an AWS SSM document? 如何使用 Terraform 的 aws_ssm_document 在目标 VM 上运行 powershell 脚本 - How can I run a powershell script on a target VM using Terraform's aws_ssm_document AWS SSM RunCommand - RunRemoteScript 文档出现问题,以使用参数运行 PowerShell 脚本 - AWS SSM RunCommand - Issue with RunRemoteScript Document to run PowerShell script with parameters 带有私人信息的AWS SSM文档 - AWS SSM document with private information
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM