You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The environment migration guide provides information on migrating configuration from one environment into another
6
+
---
7
+
8
+
## Environment Migration
9
+
10
+
-> This guide assumes that the OneAgent communication is reconfigured via [oneagentctl](https://www.dynatrace.com/support/help/setup-and-configuration/dynatrace-oneagent/oneagent-configuration-via-command-line-interface) for migration. Moving the OneAgent without oneagentctl may generate new entity IDs which could lead to missing configuration.
11
+
12
+
This guide covers information required to migrate configuration from one environment into another with the [export utility](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/guides/export-v2) of the Terraform provider. The functionality supports all types of migrations including Managed to SaaS, SaaS to SaaS, etc. Please reach out to your Dynatrace account team for any assistance with migration planning.
13
+
14
+
There are two main approaches for migration (more information below):
15
+
* Bulk - Migrate ALL configuration from one environment to a fresh target environment
16
+
* Iterative - Migrate configuration by resource group - safer approach for a target environment with existing configuration
17
+
18
+
An Excel spreadsheet is available to assist with the migration process, specifically helpful for an iterative approach. Note that the spreadsheet has a custom function to track a static time/date for when the checkbox for column A "Complete" is selected. Leaving the document untrusted will simply make column C "Date Completed" unusable, everything else in the document will function and view properly.
19
+
20
+
For the iterative approach, it is important to push configuration in order of dependency. Please reference column D "Migration: Iterative Order" and push all configuration in order of the number present for each resource. Eg. Push all configuration with iterative order "1", then all with "2", etc.
There are two options with invoking the export utility and subsequent Terraform execution. Option 1 is particularly helpful with the iterative method where you may be running multiple exports and Terraform executions within the same command line shell.
26
+
27
+
Option 1:
28
+
* Set the environment variables `DYNATRACE_SOURCE_ENV_URL` and `DYNATRACE_SOURCE_API_TOKEN` as the URL and API Token of your ***source*** Dynatrace environment.
29
+
* Set the environment variables `DYNATRACE_ENV_URL` and `DYNATRACE_API_TOKEN` as the URL and API Token of your ***target*** Dynatrace environment.
30
+
31
+
Option 2:
32
+
* Set the environment variables `DYNATRACE_ENV_URL` and `DYNATRACE_API_TOKEN` as the URL and API Token - same variables are used for your ***source and target*** Dynatrace environment. Change the values between the invocation of the export utility and Terraform execution.
33
+
34
+
Optionally the environment variable `DYNATRACE_TARGET_FOLDER` allows you to set a target directory of the export utility. If it's not set, the output folder `./configuration` is assumed.
35
+
36
+
### Bulk Migration
37
+
In order for the best results of a bulk migration, it is highly recommended that the target environment does not have any existing configuration.
38
+
39
+
For bulk migration, utilize the `-migrate` flag. This will create all of the necessary files with resource dependencies and hardcoded entity IDs.
The iterative approach is useful in scenarios where you would like to migrate configuration by resource group or to an environment with existing configuration.
47
+
48
+
Most resources do not allow configuration with the same name, but there is a small number of resources where duplicates could be created. Please set an optional environment variable below depending on the preferred behavior.
49
+
*`DYNATRACE_DUPLICATE_REJECT=ALL` - Duplicates will not overwrite existing configuration
50
+
*`DYNATRACE_DUPLICATE_HIJACK=ALL` - Duplicates will overwrite existing configuration
51
+
52
+
For an iterative migration, utilize the `-migrate -datasources` flags. This will create all of the necessary files with dependencies via data sources and hardcoded entity IDs.
* It is expected that there are resources that may fail during a migration, two types of errors in particular are noted below. If you experience any errors beyond what is specified below, please create a [GitHub issue](https://github.com/dynatrace-oss/terraform-provider-dynatrace/issues).
60
+
1. "Grandfathered" configuration - certain API endpoints do not accept configuration that is no longer supported. eg. Calculated service metrics require a management zone or at least one condition marked with [Service property].
61
+
2. Missing entities - certain API endpoints validate whether entity IDs in the configuration exists. If you encounter this issue, simply re-apply once the entities exist in the target environment.
*`-ref` Enable resources with data sources and dependencies
23
+
*`-migrate` Enable resources with dependencies, no data sources. More information available in the [Environment Migration](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/guides/environment-migration) guide.
14
24
*`-id` Enable commented id output in resource files
15
25
*`-flat` All downloaded resources end up directly within the target folder - no module structure will be created
16
26
*`-exclude` Exclude specified resource(s) from export
Copy file name to clipboardExpand all lines: docs/index.md
+4-37Lines changed: 4 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ description: |-
9
9
10
10
The Dynatrace Terraform Provider is used to interact with the resources supported by the Dynatrace REST API. The provider needs to be configured with the proper credentials before it can be used.
11
11
12
-
Use the links to the left to learn about the available resources and data sources.
12
+
Use the links to the left to learn about the available resources, data sources, and guides.
13
13
14
14
## Example
15
15
@@ -18,7 +18,7 @@ Use the links to the left to learn about the available resources and data source
18
18
terraform {
19
19
required_providers {
20
20
dynatrace = {
21
-
version = "1.30.2"
21
+
version = "1.31.0"
22
22
source = "dynatrace-oss/dynatrace"
23
23
}
24
24
}
@@ -73,42 +73,9 @@ With release 1.15.0, a new and improved version of the export utility is now ava
73
73
* Option to include/exclude specific resource IDs from export
74
74
* Ability to convert from HCL to JSON formatted files
75
75
76
-
Please provide any feedback of the export utility via [GitHub Issues](https://github.com/dynatrace-oss/terraform-provider-dynatrace/issues). Details on the execution of the export utility is provided below.
76
+
Please provide any feedback of the export utility via [GitHub Issues](https://github.com/dynatrace-oss/terraform-provider-dynatrace/issues).
77
77
78
-
### Command Line Syntax
79
-
Invoking the export functionality requires
80
-
* The environment variable `DYNATRACE_ENV_URL` as the URL of your Dynatrace environment
81
-
* The environment variable `DYNATRACE_API_TOKEN` as the API Token of your Dynatrace environment
82
-
* Optionally the environment variable `DYNATRACE_TARGET_FOLDER`. If it's not set, the output folder `./configuration` is assumed
*`-ref` Enable resources with data sources and dependencies
90
-
*`-id` Enable commented id output in resource files
91
-
*`-flat` All downloaded resources end up directly within the target folder - no module structure will be created
92
-
*`-exclude` Exclude specified resource(s) from export
93
-
94
-
**NOTE:** Dashboards (because there could be thousands of them) are currently excluded from the export unless the resource is directly specified in the command line arguments.
95
-
96
-
### Usage Examples
97
-
*`./terraform-provider-dynatrace -export` downloads all available configuration settings without data sources and dependency references (export similar to previous version)
98
-
*`./terraform-provider-dynatrace -export -ref -id` downloads all available configuration settings with data sources / dependency references and adds commented ids in resource output
99
-
*`./terraform-provider-dynatrace -export -ref dynatrace_dashboard dynatrace_web_application` downloads all available dashboards, web applications and resource dependencies with references
100
-
*`./terraform-provider-dynatrace -export -ref dynatrace_alerting=4f5942d4-3450-40a8-818f-c5faeb3563d0 dynatrace_alerting=9c4b75f1-9a64-4b44-a8e4-149154fd5325` downloads the alerting profiles with the ids `4f5942d4-3450-40a8-818f-c5faeb3563d0` and `9c4b75f1-9a64-4b44-a8e4-149154fd5325`, includes all resource dependencies with references
101
-
*`./terraform-provider-dynatrace -export -ref dynatrace_calculated_service_metric dynatrace_alerting=4f5942d4-3450-40a8-818f-c5faeb3563d0` downloads all available calculated service metrics and also the alerting profile with the id `4f5942d4-3450-40a8-818f-c5faeb3563d0`, includes all resource dependencies with references
102
-
*`./terraform-provider-dynatrace -export -ref -exclude dynatrace_calculated_service_metric dynatrace_alerting` download all available configuration settings except `dynatrace_calculated_service_metric` and `dynatrace_alerting`, includes all resource dependencies with references
103
-
104
-
### Additional Information
105
-
* There may be instances where the exported configuration is deprecated and/or is unable to be used for a create/update. In these instances, the files will be moved into `.flawed` of the output folder and the explanation will be available as a commented output in the resource file.
106
-
- E.g. A dashboard with no tiles can be created and can be retrieved via the export, but the subsequent `terraform apply` would fail without any tiles.
107
-
* There are instances where the returned configuration does not contain all of the required information to run an `terraform apply` due to sensitive data or instances where the files require additional attention. The files that apply to this scenario will be automatically moved to `.requires_attention`, the explanation will be available as a commented output in the resource file.
108
-
- E.g. `dynatrace_credentials` confidential strings are not available via the API.
109
-
110
-
### Known Issues
111
-
* Due to the complexity of dashboards, there may be cases where the `terraform apply` fails after an export. Dashboard validation will be improved in a future release.
78
+
**Export Utility documentation has been moved under Guides [here](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/guides/export-v2).**
The resource `dynatrace_azure_service` covers configuration of Supported Services for Azure credentials
6
+
---
7
+
8
+
# dynatrace_azure_credentials (Resource)
9
+
10
+
## Dynatrace Documentation
11
+
12
+
- Microsoft Azure monitoring - https://www.dynatrace.com/support/help/how-to-use-dynatrace/infrastructure-monitoring/cloud-platform-monitoring/microsoft-azure-services-monitoring
13
+
14
+
- Azure credentials API - https://www.dynatrace.com/support/help/dynatrace-api/configuration-api/azure-credentials-api
15
+
16
+
17
+
## Resource Example Usage
18
+
19
+
This example utilizes the data source `dynatrace_azure_supported_services` in order to query for a full list of all supported services.
20
+
The `for_each` loop within the resource `dynatrace_azure_service` configures each of these services to get utilized with the default metrics recommended by Dynatrace (`use_recommended_metrics`).
21
+
22
+
If you want to configure a different set of metrics for a specific service, a separate resource `dynatrace_azure_service` will be necessary for that. That allows you to configure the `metric` blocks according to your wishes.
23
+
Just be aware of the fact, that Dynatrace enforces for most services a recommended set of metrics. All of them need to be part of your configuration in order to end up with a non-empty plan.
-`credentials_id` (String) the ID of the azure credentials this supported service belongs to
59
+
60
+
### Optional
61
+
62
+
-`metric` (Block Set) A list of metrics to be monitored for this service. Depending on the service Dynatrace insists on a set of recommended metrics to be configured for that service. If any of these recommended metrics is missing here, the Terraform Provider will automatically add them during `terraform apply`. This usually results in a non-empty plan, until all of the recommended metrics are present within your configuration. For services considered `built-in` by Dynatrace any metrics specified here will be ignored - Dynatrace enforces a fixed set of metrics for these services. (see [below for nested schema](#nestedblock--metric))
63
+
-`name` (String) The name of the supporting service.
64
+
-`use_recommended_metrics` (Boolean) If `true` Terraform will negotiate with the Dynatrace API about the recommended/enforced metrics to be applied. Any `metric` specified will be therefore ignored.
65
+
66
+
### Read-Only
67
+
68
+
-`built_in` (Boolean) This attribute is automatically set to `true` if Dynatrace considers the supporting service with the given name to be a built-in service
69
+
-`id` (String) The ID of this resource.
70
+
-`required_metrics` (String) Used internally by the Terraform Provider in order to remember the metrics enforced by Dynatrace
71
+
72
+
<aid="nestedblock--metric"></a>
73
+
### Nested Schema for `metric`
74
+
75
+
Required:
76
+
77
+
-`name` (String) the name of the metric of the supporting service
78
+
79
+
Optional:
80
+
81
+
-`dimensions` (Set of String) a list of metric's dimensions names
The resource `dynatrace_credentials` covers configuration for credentials
7
6
---
8
7
9
8
# dynatrace_credentials (Resource)
10
9
10
+
## Dynatrace Documentation
11
11
12
+
- Credential vault for synthetic monitors - https://www.dynatrace.com/support/help/platform-modules/digital-experience/synthetic-monitoring/general-information/credential-vault-for-synthetic-monitors
12
13
14
+
- Credential vault API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/credential-vault
13
15
16
+
## Export Example Usage
17
+
18
+
-`terraform-provider-dynatrace -export dynatrace_credentials` downloads all existing credentials
19
+
20
+
The full documentation of the export feature is available [here](https://registry.terraform.io/providers/dynatrace-oss/dynatrace/latest/docs/guides/export-v2).
21
+
22
+
## Resource Example Usage
23
+
24
+
```
25
+
resource "dynatrace_credentials" "name" {
26
+
name = "name"
27
+
scope = "SYNTHETIC"
28
+
username = "username"
29
+
password = "password"
30
+
}
31
+
```
14
32
15
33
<!-- schema generated by tfplugindocs -->
16
34
## Schema
@@ -64,5 +82,4 @@ Optional:
64
82
-`username_secret_name` (String) No documentation available
65
83
-`vault_namespace` (String) Required for Hashicorp App Role. No further documentation available
0 commit comments