forked from newrelic/aws-log-ingestion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sam-template.yaml
31 lines (29 loc) · 1.05 KB
/
sam-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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Sends log data from CloudWatch Logs and S3 to New Relic Infrastructure (Cloud integrations) and New Relic Logging.
Parameters:
NRLicenseKey:
Type: String
Description: Your NewRelic license key. You may omit it when deploying the function.
Default: "YOUR_LICENSE_KEY"
Resources:
NewRelicLogIngestionFunction:
Type: 'AWS::Serverless::Function'
Properties:
Runtime: python3.6
Handler: function.lambda_handler
CodeUri:
Bucket: nr-serverless-applications
Key: newrelic-log-ingestion.zip
FunctionName: newrelic-log-ingestion
Timeout: 30
Environment:
Variables:
LICENSE_KEY: !Ref NRLicenseKey
LambdaInvokePermission:
Type: AWS::Lambda::Permission
Properties:
FunctionName: !Ref NewRelicLogIngestionFunction
Action: lambda:InvokeFunction
Principal: !Sub logs.${AWS::Region}.amazonaws.com
SourceArn: !Sub arn:aws:logs:${AWS::Region}:${AWS::AccountId}:log-group:*