Skip to content

Commit 6cb5345

Browse files
authored
Merge pull request #5 from newrelic/NR-NR-339479
creating github public documentation
2 parents 7996baf + 9bf2300 commit 6cb5345

File tree

3 files changed

+58
-5
lines changed

3 files changed

+58
-5
lines changed

Diff for: README.md

+55-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,55 @@
1-
# aws-cloudwatch-firehose
2-
Forwards logs from cloudwatch to NewRelic through firehose
1+
# aws-unified-firehose
2+
Forwards logs from cloudwatch to NewRelic through Amazon Data Firehose
3+
4+
## Features
5+
6+
- Collects logs from Amazon CloudWatch.
7+
- Forwards logs to NewRelic using Amazon Data Firehose.
8+
- Allows users to attach custom attributes to the logs to make it easier to search, filter, analyze, and parse the logs
9+
- Scalable and reliable log forwarding.
10+
- Stores license key in Secret Manager by default.
11+
12+
## Requirements
13+
14+
- SAM CLI - [Install the SAM CLI](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
15+
16+
## Deployment
17+
18+
To try this integration out you can use the `sam` cli to deploy the cloudformation template (`firehose-template.yml`). Make sure **aws is properly authenticated with an account of your choice**.
19+
20+
21+
#### CloudFormation Parameters
22+
23+
- `NewRelicRegion` : Can either be `US` or `EU` depending on which endpoint to be used to push logs to New Relic
24+
- For this param `US` is default
25+
- `LicenseKey`: Used when forwarding logs to New Relic
26+
- `LogGroupConfig` : String representation of JSON array of objects of your CloudWatch LogGroup(s) and respective filter (if applicable) to set the Lambda function trigger.
27+
- Example : ```[{"LogGroupName":"group1"}, {"LogGroupName":"group2", "FilterPattern":"ERROR"}, {"LogGroupName":"group3", "FilterPattern":"INFO"}]```
28+
- `LoggingFirehoseStreamName` : Name of new Data Firehose Delivery Stream (must be unique per AWS account in the same AWS Region)
29+
- The default value will be `NewRelic-Logging-Delivery-Stream`
30+
- `LoggingS3BackupBucketName`: S3 Bucket Destination for failed events (must be globally unique across all AWS accounts in all AWS Regions within a partition)
31+
- The default value will be `firehose-logging-backup`
32+
- `EnableCloudWatchLoggingForFirehose`: Can either be `true` or `false` to enable CloudWatch logging for the Amazon Data Firehose stream. Enabling logging can help in troubleshooting issues in pushing data through firehose stream. `false` by default
33+
- `NewRelicAccountId` : The New Relic Account ID to which the logs will be pushed
34+
- `CommonAttributes` : Common attributes to be added to all logs. This should be a JSON object.
35+
- Example : ```[{"AttributeName": "name1", "AttributeValue": "value1"}, {"AttributeName": "name2", "AttributeValue": "value2}]```
36+
- `StoreNRLicenseKeyInSecretManager` : Can either be `true` or `false` depending on which cloud formation stack decides whether to store your license key in the environment variables or to create a new secret in aws secrets manger.
37+
- For this param `true` is default
38+
39+
## Building and packaging
40+
To build and package, follow these steps:
41+
1. Authenticate with your aws account details
42+
2. Create an S3 bucket with a unique name, e.g., `test123`.
43+
3. Build the project:
44+
```sh
45+
sam build --template-file firehose-template.yaml
46+
```
47+
4. The build will be located by default at `.aws-sam/build`, and a template file will be created with the name `template.yaml`.
48+
5. Package the project:
49+
```sh
50+
sam package --s3-bucket test123 --template-file .aws-sam/build/template.yaml --output-template-file firehose-template.yaml --region us-east-2
51+
```
52+
6. Copy the main template file to the S3 bucket:
53+
```sh
54+
aws s3 cp .aws-sam/build/firehose-template.yaml s3://test123/firehose-template.yaml
55+
```

Diff for: firehose-cloudwatch-trigger-stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ AWSTemplateFormatVersion: '2010-09-09'
22

33
Parameters:
44
LogGroupConfig:
5-
Description: "String representation of JSON array of objects of your CloudWatch Loggroup(s) and respective filter (if applicable)"
5+
Description: "JSON array of objects representing your LogGroup and Filters (if applicable). For example: [{\"LogGroupName\":\"logGroup1\",\"FilterPattern\":\"filter1\"}]"
66
Type: String
77
LogGroupArns:
88
Description: "Comma-separated list of CloudWatch Log Group ARNs to create subscription to Data Firehose"

Diff for: firehose-template.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Parameters:
5858
AllowedPattern: "[0-9]+"
5959
ConstraintDescription: must only contain numbers
6060
LogGroupConfig:
61-
Description: "String representation of JSON array of objects of your CloudWatch Loggroup(s) and respective filter (if applicable)"
61+
Description: "JSON array of objects representing your LogGroup and Filters (if applicable). For example: [{\"LogGroupName\":\"logGroup1\",\"FilterPattern\":\"filter1\"}]"
6262
Type: String
6363
LoggingFirehoseStreamName:
6464
Type: String
@@ -84,7 +84,7 @@ Parameters:
8484
- "false"
8585
CommonAttributes:
8686
Type: String
87-
Description: "String representation of JSON array of objects of custom attributes to organize your logs and make it easier for you to search, filter, analyze, and parse your logs"
87+
Description: "JSON array of objects representing your custom attributes. For example: [{\"AttributeName\":\"key1\",\"AttributeValue\":\"value1\"}]"
8888
Default: ""
8989
StoreNRLicenseKeyInSecretManager:
9090
Type: String

0 commit comments

Comments
 (0)