1
votes

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

1
What about CloudWatch Event rule based on your schedule with target of automation?Marcin
Thanks Marcin for your response. I will try with CloudWatch Event Rule.Jiya
Ok. Let me know how it goes.Marcin
I created CloudWatch event rule to execute Automation Document manually. I checked in a Cloudtrail and found the following error: "errorCode": "InvalidAutomationExecutionParametersException",Jiya

1 Answers

1
votes

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.