- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Supported OS
The Datadog Terraform provider allows you to interact with the Datadog API through a Terraform configuration. You can manage your Datadog resources, such as Dashboards, Monitors, Logs Configuration, etc, with this configuration.
The Datadog Terraform provider is available through the Terraform Registry.
Create a directory to contain the Terraform configuration files, for example: terraform_config/
.
Create a main.tf
file in the terraform_config/
directory with the following content:
terraform {
required_providers {
datadog = {
source = "DataDog/datadog"
}
}
}
# Configure the Datadog provider
provider "datadog" {
api_key = var.datadog_api_key
app_key = var.datadog_app_key
}
Note: If you are not using the Datadog US1 site, you must set the api_url
optional parameter with your Datadog site. Ensure the documentation site selector on the right of the page is set to your correct Datadog site, then use the following URL as the value of the api_url
parameter:
https://api.
/
Run terraform init
. This initializes the directory for use with Terraform and pulls the Datadog provider.
Create any .tf
file in the terraform_config/
directory and start creating Datadog resources.
This example demonstrates a monitor.tf
file that creates a live process monitor.
```
# monitor.tf
resource "datadog_monitor" "process_alert_example" {
name = "Process Alert Monitor"
type = "process alert"
message = "Multiple Java processes running on example-tag"
query = "processes('java').over('example-tag').rollup('count').last('10m') > 1"
monitor_thresholds {
critical = 1.0
critical_recovery = 0.0
}
notify_no_data = false
renotify_interval = 60
}
```
Run terraform apply
to create this monitor in your Datadog account.
By installing datadogpy
, you have access to the Dogwrap command line tool, which you can use to wrap any Terraform command and bind it to a custom event.
Install datadogpy
:
pip install datadog
For more information, see the Datadog Python library.
Send a terraform apply
event:
dogwrap -n "terraform apply" -k $DD_API_KEY --submit_mode all --tags="source:terraform" "terraform apply -no-color"
Send a terraform destroy
event:
dogwrap -n "terraform destroy" -k $DD_API_KEY --submit_mode all --tags="source:terraform" "terraform destroy -no-color"
Terraform does not include any metrics.
Terraform does not include any service checks.
Terraform does not include any events.
Need help? Contact Datadog support.