simplify-cli
Version:
Simplify CLI - Easy Deployment
35 lines (33 loc) • 1 kB
YAML
AWSTemplateFormatVersion: '2010-09-09'
Description: CloudWatch Schedule resource stack creation using Simplify CLI
Parameters:
Environment:
Type: String
FunctionName:
Type: String
FunctionARN:
Type: String
Resources:
CloudWatchScheduledRule:
Type: AWS::Events::Rule
Properties:
Description: ScheduledRule
ScheduleExpression: rate(10 days) # or cron(https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html)
State: ENABLED
Targets:
- Arn: !Ref FunctionARN
Id: !Sub LambdaScheduleEvent-${Environment}
CloudWatchPermissionForEventsToInvokeLambda:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref FunctionName
Action: lambda:InvokeFunction
Principal: events.amazonaws.com
SourceArn: !GetAtt CloudWatchScheduledRule.Arn
Outputs:
Region:
Value: !Ref AWS::Region
StackId:
Value: !Ref AWS::StackId
Endpoint:
Value: !GetAtt CloudWatchScheduledRule.Arn