diff --git a/docs/data-sources/iam_policies.md b/docs/data-sources/iam_policies.md index 579a8dc8d..f96421d47 100644 --- a/docs/data-sources/iam_policies.md +++ b/docs/data-sources/iam_policies.md @@ -90,6 +90,7 @@ Changes to Outputs: - `accounts` (List of String) The results will contain policies defined for the given accountID. If one of the entries contains `*` the results will contain policies for all accounts - `environments` (List of String) The results will contain policies defined for the given environments. If one of the entries contains `*` the results will contain policies for all environments - `global` (Boolean) If `true` the results will contain global policies +- `groups` (List of String) The results will only contain policies that are bound to the specified groups. Omit this attribute if you want to retrieve all policies ### Read-Only diff --git a/docs/data-sources/tenant.md b/docs/data-sources/tenant.md index fcaaed24c..8b48a52cd 100644 --- a/docs/data-sources/tenant.md +++ b/docs/data-sources/tenant.md @@ -23,7 +23,7 @@ resource "dynatrace_iam_group" "some_group" { permission { name = "tenant-manage-settings" type = "tenant" - scope = data.dynarace_tenant.tenant.id + scope = data.dynatrace_tenant.tenant.id } } ``` diff --git a/docs/guides/supported-resources.md b/docs/guides/supported-resources.md new file mode 100644 index 000000000..673843876 --- /dev/null +++ b/docs/guides/supported-resources.md @@ -0,0 +1,10 @@ +--- +layout: "" +page_title: "Supported Resources" +description: |- + Full list of supported provider resources for Dynatrace Configuration as Code via Terraform. +--- + +# Supported Resources + +Full list of supported Dynatrace Terraform provider resources with details on API endpoint and permissions is available [here](https://github.com/dynatrace-oss/terraform-provider-dynatrace/blob/main/documentation/supported-resources.md). \ No newline at end of file diff --git a/docs/resources/automation_workflow.md b/docs/resources/automation_workflow.md index b78fb03fc..a9dd48ed1 100644 --- a/docs/resources/automation_workflow.md +++ b/docs/resources/automation_workflow.md @@ -162,6 +162,7 @@ Optional: - `position` (Block List, Max: 1) Layouting information about the task tile when visualized. If not specified Dynatrace will position the task tiles automatically (see [below for nested schema](#nestedblock--tasks--task--position)) - `retry` (Block List, Max: 1) Configure whether to automatically rerun the task on failure. If not specified no retries will be attempted (see [below for nested schema](#nestedblock--tasks--task--retry)) - `timeout` (String) Specifies a default task timeout in seconds. 15 * 60 (15min) is used when not set. Minimum 1. Maximum 604800 +- `wait_before` (String) Specifies a default task wait before in seconds. 0 is used when not set - `with_items` (String) Iterates over items in a list, allowing actions to be executed repeatedly. Example: Specifying `item in [1, 2, 3]` here will execute the task three times for the numbers 1, 2 and 3 - with the current number available for scripting using the expression `{{ _.item }}` diff --git a/docs/resources/cloud_development_environments.md b/docs/resources/cloud_development_environments.md new file mode 100644 index 000000000..f707e8bb3 --- /dev/null +++ b/docs/resources/cloud_development_environments.md @@ -0,0 +1,42 @@ +--- +layout: "" +page_title: "dynatrace_cloud_development_environments Resource - terraform-provider-dynatrace" +subcategory: "Environment Settings" +description: |- + The resource `dynatrace_cloud_development_environments` covers configuration for cloud development environments +--- + +# dynatrace_cloud_development_environments (Resource) + +-> This resource requires the API token scopes **Read settings** (`settings.read`) and **Write settings** (`settings.write`) + +## Dynatrace Documentation + +- AppEngine - https://docs.dynatrace.com/docs/platform/appengine + +- Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:app-engine-registry.cloud-development-environments`) + +## Export Example Usage + +- `terraform-provider-dynatrace -export dynatrace_cloud_development_environments` downloads existing cloud development environments configuration + +The full documentation of the export feature is available [here](https://dt-url.net/h203qmc). + +## Resource Example Usage + +```terraform +resource "dynatrace_cloud_development_environments" "#name#" { + cloud_development_environments = ["https://example1.my-company.my-cde-provider.com", "https://example2.my-company.my-cde-provider.com", "https://example3.my-company.my-cde-provider.com"] +} +``` + + +## Schema + +### Optional + +- `cloud_development_environments` (Set of String) The URL to allow app development from. E.g. `https://*.my-company.my-cde-provider.com`. + +### Read-Only + +- `id` (String) The ID of this resource. diff --git a/docs/resources/direct_shares.md b/docs/resources/direct_shares.md index 546f4db7f..83adc17f8 100644 --- a/docs/resources/direct_shares.md +++ b/docs/resources/direct_shares.md @@ -22,7 +22,7 @@ description: |- ```terraform resource "dynatrace_direct_shares" "this" { - document_id = "441564f0-23c9-40ef-b344-18c02c23d712" + document_id = dynatrace_document.this.id access = "read-write" recipients { @@ -37,6 +37,147 @@ resource "dynatrace_direct_shares" "this" { } } } + +resource "dynatrace_document" "this" { + type = "dashboard" + name = "#name#" + content = jsonencode( + { + "version" : 13, + "variables" : [], + "tiles" : { + "0" : { + "type" : "markdown", + "title" : "", + "content" : "![Image of a Dashboard](https://dt-cdn.net/wp-content/uploads/2022/09/pic1____Dashboard-Preset___PNG.png)" + }, + "1" : { + "type" : "data", + "title" : "", + "query" : "timeseries avg(dt.host.cpu.user)", + "queryConfig" : { + "additionalFilters" : {}, + "version" : "4.3.1", + "datatype" : "metrics", + "metricKey" : "dt.host.cpu.user", + "aggregation" : "avg", + "by" : [] + }, + "subType" : "dql-builder-metrics", + "visualization" : "lineChart", + "visualizationSettings" : { + "thresholds" : [], + "chartSettings" : { + "gapPolicy" : "connect", + "circleChartSettings" : { + "groupingThresholdType" : "relative", + "groupingThresholdValue" : 0, + "valueType" : "relative" + }, + "categoryOverrides" : {}, + "fieldMapping" : { + "timestamp" : "timeframe", + "leftAxisValues" : [ + "avg(dt.host.cpu.user)" + ], + "leftAxisDimensions" : [], + "fields" : [], + "values" : [] + } + }, + "singleValue" : { + "showLabel" : true, + "label" : "", + "prefixIcon" : "", + "autoscale" : true, + "alignment" : "center", + "colorThresholdTarget" : "value" + }, + "table" : { + "rowDensity" : "condensed", + "enableSparklines" : false, + "hiddenColumns" : [], + "lineWrapIds" : [], + "columnWidths" : {} + } + } + }, + "2" : { + "type" : "data", + "title" : "", + "query" : "timeseries avg(dt.host.memory.used)", + "queryConfig" : { + "additionalFilters" : {}, + "version" : "4.3.1", + "datatype" : "metrics", + "metricKey" : "dt.host.memory.used", + "aggregation" : "avg", + "by" : [] + }, + "subType" : "dql-builder-metrics", + "visualization" : "lineChart", + "visualizationSettings" : { + "thresholds" : [], + "chartSettings" : { + "gapPolicy" : "connect", + "circleChartSettings" : { + "groupingThresholdType" : "relative", + "groupingThresholdValue" : 0, + "valueType" : "relative" + }, + "categoryOverrides" : {}, + "fieldMapping" : { + "timestamp" : "timeframe", + "leftAxisValues" : [ + "avg(dt.host.memory.used)" + ], + "leftAxisDimensions" : [], + "fields" : [], + "values" : [] + }, + "categoricalBarChartSettings" : {} + }, + "singleValue" : { + "showLabel" : true, + "label" : "", + "prefixIcon" : "", + "autoscale" : true, + "alignment" : "center", + "colorThresholdTarget" : "value" + }, + "table" : { + "rowDensity" : "condensed", + "enableSparklines" : false, + "hiddenColumns" : [], + "lineWrapIds" : [], + "columnWidths" : {} + } + } + } + }, + "layouts" : { + "0" : { + "x" : 0, + "y" : 0, + "w" : 24, + "h" : 14 + }, + "1" : { + "x" : 0, + "y" : 14, + "w" : 9, + "h" : 6 + }, + "2" : { + "x" : 15, + "y" : 14, + "w" : 9, + "h" : 6 + } + } + } + ) +} ``` @@ -61,7 +202,7 @@ resource "dynatrace_direct_shares" "this" { Optional: -- `recipient` (Block List, Max: 1000) Recipient of the direct share (see [below for nested schema](#nestedblock--recipients--recipient)) +- `recipient` (Block Set, Max: 1000) Recipient of the direct share (see [below for nested schema](#nestedblock--recipients--recipient)) ### Nested Schema for `recipients.recipient` diff --git a/docs/resources/document.md b/docs/resources/document.md index 80b853297..d28c65bef 100644 --- a/docs/resources/document.md +++ b/docs/resources/document.md @@ -22,12 +22,147 @@ description: |- ```terraform resource "dynatrace_document" "this" { - type = "dashboard" - name = "Example Dashboard" - content = file(format("%s/example-dashboard.json", path.module)) + type = "dashboard" + name = "Example Dashboard" + content = jsonencode( + { + "version" : 13, + "variables" : [], + "tiles" : { + "0" : { + "type" : "markdown", + "title" : "", + "content" : "![Image of a Dashboard](https://dt-cdn.net/wp-content/uploads/2022/09/pic1____Dashboard-Preset___PNG.png)" + }, + "1" : { + "type" : "data", + "title" : "", + "query" : "timeseries avg(dt.host.cpu.user)", + "queryConfig" : { + "additionalFilters" : {}, + "version" : "4.3.1", + "datatype" : "metrics", + "metricKey" : "dt.host.cpu.user", + "aggregation" : "avg", + "by" : [] + }, + "subType" : "dql-builder-metrics", + "visualization" : "lineChart", + "visualizationSettings" : { + "thresholds" : [], + "chartSettings" : { + "gapPolicy" : "connect", + "circleChartSettings" : { + "groupingThresholdType" : "relative", + "groupingThresholdValue" : 0, + "valueType" : "relative" + }, + "categoryOverrides" : {}, + "fieldMapping" : { + "timestamp" : "timeframe", + "leftAxisValues" : [ + "avg(dt.host.cpu.user)" + ], + "leftAxisDimensions" : [], + "fields" : [], + "values" : [] + } + }, + "singleValue" : { + "showLabel" : true, + "label" : "", + "prefixIcon" : "", + "autoscale" : true, + "alignment" : "center", + "colorThresholdTarget" : "value" + }, + "table" : { + "rowDensity" : "condensed", + "enableSparklines" : false, + "hiddenColumns" : [], + "lineWrapIds" : [], + "columnWidths" : {} + } + } + }, + "2" : { + "type" : "data", + "title" : "", + "query" : "timeseries avg(dt.host.memory.used)", + "queryConfig" : { + "additionalFilters" : {}, + "version" : "4.3.1", + "datatype" : "metrics", + "metricKey" : "dt.host.memory.used", + "aggregation" : "avg", + "by" : [] + }, + "subType" : "dql-builder-metrics", + "visualization" : "lineChart", + "visualizationSettings" : { + "thresholds" : [], + "chartSettings" : { + "gapPolicy" : "connect", + "circleChartSettings" : { + "groupingThresholdType" : "relative", + "groupingThresholdValue" : 0, + "valueType" : "relative" + }, + "categoryOverrides" : {}, + "fieldMapping" : { + "timestamp" : "timeframe", + "leftAxisValues" : [ + "avg(dt.host.memory.used)" + ], + "leftAxisDimensions" : [], + "fields" : [], + "values" : [] + }, + "categoricalBarChartSettings" : {} + }, + "singleValue" : { + "showLabel" : true, + "label" : "", + "prefixIcon" : "", + "autoscale" : true, + "alignment" : "center", + "colorThresholdTarget" : "value" + }, + "table" : { + "rowDensity" : "condensed", + "enableSparklines" : false, + "hiddenColumns" : [], + "lineWrapIds" : [], + "columnWidths" : {} + } + } + } + }, + "layouts" : { + "0" : { + "x" : 0, + "y" : 0, + "w" : 24, + "h" : 14 + }, + "1" : { + "x" : 0, + "y" : 14, + "w" : 9, + "h" : 6 + }, + "2" : { + "x" : 15, + "y" : 14, + "w" : 9, + "h" : 6 + } + } + } + ) } -data "dynatrace_documents" "all-dashboard-and-notebooks" {} +# data "dynatrace_documents" "all-dashboard-and-notebooks" {} ``` @@ -38,7 +173,7 @@ data "dynatrace_documents" "all-dashboard-and-notebooks" {} - `content` (String) Document content as JSON - `name` (String) The name/name of the document -- `type` (String) Type of the document. Possible Values are `dashboard` and `notebook` +- `type` (String) Type of the document. Possible Values are `dashboard`, `launchpad` and `notebook` ### Optional diff --git a/docs/resources/hub_extension_config.md b/docs/resources/hub_extension_config.md index 4cb836dcf..f6397475b 100644 --- a/docs/resources/hub_extension_config.md +++ b/docs/resources/hub_extension_config.md @@ -8,7 +8,7 @@ description: |- # dynatrace_hub_extension_config (Resource) --> This resource requires the API token scopes `extensions.write` and `extension.read`. +-> This resource requires the API token scopes `extensions.write`, `extension.read` and `hub.read`. This resource configures a monitoring configuration for the given extension with the specified version. In case the extension has not yet gotten installed for the specified version the installation happens automatically. diff --git a/docs/resources/k8s_monitoring.md b/docs/resources/k8s_monitoring.md index 7bf3d2305..6d86eae3b 100644 --- a/docs/resources/k8s_monitoring.md +++ b/docs/resources/k8s_monitoring.md @@ -32,7 +32,6 @@ resource "dynatrace_k8s_monitoring" "#name#" { include_all_fdi_events = true open_metrics_builtin_enabled = false open_metrics_pipeline_enabled = true - pvc_monitoring_enabled = true scope = "KUBERNETES_CLUSTER-1234567890000000" event_patterns { event_pattern { @@ -57,13 +56,13 @@ If you have a DPS license see [licensing documentation](https://dt-url.net/cee34 If you have a non-DPS license see [DDUs for events](https://dt-url.net/5n03vcu) for details. - `open_metrics_builtin_enabled` (Boolean) Workload and node resource metrics are based on a subset of cAdvisor metrics. Depending on your Kubernetes cluster size, this may increase the CPU/memory resource consumption of your ActiveGate. - `open_metrics_pipeline_enabled` (Boolean) For annotation guidance, see the [documentation](https://dt-url.net/g42i0ppw). -- `pvc_monitoring_enabled` (Boolean) To enable dashboards and alerts, add the [Kubernetes persistent volume claims](ui/hub/ext/com.dynatrace.extension.kubernetes-pvc) extension to your environment. ### Optional - `event_patterns` (Block List, Max: 1) Define Kubernetes event filters to ingest events into your environment. For more details, see the [documentation](https://dt-url.net/2201p0u). (see [below for nested schema](#nestedblock--event_patterns)) - `filter_events` (Boolean) Include only events specified by Events Field Selectors - `include_all_fdi_events` (Boolean) For a list of included events, see the [documentation](https://dt-url.net/l61d02no). +- `pvc_monitoring_enabled` (Boolean, Deprecated) To enable dashboards and alerts, add the [Kubernetes persistent volume claims](ui/hub/ext/com.dynatrace.extension.kubernetes-pvc) extension to your environment. - `scope` (String) The scope of this setting (KUBERNETES_CLUSTER). Omit this property if you want to cover the whole environment. ### Read-Only diff --git a/docs/resources/kubernetes_spm.md b/docs/resources/kubernetes_spm.md new file mode 100644 index 000000000..9198fc1f2 --- /dev/null +++ b/docs/resources/kubernetes_spm.md @@ -0,0 +1,48 @@ +--- +layout: "" +page_title: dynatrace_kubernetes_spm Resource - terraform-provider-dynatrace" +subcategory: "Application Security" +description: |- + The resource `dynatrace_kubernetes_spm` covers configuration for Kubernetes security posture management +--- + +# dynatrace_kubernetes_spm (Resource) + +-> This resource requires the API token scopes **Read settings** (`settings.read`) and **Write settings** (`settings.write`) + +## Dynatrace Documentation + +- Security Posture Management: Kubernetes - https://docs.dynatrace.com/docs/shortlink/kspm-start + +- Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:kubernetes.security-posture-management`) + +## Export Example Usage + +- `terraform-provider-dynatrace -export dynatrace_kubernetes_spm` downloads all existing configuration for Kubernetes security posture management + +The full documentation of the export feature is available [here](https://dt-url.net/h203qmc). + +## Resource Example Usage + +```terraform +resource "dynatrace_kubernetes_spm" "#name#" { + scope = "KUBERNETES_CLUSTER-1234567890000000" + configuration_dataset_pipeline_enabled = true +} +``` + + +## Schema + +### Required + +- `configuration_dataset_pipeline_enabled` (Boolean) Follow the [installation instructions](https://dt-url.net/4x23ut5) to deploy the Security Posture Management components. + +### Optional + +- `scope` (String) The scope of this setting (KUBERNETES_CLUSTER). Omit this property if you want to cover the whole environment. + +### Read-Only + +- `id` (String) The ID of this resource. + \ No newline at end of file diff --git a/docs/resources/log_agent_feature_flags.md b/docs/resources/log_agent_feature_flags.md new file mode 100644 index 000000000..412f1f557 --- /dev/null +++ b/docs/resources/log_agent_feature_flags.md @@ -0,0 +1,48 @@ +--- +layout: "" +page_title: dynatrace_log_agent_feature_flags Resource - terraform-provider-dynatrace" +subcategory: "Log Monitoring" +description: |- + The resource `dynatrace_log_agent_feature_flags` covers configuration for log agent feature flags +--- + +# dynatrace_log_agent_feature_flags (Resource) + +-> This resource requires the API token scopes **Read settings** (`settings.read`) and **Write settings** (`settings.write`) + +## Dynatrace Documentation + +- Log Management and Analytics - https://www.dynatrace.com/support/help/observe-and-explore/logs/log-management-and-analytics + +- Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:logmonitoring.log-agent-feature-flags`) + +## Export Example Usage + +- `terraform-provider-dynatrace -export dynatrace_log_agent_feature_flags` downloads all existing log agent feature flags + +The full documentation of the export feature is available [here](https://dt-url.net/h203qmc). + +## Resource Example Usage + +```terraform +resource "dynatrace_log_agent_feature_flags" "#name#" { + scope = "HOST-1234567890000000" + new_container_log_detector = true +} +``` + + +## Schema + +### Required + +- `new_container_log_detector` (Boolean) Enable Log Agent to use new container log detector. Please do not turn it off once enabled. For more details, check our [documentation](https://dt-url.net/jn02ey0). + +### Optional + +- `scope` (String) The scope of this setting (HOST, KUBERNETES_CLUSTER, HOST_GROUP). Omit this property if you want to cover the whole environment. + +### Read-Only + +- `id` (String) The ID of this resource. + \ No newline at end of file diff --git a/docs/resources/problem_record_propagation_rules.md b/docs/resources/problem_record_propagation_rules.md new file mode 100644 index 000000000..d7131e4a7 --- /dev/null +++ b/docs/resources/problem_record_propagation_rules.md @@ -0,0 +1,47 @@ +--- +layout: "" +page_title: dynatrace_problem_record_propagation_rules Resource - terraform-provider-dynatrace" +subcategory: "Platform" +description: |- + The resource `dynatrace_problem_record_propagation_rules` covers configuration for problem record propagation rules +--- + +# dynatrace_problem_record_propagation_rules (Resource) + +-> This resource requires the API token scopes **Read settings** (`settings.read`) and **Write settings** (`settings.write`) + +## Dynatrace Documentation + +- Grail - https://docs.dynatrace.com/docs/platform/grail + +- Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId: `builtin:problem.record.propagation.rules`) + +## Export Example Usage + +- `terraform-provider-dynatrace -export dynatrace_problem_record_propagation_rules` downloads existing problem record propagation rules + +The full documentation of the export feature is available [here](https://dt-url.net/h203qmc). + +## Resource Example Usage + +```terraform +resource "dynatrace_problem_record_propagation_rules" "#name#" { + enabled = false + source_attribute_key = "terraformSource" + target_attribute_key = "terraformTarget" +} +``` + + +## Schema + +### Required + +- `enabled` (Boolean) This setting is enabled (`true`) or disabled (`false`) +- `source_attribute_key` (String) Attribute key from the event that will be propagated. +- `target_attribute_key` (String) Attribute key under which the propagated event data will be stored on the problem. + +### Read-Only + +- `id` (String) The ID of this resource. + \ No newline at end of file diff --git a/provider/version/version.go b/provider/version/version.go index d8ed13096..046c54bae 100644 --- a/provider/version/version.go +++ b/provider/version/version.go @@ -17,4 +17,4 @@ package version -const Current = "1.69.1" +const Current = "1.70.0"