Registry / devops / pulumi-datadog

pulumi-datadog

JSON →
library5.10.0pypypi✓ verified 25d ago

The `pulumi-datadog` Python package provides a way to declare, deploy, and manage Datadog resources like monitors, dashboards, and integrations using Pulumi's Infrastructure as Code framework. It mirrors the upstream Datadog Terraform Provider and typically releases new versions in sync with updates to that provider. The library is actively maintained and currently at version 5.1.0.

pip install pulumi-datadog
INSTALL
IMPORT
SIG · PULUMI-DATADOG
P
pulumi-datadog
devopspythonv5.10.0
Install
17.0s avg
Import
12192ms
Disk
128MB
Pass rate
4/ 10
Env Coverage4 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v5.10.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 14.2s
py 3.11
✕ timeout
✕ timeout
py 3.12
✕ timeout
✕ timeout
py 3.13
✕ timeout
✕ timeout
py 3.9
✓ —
✓ 19.8s
128MB installed
● package 128MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

datadog
✓ import pulumi_datadog as datadog
This is the conventional alias for the Pulumi Datadog provider.
Monitor
✓ datadog.Monitor
Example for importing a specific resource class like Monitor.
Provider
✓ datadog.Provider
✗ pulumi_datadog.Provider
While `pulumi_datadog.Provider` works, using the aliased `datadog.Provider` is more common and consistent with examples.

This quickstart demonstrates how to configure the `pulumi-datadog` provider and create a simple Datadog metric alert monitor. It assumes `DD_API_KEY` and `DD_APP_KEY` environment variables are set or configured as Pulumi secrets. The `apiUrl` configuration is important and must not end with `/api/`.

import pulumi import pulumi_datadog as datadog import os # Configure Datadog API and APP keys using environment variables # pulumi config set datadog:apiKey --secret $DD_API_KEY # pulumi config set datadog:appKey --secret $DD_APP_KEY # Or, set them directly as provider arguments (less secure for sensitive keys) # provider = datadog.Provider( # "datadog-provider", # api_key=os.environ.get('DD_API_KEY', ''), # app_key=os.environ.get('DD_APP_KEY', ''), # api_url="https://api.datadoghq.com/" # Ensure no /api/ suffix # ) # Create a Datadog monitor example_monitor = datadog.Monitor("example-monitor", name="Pulumi Example Host CPU Alert", type="metric alert", query="avg(last_5m):system.cpu.idle{*} by {host} < 10", message="High CPU detected on {{host.name}}! @pagerduty", tags=["environment:dev", "team:sre"], priority=3, monitor_thresholds=datadog.MonitorMonitorThresholdsArgs( critical=10.0, warning=20.0, ), force_delete=True # Useful for development, be cautious in production ) pulumi.export('monitor_id', example_monitor.id) pulumi.export('monitor_name', example_monitor.name)
pulumi --version
Debug
Known issues
breakingVersion 5.x of `pulumi-datadog` is based on version 4.x of the upstream `terraform-provider-datadog`. This major version bump in the underlying Terraform provider typically introduces breaking changes in resource properties and behaviors. Users upgrading from `pulumi-datadog` v4.x should consult the `terraform-provider-datadog` v4.0.0 changelog for a comprehensive list of changes, as these will directly impact your Pulumi code.
fix
Review the official Pulumi Datadog documentation for migration guides and compare your resource definitions against the latest schema. Pay close attention to changes in required/optional fields, data types, and resource naming conventions.
affects: 5.0.0 and later
gotchaThe Datadog API Key (DD_API_KEY) and Application Key (DD_APP_KEY) are both required for authenticating the provider. Failure to provide both will result in authentication errors. These should be treated as sensitive secrets.
fix
Always provide both `apiKey` and `appKey` for the provider. It is highly recommended to set these using Pulumi's secret management (e.g., `pulumi config set datadog:apiKey --secret`) or environment variables (`DD_API_KEY`, `DD_APP_KEY`) rather than hardcoding them.
affects: All versions
gotchaThe `apiUrl` (or `DD_HOST` environment variable) for the Datadog provider must *not* end with `/api/`. Incorrectly adding this suffix will lead to API request failures.
fix
Ensure that your `apiUrl` configuration or `DD_HOST` environment variable is in the format `https://api.datadoghq.com/` (or `https://api.datadoghq.eu/`, etc.) without `/api/` at the end.
affects: All versions
gotchaPulumi resources managed by `pulumi-datadog` can drift from their desired state if they are manually modified within the Datadog UI. This can lead to unexpected `pulumi preview` diffs or apply failures.
fix
For resources managed by Pulumi, avoid manual modifications in the Datadog UI. If drift occurs, you can either import the manually changed resource into Pulumi state (if it was created manually) or accept the Pulumi `update` to revert the changes in Datadog to match your code.
affects: All versions
Upgrade
Version history
5.10.0latest on PyPI · released Jul 30, 2026
Audit
Dependencies
pulumirequiredCore Pulumi engine is required to define, deploy, and manage infrastructure resources.
Agent activity
23 hits · last 30 days
node
16
OpenAI (training)
3
Resources
pulumi-datadog — pip install pulumi-datadog · libregistry