πŸ“Š Monitor AWS Resources using New Relic

Pratiksha kadamPratiksha kadam
4 min read

Here’s a simplified and rephrased version of your article with clear steps and helpful code/configuration snippets:


Monitoring your AWS resources helps keep your applications running smoothly. In this guide, we’ll walk through how to use New Relic to monitor your AWS infrastructure with simple steps and code where needed.


πŸ” What is New Relic?

New Relic is an Application Performance Monitoring (APM) tool that helps you track how your apps and infrastructure are doing. It gives real-time insights into your servers, databases, services, and even your application code.

Think of it as your app's fitness trackerβ€”it monitors everything and alerts you when something's wrong.


πŸ› οΈ Steps to Integrate New Relic with AWS

βœ… Step 1: Create a Free New Relic Account

Visit New Relic Sign Up and create your free account.


βœ… Step 2: Create IAM Role and Policies in AWS

You need to create an IAM Role in AWS that allows New Relic to access your AWS services.

πŸ“Œ Create a New IAM Policy (example):

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudwatch:*",
        "ec2:Describe*",
        "rds:Describe*",
        "s3:ListAllMyBuckets"
      ],
      "Resource": "*"
    }
  ]
}

πŸ“Œ Create the IAM Role:

  1. Go to IAM > Roles > Create role

  2. Select Another AWS Account

  3. Enter New Relic’s Account ID (provided in their setup)

  4. Attach the policy you created above

  5. Copy the Role ARN for the next step

For budget monitoring, you can also attach a policy like:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "budgets:ViewBudget",
      "Resource": "*"
    }
  ]
}

βœ… Step 3: Add IAM Role ARN to New Relic

In your New Relic account:

  1. Navigate to Infrastructure > AWS Integration

  2. Paste the IAM Role ARN

  3. Enter your AWS account name

  4. Click Next


βœ… Step 4: Deploy CloudFormation Stack

To set up data streaming from AWS to New Relic (via Kinesis, Firehose, etc.), use CloudFormation to automate setup.

πŸ“Œ CloudFormation Setup:

  • Go to AWS CloudFormation Console

  • Use the template URL provided by New Relic (or upload your own)

  • Click Next, set a stack name, and deploy

# Sample CloudFormation snippet
Resources:
  KinesisStream:
    Type: AWS::Kinesis::Stream
    Properties:
      ShardCount: 1

  FirehoseStream:
    Type: AWS::KinesisFirehose::DeliveryStream
    Properties:
      DeliveryStreamType: DirectPut
      S3DestinationConfiguration:
        BucketARN: arn:aws:s3:::your-bucket-name
        RoleARN: arn:aws:iam::123456789012:role/FirehoseDeliveryRole

Wait about 10–15 minutes for the stack to finish deploying.


βœ… Step 5: View AWS Resources in New Relic

Once setup is complete:

  1. Log into New Relic Dashboard

  2. Go to Infrastructure β†’ AWS

  3. View your EC2 instances, RDS, S3, Lambda, and more

You're now ready to monitor everything in one place!


🎯 Final Thoughts

New Relic is a great tool for keeping track of your AWS environment. It provides:

  • Real-time performance tracking

  • Alerts when something goes wrong

  • Insights into cost and resource usage

  • End-to-end visibility across AWS and your apps

By integrating it with AWS, you can catch issues before users do and keep your systems reliable and efficient.



AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template to integrate AWS with New Relic via Kinesis Firehose

Parameters: NewRelicAccountId: Type: String Description: The New Relic AWS account ID to allow assume role access 
ExternalId: Type: String
Description: The External ID provided by New Relic during integration
S3BucketName: Type: String Description: S3 bucket for Kinesis Firehose delivery (must already exist)

Resources: NewRelicIntegrationRole: Type: AWS::IAM::Role Properties: RoleName: NewRelicIntegrationRole
 AssumeRolePolicyDocument: Version: '2012-10-17'
 Statement: - Effect: Allow Principal: AWS:
 !Ref NewRelicAccountId 
Action: sts:AssumeRole 
Condition: StringEquals: sts:ExternalId:
 !Ref ExternalId Policies: - 
PolicyName: NewRelicAccessPolicy 
PolicyDocument: Version: '2012-10-17' 
Statement: - Effect: Allow 
Action: - cloudwatch:GetMetricData - cloudwatch:ListMetrics 
- cloudwatch:GetMetricStatistics - ec2:DescribeInstances - rds:DescribeDBInstances - s3:ListAllMyBuckets - budgets:ViewBudget Resource: "*"
FirehoseDeliveryRole: Type: AWS::IAM::Role Properties: RoleName: FirehoseDeliveryRole AssumeRolePolicyDocument: 
Version: '2012-10-17' Statement: - Effect: Allow Principal: Service: firehose.amazonaws.com 
Action: sts:AssumeRole Policies: - PolicyName: FirehoseToS3 PolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Action: - s3:PutObject Resource: !Sub arn:aws:s3:::${S3BucketName}/*

KinesisFirehose: Type: AWS::KinesisFirehose::DeliveryStream
Properties: DeliveryStreamType: DirectPut 
S3DestinationConfiguration: BucketARN:
 !Sub arn:aws:s3:::${S3BucketName}
 RoleARN: !GetAtt FirehoseDeliveryRole.Arn Prefix: "newrelic/data/"

Outputs: NewRelicIAMRoleARN:
Description: IAM Role ARN to paste in New Relic Value:
 !GetAtt NewRelicIntegrationRole.Arn

FirehoseARN: Description: Kinesis Firehose
 ARN Value: !Ref KinesisFirehose
0
Subscribe to my newsletter

Read articles from Pratiksha kadam directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Pratiksha kadam
Pratiksha kadam