Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple environments: parameterize Lambda name and NR_TAGS #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Sends log data from CloudWatch Logs to New Relic Infrastructure (Cloud integrations) and New Relic Logging
Parameters:
FunctionNameSuffix:
Type: String
Description: Suffix for the New Relic Log Ingestion Lambda function name
Default: ''
NRLicenseKey:
Type: String
Description: Your NewRelic license key.
Expand All @@ -13,6 +17,13 @@ Parameters:
AllowedValues:
- 'True'
- 'False'
NRTags:
Type: String
Description: |
New Relic Logs tags to apply to each log line sent. A tag is a key value pair. Multiple tags can be specified.
Key and value are colon delimited. Multiple key value pairs are semi-colon delimited.
e.g. env:prod;team:myTeam
Default: ''
NRInfraLogging:
Type: String
Description: Determines if logs are forwarded to New Relic Infrastructure
Expand Down Expand Up @@ -74,7 +85,10 @@ Resources:
CodeUri: src/
Description: Sends log data from CloudWatch Logs to New Relic Infrastructure (Cloud integrations) and New Relic Logging
Handler: function.lambda_handler
FunctionName: newrelic-log-ingestion
FunctionName: !Join
- ""
- - newrelic-log-ingestion
- !Ref FunctionNameSuffix
MemorySize:
Ref: MemorySize
Runtime: python3.7
Expand All @@ -88,6 +102,7 @@ Resources:
LOGGING_ENABLED: !Ref NRLoggingEnabled
INFRA_ENABLED: !Ref NRInfraLogging
DEBUG_LOGGING_ENABLED: !Ref DebugLoggingEnabled
NR_TAGS: !Ref NRTags
NewRelicLogIngestionFunction:
Type: AWS::Serverless::Function
Condition: NoRole
Expand All @@ -96,7 +111,10 @@ Resources:
CodeUri: src/
Description: Sends log data from CloudWatch Logs to New Relic Infrastructure (Cloud integrations) and New Relic Logging
Handler: function.lambda_handler
FunctionName: newrelic-log-ingestion
FunctionName: !Join
- ""
- - newrelic-log-ingestion
- !Ref FunctionNameSuffix
MemorySize:
Ref: MemorySize
Runtime: python3.7
Expand All @@ -109,6 +127,7 @@ Resources:
LOGGING_ENABLED: !Ref NRLoggingEnabled
INFRA_ENABLED: !Ref NRInfraLogging
DEBUG_LOGGING_ENABLED: !Ref DebugLoggingEnabled
NR_TAGS: !Ref NRTags
LambdaInvokePermissionNoCap:
Type: AWS::Lambda::Permission
Condition: NoCap
Expand Down