forked from aws-samples/aws-lambda-redshift-event-driven-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventBridgeScheduledEventRule.txt
More file actions
25 lines (25 loc) · 948 Bytes
/
EventBridgeScheduledEventRule.txt
File metadata and controls
25 lines (25 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
EventBridgeScheduledEventRule:
Type: "AWS::Events::Rule"
Properties:
Description: scheduled ELT event rule
ScheduleExpression: !Ref ExecutionSchedule
State: "ENABLED"
Targets:
-
Arn:
Fn::GetAtt:
- "LambdaRedshiftDataApiETL"
- "Arn"
Id: ScheduledEventRedshiftELT
Input: !Sub "{\"Input\":{\"redshift_cluster_id\":\"${RedshiftClusterIdentifier}\",\"redshift_database\":\"${DatabaseName}\",\"redshift_user\":\"${DbUsername}\",\"action\":\"execute_sql\",\"sql_text\":\"${SqlText}\",\"sns_topic_arn\":\"${RedshiftNotificationTopicSNS}\"}}"
PermissionForScheduledEventToInvokeLambda:
Type: AWS::Lambda::Permission
Properties:
FunctionName:
Ref: "LambdaRedshiftDataApiETL"
Action: "lambda:InvokeFunction"
Principal: "events.amazonaws.com"
SourceArn:
Fn::GetAtt:
- "EventBridgeScheduledEventRule"
- "Arn"