-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.yaml
51 lines (45 loc) · 1.35 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: Datadog lambda monitor example
Parameters:
Env:
Type: String
Description: Environment
Default: dev
Secrets:
Type: String
Description: The name of the secrets in AWS SM.
Default: 'dev/CloudFormation/DataDogKeys'
Resources:
DataDogMonitorLambda:
Type: 'AWS::Serverless::Function'
Properties:
Handler: datadog_lambda_function.handler
Runtime: python3.6
Description: A function which manages the creation of monitors in DataDog.
Tracing: Active
Policies:
- AWSSecretsManagerGetSecretValuePolicy:
SecretArn: !Sub 'arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:${Secrets}*'
Environment:
Variables:
SECRETS: !Ref Secrets
TestLambda:
Type: 'AWS::Serverless::Function'
Properties:
Handler: lambda_function.handler
Runtime: python3.6
Description: A test function.
Tracing: Active
Tags:
env: !Ref Env
TestLambdaDDMonitor:
Type: 'Custom::DataDogMonitor'
Properties:
ServiceToken: !GetAtt DataDogMonitorLambda.Arn
Name: "CR TestLambda Monitor"
FunctionName: !Ref TestLambda
Message: "Test Message \[email protected]@email.co.uk"
Priority: 3
Tags:
- "env:dev"