π Monitor AWS Resources using New Relic

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:
Go to IAM > Roles > Create role
Select Another AWS Account
Enter New Relicβs Account ID (provided in their setup)
Attach the policy you created above
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:
Navigate to Infrastructure > AWS Integration
Paste the IAM Role ARN
Enter your AWS account name
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:
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:
Log into New Relic Dashboard
Go to Infrastructure β AWS
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.
π Useful Links
βοΈ CloudFormation Templates
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
Subscribe to my newsletter
Read articles from Pratiksha kadam directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
