To get the most value out of the following, you should have a basic understanding of Terraform (HCL semantics are not covered), and a New Relic account that you can test with.
- Terraform > 0.13.0
- New Relic Account
- User with Admin role
- Application reporting to New Relic
- New Relic Provider for Terraform Repo
- New Relic Provider for Terraform documentation
- Nerd Days 2020 Presentation Slide deck
This lab sets up the basics needed to connect to New Relic via Terraform.
- These labs require that you already have a New Relic agent deployed. If you don't have New Relic integrated yet, check out New Relic's introduction documentation to get started there, then head back over here to get started with the New Relic Terraform Provider using the examples provided.
- Install Terraform and read the Terraform getting started guide that follows. This guide will assume a basic understanding of Terraform.
- Locate your Personal API key by following New Relic's Personal API key docs.
- Locate your Admin's API key by following New Relic's Admin API key docs.
It is recommended to store secrets in Environmental variables for these labs instead of the main.tf
file.
export NEW_RELIC_ACCOUNT_ID=
export NEW_RELIC_API_KEY=
export NEW_RELIC_REGION="US" # or "EU"
- Configure environment or set values in main.tf
- Run
terraform init
- Run
terraform plan
- Each lab builds on the previous, so you'll need to ensure that they are working before moving on.
- Each
lab*
directory is a module, so moving to the next lab involves uncommenting the module import in the rootmain.tf
file.