简体   繁体   中英

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.

I have created Athena automation document which creates database/tables in Athena using S3 bucket data. Now I want to add some terraform code which execute automation document daily on scheduled time. For more information about this task: 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. My Athena Automation script is only creating/updating database in the Athena.There is no role of target here.

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. Here is the good example: 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. Which might be tricky... The default setting only allow for once-a-day rebuild on schedule.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM