PoC for installing New Relic on multiple hosts with Terraform and cloud-init. This PoC is based on the cloud-init tutorial on Hashicorp's website.
- Create a key pair and optionally store the keys in the
keys
directory. - Update
users.ssh_authorized_keys
in the cloud init config file with the contents of your public key. - Update the Terraform config file to provision the desired infrastructure. The example here provisions three Ubuntu 20 servers and installs New Relic infrastructure agent on each with cloud-init.
- Enter the
instances
directory and runterraform init
. - Optionally run a plan phase with
terraform plan
to see what will be proivisioned. - Run
terraform apply
to provision the infrastructure. - Log into New Relic and view the data being reported from the new instances.