Skip to content

Commit

Permalink
ci: add a cloudwatch rule to keep the lambda warm
Browse files Browse the repository at this point in the history
  • Loading branch information
Akeboshiwind committed Jun 3, 2024
1 parent 3dd1de1 commit 7757eb3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cloudformation/04-domain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ Resources:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset-aliastarget.html#cfn-route53-recordset-aliastarget-hostedzoneid
HostedZoneId: 'Z2FDTNDATAQYW2'
EvaluateTargetHealth: false

KeepLambdaWarmTrigger:
Type: AWS::Events::Rule
Properties:
Description: "ScheduledRule"
ScheduleExpression: "rate(15 minutes)"
State: "ENABLED"
Targets:
- Arn: '{{resolve:ssm:xt-play_play-lambda-alias-arn}}'
Id: "TargetFunctionV1"

PermissionForEventsToInvokeLambda:
Type: AWS::Lambda::Permission
Properties:
FunctionName: '{{resolve:ssm:xt-play_play-lambda-name}}'
Action: "lambda:InvokeFunction"
Principal: "events.amazonaws.com"
SourceArn: !GetAtt KeepLambdaWarmTrigger.Arn

0 comments on commit 7757eb3

Please sign in to comment.