Skip to content

Commit 65ca09e

Browse files
Release v1.31.0
1 parent b2fc24b commit 65ca09e

File tree

12 files changed

+259
-87
lines changed

12 files changed

+259
-87
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "dynatrace_azure_supported_services Data Source - terraform-provider-dynatrace"
4+
subcategory: ""
5+
description: |-
6+
7+
---
8+
9+
# dynatrace_azure_supported_services (Data Source)
10+
11+
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Optional
19+
20+
- `except` (Set of String) Services with the given names won't be included in the results
21+
22+
### Read-Only
23+
24+
- `id` (String) The ID of this resource.
25+
- `services` (Map of Boolean) The keys are the names of the supported services. The values provide information whether that service is built in or not.
26+
27+

docs/data-sources/entities.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ output "Service_List" {
3232

3333
### Optional
3434

35-
- `entities` (Block List, Max: 1) (see [below for nested schema](#nestedblock--entities))
35+
- `entities` (Block List) (see [below for nested schema](#nestedblock--entities))
3636

3737
### Read-Only
3838

@@ -43,27 +43,20 @@ output "Service_List" {
4343

4444
Optional:
4545

46-
- `entity` (Block List) A list of monitored entities. (see [below for nested schema](#nestedblock--entities--entity))
47-
48-
<a id="nestedblock--entities--entity"></a>
49-
### Nested Schema for `entities.entity`
50-
51-
Optional:
52-
5346
- `display_name` (String) The name of the entity, displayed in the UI.
5447
- `entity_id` (String) The ID of the entity.
55-
- `tags` (Block List) A set of tags assigned to the entity. (see [below for nested schema](#nestedblock--entities--entity--tags))
48+
- `tags` (Block List) A set of tags assigned to the entity. (see [below for nested schema](#nestedblock--entities--tags))
5649
- `type` (String) The type of the entity.
5750

58-
<a id="nestedblock--entities--entity--tags"></a>
59-
### Nested Schema for `entities.entity.tags`
51+
<a id="nestedblock--entities--tags"></a>
52+
### Nested Schema for `entities.tags`
6053

6154
Optional:
6255

63-
- `tag` (Block List) A tag assigned to the entity (see [below for nested schema](#nestedblock--entities--entity--tags--tag))
56+
- `tag` (Block List) A tag assigned to the entity (see [below for nested schema](#nestedblock--entities--tags--tag))
6457

65-
<a id="nestedblock--entities--entity--tags--tag"></a>
66-
### Nested Schema for `entities.entity.tags.tag`
58+
<a id="nestedblock--entities--tags--tag"></a>
59+
### Nested Schema for `entities.tags.tag`
6760

6861
Required:
6962

docs/data-sources/entity.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ output "id" {
3030
<!-- schema generated by tfplugindocs -->
3131
## Schema
3232

33-
### Required
33+
### Optional
3434

35+
- `entity_selector` (String)
3536
- `name` (String)
3637
- `type` (String)
3738

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
layout: ""
3+
page_title: "Environment Migration"
4+
description: |-
5+
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.
21+
22+
Link: [Terraform Migration Helper](https://github.com/dynatrace-oss/terraform-provider-dynatrace/blob/main/documentation/Terraform%20-%20Migration%20Helper.xlsm)
23+
24+
### Command Line Syntax
25+
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.
40+
41+
Windows: `terraform-provider-dynatrace.exe -export -migrate`
42+
43+
Linux: `terraform-provider-dynatrace -export -migrate`
44+
45+
### Iterative Migration
46+
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.
53+
54+
Windows: `terraform-provider-dynatrace.exe -export -migrate -datasources <resourcename>`
55+
56+
Linux: `terraform-provider-dynatrace -export -migrate -datasources <resourcename>`
57+
58+
### Additional Information
59+
* 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.

docs/guides/export-v2.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,21 @@ description: |-
66
---
77

88
## Export Utility
9+
10+
### Command Line Syntax
11+
Invoking the export functionality requires
12+
* The environment variable `DYNATRACE_ENV_URL` as the URL of your Dynatrace environment
13+
* The environment variable `DYNATRACE_API_TOKEN` as the API Token of your Dynatrace environment
14+
* Optionally the environment variable `DYNATRACE_TARGET_FOLDER`. If it's not set, the output folder `./configuration` is assumed
15+
16+
### Execution
917
Windows: `terraform-provider-dynatrace.exe -export [-ref] [-id] [-flat] [-exclude] [<resourcename>[=<id>]]`
1018

1119
Linux: `./terraform-provider-dynatrace -export [-ref] [-id] [-flat] [-exclude] [<resourcename>[=<id>]]`
20+
1221
### Options
1322
* `-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.
1424
* `-id` Enable commented id output in resource files
1525
* `-flat` All downloaded resources end up directly within the target folder - no module structure will be created
1626
* `-exclude` Exclude specified resource(s) from export

docs/index.md

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: |-
99

1010
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.
1111

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.
1313

1414
## Example
1515

@@ -18,7 +18,7 @@ Use the links to the left to learn about the available resources and data source
1818
terraform {
1919
required_providers {
2020
dynatrace = {
21-
version = "1.30.2"
21+
version = "1.31.0"
2222
source = "dynatrace-oss/dynatrace"
2323
}
2424
}
@@ -73,42 +73,9 @@ With release 1.15.0, a new and improved version of the export utility is now ava
7373
* Option to include/exclude specific resource IDs from export
7474
* Ability to convert from HCL to JSON formatted files
7575

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).
7777

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
83-
84-
## Export Utility
85-
Windows: `terraform-provider-dynatrace.exe -export [-ref] [-id] [-flat] [-exclude] [<resourcename>[=<id>]]`
86-
87-
Linux: `./terraform-provider-dynatrace -export [-ref] [-id] [-flat] [-exclude] [<resourcename>[=<id>]]`
88-
### Options
89-
* `-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).**
11279

11380
<!-- schema generated by tfplugindocs -->
11481
## Schema

docs/resources/azure_service.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
layout: ""
3+
page_title: dynatrace_azure_service Resource - terraform-provider-dynatrace"
4+
description: |-
5+
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.
24+
25+
```terraform
26+
resource "dynatrace_azure_credentials" "TERRAFORM_SAMPLE" {
27+
active = false
28+
app_id = "ABCDE"
29+
auto_tagging = true
30+
directory_id = "ABCDE"
31+
label = "TERRAFORM_SAMPLE"
32+
key = "aaaa"
33+
monitor_only_tagged_entities = true
34+
35+
monitor_only_tag_pairs {
36+
name = "string"
37+
value = "string"
38+
}
39+
}
40+
41+
data "dynatrace_azure_supported_services" "supported_services" {
42+
except = [ "AZURE_STORAGE_ACCOUNT" ] # Dynatrace will complain in case this service is getting configured together with other services in the list
43+
}
44+
45+
resource "dynatrace_azure_service" "TERRAFORM_SAMPLE_services" {
46+
for_each = data.dynatrace_azure_supported_services.supported_services.services
47+
credentials_id = dynatrace_azure_credentials.TERRAFORM_SAMPLE.id
48+
use_recommended_metrics = true
49+
name = each.key
50+
}
51+
```
52+
53+
<!-- schema generated by tfplugindocs -->
54+
## Schema
55+
56+
### Required
57+
58+
- `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+
<a id="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
82+

docs/resources/credentials.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
11
---
2-
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "dynatrace_credentials Resource - terraform-provider-dynatrace"
4-
subcategory: ""
2+
layout: ""
3+
page_title: dynatrace_credentials Resource - terraform-provider-dynatrace"
54
description: |-
6-
5+
The resource `dynatrace_credentials` covers configuration for credentials
76
---
87

98
# dynatrace_credentials (Resource)
109

10+
## Dynatrace Documentation
1111

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
1213

14+
- Credential vault API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/credential-vault
1315

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+
```
1432

1533
<!-- schema generated by tfplugindocs -->
1634
## Schema
@@ -64,5 +82,4 @@ Optional:
6482
- `username_secret_name` (String) No documentation available
6583
- `vault_namespace` (String) Required for Hashicorp App Role. No further documentation available
6684
- `vault_url` (String) No documentation available
67-
68-
85+

0 commit comments

Comments
 (0)