forked from newrelic/aws_s3_log_ingestion_lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
63 lines (60 loc) · 1.9 KB
/
template.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Sends log data from S3 to New Relic Logging.
Parameters:
NRLicenseKey:
Type: String
Description: Your New Relic license key. Required to send logs to New Relic Logging.
Default: "YOUR_LICENSE_KEY"
NRLogType:
Type: String
Description: Your New Relic logtype. You may omit it when deploying the function.
Default: ""
DebugEnabled:
Type: String
Description: A boolean to determine if you want to output debug messages in the CloudWatch console
Default: "false"
Metadata:
AWS::ServerlessRepo::Application:
Name: NewRelic-log-ingestion-s3
Description: Send log data from a S3 bucket to New Relic Logging.
Author: New Relic
SpdxLicenseId: Apache-2.0
LicenseUrl: LICENSE
ReadmeUrl: README.md
Labels: ['newrelic', 'logs', 'logging', 'ingestion', 'lambda', 's3']
HomePageUrl: https://github.com/newrelic/aws_s3_log_ingestion_lambda
SemanticVersion: 1.1.1
SourceCodeUrl: https://github.com/newrelic/aws_s3_log_ingestion_lambda
Resources:
NewRelicLogIngestionFunction:
Type: 'AWS::Serverless::Function'
Properties:
Runtime: python3.8
CodeUri: src/
Handler: handler.lambda_handler
FunctionName: NewRelic-s3-log-ingestion
Timeout: 900
MemorySize: 256
Environment:
Variables:
LICENSE_KEY: !Ref NRLicenseKey
LOG_TYPE: !Ref NRLogType
DEBUG_ENABLED: !Ref DebugEnabled
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- 's3:GetObject'
Resource: 'arn:aws:s3:::*'
Events:
BucketEvent1:
Type: S3
Properties:
Bucket:
Ref: SourceLogBucket
Events:
- 's3:ObjectCreated:*'
SourceLogBucket:
Type: 'AWS::S3::Bucket'