forked from forno/health-check-sites
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
executable file
·53 lines (49 loc) · 2.2 KB
/
template.yaml
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This is the SAM template that represents the architecture of your serverless application
# https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-template-basics.html
# The AWSTemplateFormatVersion identifies the capabilities of the template
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/format-version-structure.html
AWSTemplateFormatVersion: 2010-09-09
Description: >-
health-check-sites
# Transform section specifies one or more macros that AWS CloudFormation uses to process your template
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/transform-section-structure.html
Transform:
- AWS::Serverless-2016-10-31
Parameters:
WebhookUrl:
Type: String
Description: Slack web hook url
Default: localhost
Targets:
Type: CommaDelimitedList
Description: Target sites list
Default: https://google.com,https://yahoo.co.jp
# Resources declares the AWS resources that you want to include in the stack
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html
Resources:
# This is the Lambda function definition associated with the source code: sqs-payload-logger.js. For all available properties, see
# https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#awsserverlessfunction
HealthCheckSites:
Type: AWS::Serverless::Function
Properties:
Description: A Lambda function that logs the payload of messages sent to an associated SQS queue.
Runtime: nodejs14.x
Architectures:
- x86_64
Handler: src/handlers/health-check-sites.healthCheckSites
# This property associates this Lambda function with a scheduled CloudWatch Event. For all available properties, see
# https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#schedule
# This example runs every hour.
Environment:
Variables:
WEBHOOK_URL: !Ref WebhookUrl
TARGETS: !Join
- ','
- !Ref Targets
Events:
CloudWatchEvent:
Type: Schedule
Properties:
Schedule: cron(0 22 * * ? *)
MemorySize: 128
Timeout: 15