Managing Datadog with Pulumi

From NovaOrdis Knowledge Base
Revision as of 04:06, 9 April 2022 by Ovidiu (talk | contribs) (→‎Importing Resources)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

External

Datadog SDK Internal

Datadog Resource Provider

The Datadog resource provider is an implementation of Pulumi resource provider aimed at allowing Pulumi to provision infrastructure on a Datadog backend. The latest version of the Python implementation is available here: https://pypi.org/project/pulumi-datadog/

Datadog SDK Installation

pip install pulumi_datadog

Environment

The following environment variables are required: DATADOG_API_KEY and DATADOG_APP_KEY. The alternative to using environment variable is to use Pulumi stack configuration:

pulumi config set datadog:apiKey XXXXXXXXXXXXXX --secret
pulumi config set datadog:appKey YYYYYYYYYYYYYY --secret

Optionally, the API URL can be specified with DATADOG_HOST. If not specified, the default is "https://api.datadoghq.com/". If no DATADOG_HOST is specified, the correct account selection is done based on the API key value.

Project Template

├─ .gitignore
├─ Pulumi.yaml
├─ requirements.txt
└─ __main__.py

Resources

Importing Resources

For more details, see pulumi import.

Importing an Externally Created Dashboard

pulumi stack import datadog:index/dashboard:Dashboard 'Adopted Dashboard' 44h-7e6-vaa

Importing an Externally Created DashboardJson

pulumi import datadog:index/dashboardJson:DashboardJson 'Adopted JSON-specified Dashboard' 44h-7e6-vaa