{"id":5378,"library":"pulumi-datadog","title":"Pulumi Datadog","description":"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.","status":"active","version":"5.1.0","language":"en","source_language":"en","source_url":"https://github.com/pulumi/pulumi-datadog","tags":["pulumi","datadog","iac","devops","observability"],"install":[{"cmd":"pip install pulumi-datadog","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Core Pulumi engine is required to define, deploy, and manage infrastructure resources.","package":"pulumi"}],"imports":[{"note":"This is the conventional alias for the Pulumi Datadog provider.","symbol":"datadog","correct":"import pulumi_datadog as datadog"},{"note":"Example for importing a specific resource class like Monitor.","symbol":"Monitor","correct":"datadog.Monitor"},{"note":"While `pulumi_datadog.Provider` works, using the aliased `datadog.Provider` is more common and consistent with examples.","wrong":"pulumi_datadog.Provider","symbol":"Provider","correct":"datadog.Provider"}],"quickstart":{"code":"import pulumi\nimport pulumi_datadog as datadog\nimport os\n\n# Configure Datadog API and APP keys using environment variables\n# pulumi config set datadog:apiKey --secret $DD_API_KEY\n# pulumi config set datadog:appKey --secret $DD_APP_KEY\n\n# Or, set them directly as provider arguments (less secure for sensitive keys)\n# provider = datadog.Provider(\n#     \"datadog-provider\",\n#     api_key=os.environ.get('DD_API_KEY', ''),\n#     app_key=os.environ.get('DD_APP_KEY', ''),\n#     api_url=\"https://api.datadoghq.com/\" # Ensure no /api/ suffix\n# )\n\n# Create a Datadog monitor\nexample_monitor = datadog.Monitor(\"example-monitor\",\n    name=\"Pulumi Example Host CPU Alert\",\n    type=\"metric alert\",\n    query=\"avg(last_5m):system.cpu.idle{*} by {host} < 10\",\n    message=\"High CPU detected on {{host.name}}! @pagerduty\",\n    tags=[\"environment:dev\", \"team:sre\"],\n    priority=3,\n    monitor_thresholds=datadog.MonitorMonitorThresholdsArgs(\n        critical=10.0,\n        warning=20.0,\n    ),\n    force_delete=True # Useful for development, be cautious in production\n)\n\npulumi.export('monitor_id', example_monitor.id)\npulumi.export('monitor_name', example_monitor.name)\n","lang":"python","description":"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/`."},"warnings":[{"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.","message":"Version 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.","severity":"breaking","affected_versions":"5.0.0 and later"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"The `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.","severity":"gotcha","affected_versions":"All versions"},{"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.","message":"Pulumi 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-13T00:00:00.000Z","next_check":"2026-07-12T00:00:00.000Z"}