The purpose of this repo is to provide an automated solution for setting up the Datadog agent in various Azure resources.
- Create a
<DIR_NAME>/terraform.tfvars
within the same level as the<DIR_NAME>/main.tf
(Note: replace <DIR_NAME>
with k8 for example).
This repo assumes you have already created an Azure service principal. More information on how to create a Azure service principal can be found here.
- Provide the following keys & corresponding values:
subscription_id
= <AZURE_SUBSCRIPTION_ID>client_id
= <AZURE_SERVICE_PRINCIPAL_APP_ID>client_secret
= <AZURE_SERVICE_PRINCIPAL_PASSWORD>tenant_id
= <AZURE_SERVICE_PRINCIPAL_TENANT_ID>datadog_api_key
= <DD_API_KEY>location
= <AVAILABILITY_ZONE>
(Note: there are additional values that can be passed in, which depend on the Azure resources being created).
- Naivigate to
linux_vm
directory. - Create a SSH key pair for access to the Linux VM.
- Run the following in on your local shell
ssh-keygen -m PEM -t rsa -b 4096
& update the value within theterraform.tfvars
to point the created pub file.
- Run the following in on your local shell
- Apply the Terraform scripts:
terraform init
terraform plan
terraform apply
terraform apply -destroy
can be used to remove the instance.
- Navigate to
windows_vm
directory. - In the
install-datadog.ps1
file replace_API_KEY_HERE
with your organization's Datadog API key. - Apply the Terraform scripts:
terraform init
terraform plan
terraform apply
terraform apply -destroy
can be used to remove the instance.