Managing Datadog with Pulumi: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(26 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=External=
* https://www.pulumi.com/registry/packages/datadog/how-to-guides/
* https://www.pulumi.com/registry/packages/datadog/
* https://www.pulumi.com/registry/packages/datadog/api-docs/
* API Docs https://www.pulumi.com/registry/packages/datadog/api-docs/
* https://github.com/pulumi/pulumi-datadog/blob/master/README.md
* GitHub Page: https://github.com/pulumi/pulumi-datadog/blob/master/README.md
* https://www.pulumi.com/resources/pulumipustv-fun-with-datadog-with-dan-maher
* https://www.pulumi.com/resources/pulumipustv-fun-with-datadog-with-dan-maher
* https://docs.datadoghq.com/integrations/pulumi/
* https://docs.datadoghq.com/integrations/pulumi/
* PyPI Pulumi Datadog package https://pypi.org/project/pulumi-datadog/
* PyPI Pulumi Datadog package https://pypi.org/project/pulumi-datadog/
* [https://www.youtube.com/watch?v=sDsO25iLN2E Fun With Datadog with Dan Maher]


=Datadog SDK Internal=
=Datadog SDK Internal=
Line 11: Line 12:
* [[Pulumi#Subjects| Pulumi]]
* [[Pulumi#Subjects| Pulumi]]


=Datadog Provider=
=<span id='Datadog_Provider'></span>Datadog Resource Provider=
The Datadog resource provider is an implementation of [[Pulumi_Architecture#Resource_Provider|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==
==Datadog SDK Installation==
<syntaxhighlight lang='bash'>
<syntaxhighlight lang='bash'>
pip install pulumi_datadog
pip install pulumi_datadog
</syntaxhighlight>
==Environment==
The following environment variables are required: <code>DATADOG_API_KEY</code> and <code>DATADOG_APP_KEY</code>. The alternative to using environment variable is to use Pulumi stack configuration:
<syntaxhighlight lang='bash'>
pulumi config set datadog:apiKey XXXXXXXXXXXXXX --secret
pulumi config set datadog:appKey YYYYYYYYYYYYYY --secret
</syntaxhighlight>
</syntaxhighlight>


=Organizatorium=
Optionally, the API URL can be specified with <code>DATADOG_HOST</code>. If not specified, the default is "https://api.datadoghq.com/". If no <code>DATADOG_HOST</code> is specified, the correct account selection is done based on the API key value.
 
=Project Template=
<font size=-1>
├─ [[Datadog Pulumi Project .gitignore|.gitignore]]
├─ [[Datadog Pulumi Project Pulumi.yaml|Pulumi.yaml]]
├─ [[Datadog Pulumi Project requirements.txt|requirements.txt]]
└─ [[Datadog Pulumi Project __main__.py|__main__.py]]
</font>
 
=Resources=
* [[Datadog Dashboard|Dashboard]]
* [[Pulumi Datadog DashboardJson|DashboardJson]]
=Importing Resources=
For more details, see <code>[[Pulumi_Operations#Import_External_Resources_into_a_Stack|pulumi import]]</code>.
==Importing an Externally Created Dashboard==
<syntaxhighlight lang='bash'>
pulumi stack import datadog:index/dashboard:Dashboard 'Adopted Dashboard' 44h-7e6-vaa
</syntaxhighlight>
 
==Importing an Externally Created DashboardJson==
<syntaxhighlight lang='bash'>
pulumi import datadog:index/dashboardJson:DashboardJson 'Adopted JSON-specified Dashboard' 44h-7e6-vaa
</syntaxhighlight>

Latest revision as of 04:06, 9 April 2022

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