2 Answers
- Newest
- Most votes
- Most comments
0
Looking at the documentation, what you are trying to do is not supported. TargetAction is limited to
{
"PauseCluster" : PauseClusterMessage,
"ResizeCluster" : ResizeClusterMessage,
"ResumeCluster" : ResumeClusterMessage
}
You could use EventBridge instead to schedule some queries and use CloudFormation to do it.
0
I tried to schedule the redshift query using eventbridge, at max it led to adding the query in the list of scheduled queries in redshift but query was never executed and I got the info that eventbridge cannot send request or make call to redshift data api.
Code Snippet using eventbridge
RedshiftSchedule:
Type: AWS::Events::Rule
DependsOn: [QrLogGroup, RedshiftScheduledQueryRoles]
Properties:
EventBusName: default
Description: "Schedule for Redshift Query Execution"
ScheduleExpression: cron(52 18 * * ? *)
State: "ENABLED"
Targets:
- Id: QueryExecution
Arn: arn:aws:redshift:eu-west-1:880478141414:cluster:alamar-data-platform-redshift-dev
RoleArn: !GetAtt RedshiftScheduledQueryRoles.Arn
RedshiftDataParameters:
DbUser: rsadmin
#ClusterIdentifier: alamar-data-platform-redshift-dev
#SecretManagerArn: "arn:aws:secretsmanager:eu-west-1:880478141414:secret:testing-secret-VQU8jo"
Database: redshiftdb
Sql: select gross_sales, profit, order_count, branch_localized, branch_reference, foodics_account_id,
market, order_date from foodics_reports.foodics_daily_sales where market='Morocco' and
order_date='2024-05-20' order by order_date desc;
StatementName: test-redshift-cluster-data
WithEvent: true
- Id: QueryLoging
Arn: !GetAtt QrLogGroup.Arn
provide me solution on how to schedule redshift queries how to add saved query in redshift using cloudformation yaml script (esp without using any third service) and what is the scope and usage of cloudformation custom resource in this regard?
answered 21 days ago
Relevant content
- Accepted Answerasked 6 months ago
- asked 2 years ago
- asked 8 months ago
- asked 3 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago