---
title: EC2 Image Builder integration
source: https://docs.newrelic.com/docs/infrastructure/amazon-integrations/aws-integrations-list/amazon-ec2-image-builder-integration
---

New Relic integrates with Amazon Web Services (AWS) to set up the New Relic infrastructure agent using our [EC2 Image Builder](https://aws.amazon.com/image-builder/) component.

This document explains how to configure the integration, and start collecting metrics easily using EC2 Image Builder.

## Features [#features]

EC2 Image Builder is an AWS service that simplifies management of Amazon Machine Images (AMIs) and container images. This integration includes a component that will automatically install the [New Relic infrastructure agent](https://docs.newrelic.com/docs/infrastructure/introduction-infra-monitoring/) on all new EC2 instances created from the EC2 Image Builder pipeline, saving hours of manual work to set up the agent on each new instance, and giving instantaneous access to monitoring your new instances.

## Setup [#setup]

This integration is available through the [AWS Marketplace](https://aws.amazon.com/marketplace/pp/prodview-7l3xgom3n4v7q?sr=0-7&ref_=beagle&applicationId=AWS-Marketplace-Console). You can set up this integration from the marketplace by creating an image recipe using this component.

### Prerequisites

To use the component properly, you will need your New Relic [license key](https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/#overview-keys) and [AccountId](https://docs.newrelic.com/docs/accounts-partnerships/accounts/account-setup/account-id).

### Step 1 - Add the New Relic license key to your AWS Secrets Manager

1.  From the [AWS Console](console.aws.amazon.com), navigate to [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/).

2.  Select **Store a new secret**.

3.  Select **Other type of secret**.

4.  Select the **Plaintext** tab, remove the default text, and paste your New Relic ingest license key.

5.  Configure the secret with a name.

> #### 💡 TIP
>
> To match the default settings of the component, you can name these secrets `NEW_RELIC_LICENSE_KEY` and `NEW_RELIC_ACCOUNT_ID`. If you decide to use a different name, you'll need to include those names in the component in the next step.

6.  Repeat these steps to create your New Relic AccountId as a secret as well.

### Step 2 - Create the EC2 Image Builder recipe

1.  From the [AWS Console](console.aws.amazon.com), navigate to **EC2 Image Builder**.

2.  From the available options, select **Image recipes**.

3.  Select the required image specifications.

4.  In the **Build components** section, select **Add build components**, and **AWS Marketplace components**.

5.  Type `new relic` in the search bar, and select the **New Relic Infrastructure Agent** component.

6.  In the component parameters, include the values for the names of your License Key and AccountId as they were created in step 1.

7.  In **AWS_Region**, specify which region you used to store your AWS Secrets in step 1. Note that the default assumes **us-east-1** if no alternative is given.

8.  Configure the rest of the image recipe as desired and save it.

## Using the integration

After you have set up the New Relic component using a recipe, that component (and any other configured components) will be applied to that recipe, and can be added to any EC2 Image Builder pipeline. Refer to the [Image Builder documentation](https://docs.aws.amazon.com/imagebuilder/latest/userguide/what-is-image-builder.html) for a full scope of available uses for EC2 Image Builder and detailed steps for using the service.

After the AMI's have been set up and EC2 instances are created, you can find the data collected through the [New Relic infrastructure hosts UI](https://docs.newrelic.com/docs/infrastructure/infrastructure-data/infrastructure-ui-pages/infra-hosts-ui-page/).
