-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
63 lines (51 loc) · 1.4 KB
/
serverless.yml
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
54
55
56
57
58
59
60
61
62
63
# Receive and publish AWS health events
service: aws-health-event-to-slack-message
plugins:
- serverless-python-requirements
- serverless-sam
custom:
stage: "${opt:stage, env:SLS_STAGE, 'dev'}"
profile: "${opt:aws-profile, env:AWS_PROFILE, env:AWS_DEFAULT_PROFILE, 'default'}"
log_level: "${env:LOG_LEVEL, 'INFO'}"
pythonRequirements:
dockerizePip: false
provider:
name: aws
profile: ${self:custom.profile}
stage: ${self:custom.stage}
runtime: python3.11
environment:
LOG_LEVEL: ${self:custom.log_level}
stackTags:
x-service: aws-health-event-publisher
x-stack: ${self:service}-${self:provider.stage}
iamRoleStatements:
- Effect: "Allow"
Action: "SNS:Publish"
Resource:
Ref: HealthEventSnsTopic
functions:
SnsHealthEventPublisher:
handler: handlers/aws_health_event_publisher.handler
description: "Receive and publish AWS Health events"
memorySize: 128
timeout: 10
environment:
AWS_SNS_TOPIC_ARN:
Ref: HealthEventSnsTopic
events:
- cloudwatchEvent:
event:
source:
- "aws.health"
resources:
Resources:
HealthEventSnsTopic:
Type: "AWS::SNS::Topic"
Outputs:
HealthEventSnsTopicArn:
Description: "AWS SNS Topic ARN"
Value:
Ref: HealthEventSnsTopic
Export:
Name: "${self:service}-${self:provider.stage}-HealthEventSnsTopicArn"