Requirements
Using the provider
If you want to run Terraform with the dynatrace provider plugin on your system, complete the following steps:
-
Download the dynatrace provider plugin for Terraform.
-
Unzip the release archive to extract the plugin binary (terraform-provider-dynatrace_vX.Y.Z
).
For Terraform version 0.12.x
-
Move the binary into the Terraform [plugins directory] for the platform.
- Linux/Unix/macOS:
~/.terraform.d/plugins
- Windows:
%APPDATA%\terraform.d\plugins
-
Add the plug-in provider to the Terraform configuration file.
terraform {
required_providers {
dynatrace = {
version = "1.1.0"
}
}
}
For Terraform version 0.13.x
-
Move the binary into the Terraform [plugins directory] for the platform.
- Linux:
~/.terraform.d/plugins/dynatrace.com/com/dynatrace/1.0.4/linux_amd64/
- macOS:
~/.terraform.d/plugins/dynatrace.com/com/dynatrace/1.0.4/darwin_amd64/
- Windows:
%APPDATA%\terraform.d\plugins\dynatrace.com\com\dynatrace\1.0.4\windows_amd64\
-
Add the plug-in provider to the Terraform configuration file.
terraform {
required_version = "~> 0.13.0"
required_providers {
dynatrace = {
version = "1.1.0"
source = "dynatrace.com/com/dynatrace"
}
}
}
Currently supported configuration settings
- Dashboards
- Management Zones
- Custom Services
- Request Attributes
- Alerting Profiles
- Problem Notifiations
- Auto Tag Configuration
- Kubernetes Credentials
- AWS Credentials
- Azure Credentials
- Maintenance Windows
Exporting existing configuration from a Dynatrace Environment
In addition to acting as a Terraform Provider Plugin the executable terraform-provider-dynatrace
(terraform-provider-dynatrace.exe
on Windows) can also get directly invoked.
The utility then reaches out to the Dynatrace Environment specified by the command line arguments and fetches all currently supported configuration items. These results will then automatically get transformed into HCL (the configuration language to be used for .tf
files) and places each configuration item into its own .tf
file).
Command Line Syntax
Invoking the download functionality requires
- The URL of your Dynatrace Environment
- An API Token with the permissions
Read configuration
and Capture request data
- If the optional argument for the output folder is not specified
./configuration
is assumed
Windows
terraform-provider-dynatrace.exe download https://<environment-id>.live.dynatrace.com <api-token> [<output-folder>]
Linux
./terraform-provider-dynatrace download https://<environment-id>.live.dynatrace.com <api-token> [<output-folder>]