Deploy Metric Drain with Terraform
Deploying Metric Drains with Aptible’s Terraform Provider is relativley straight-forward, with some minor configuration exceptions. Aptible’s Terraform Provider uses the Aptible CLI for authorization and authentication, so please run aptible login
before we get started.
Prerequisites
- Terraform
- The Aptible CLI
You also need to be logged in to Aptible.
Getting Started
First, lets set up your Terraform directory to work with Aptible. Create a directory with a main.tf
file and then run terraform init
in the root of the directory.
Next, you will define where you want your metric drain to capture metrics. Whether this is a new environment or an exisiting one. If you are placing this in an exisiting environment you can skip this step, just make sure you have your environment ID.
Next, we will actually create the metric drain resource in Terraform, please select the drain type you wish to use from below.
To check to make sure your changes are valid (in case of any changes not mentioned), run terraform validate
To deploy the above changes, run terraform apply
Troubleshooting
App configuration issues with Datadog
Some users have reported issues with applications not sending logs to Datadog, applications will need additional configuration set. Below is an example.
As a final note, if you have any questions about the Terraform provider please reach out to support or checkout our public Terraform Provider Repository for more information!