Created
February 8, 2023 04:41
-
-
Save thanakijwanavit/ae4e56fc73f2460e95d695caef1e3f60 to your computer and use it in GitHub Desktop.
keep lambda function warm in sam template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
WarmFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
CodeUri: ./src | |
Handler: index.handler | |
Runtime: python3.8 | |
Events: | |
WarmUpEvent: | |
Type: Schedule | |
Properties: | |
Schedule: rate(5 minutes) | |
Enabled: true | |
Input: '{"query":"warm"}' | |
Environment: | |
Variables: | |
LOG_LEVEL: INFO | |
Outputs: | |
WarmFunctionName: | |
Description: The name of the warm function | |
Value: !Ref WarmFunction | |
Export: | |
Name: WarmFunctionName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment