From d9d97b4a159f3773b1dfafb3550504e0ada4bca1 Mon Sep 17 00:00:00 2001 From: Jiawei Tao Date: Fri, 10 Jan 2025 10:14:32 +0800 Subject: [PATCH] mark all attributes as forceNew --- .../dynatrace/dynatrace_tag_rules_resource.go | 11 ++++++++++ .../dynatrace_tag_rules_resource_test.go | 20 ++----------------- .../docs/r/dynatrace_tag_rules.html.markdown | 14 ++++++------- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/internal/services/dynatrace/dynatrace_tag_rules_resource.go b/internal/services/dynatrace/dynatrace_tag_rules_resource.go index 4191c3f75d51..777c44b718fb 100644 --- a/internal/services/dynatrace/dynatrace_tag_rules_resource.go +++ b/internal/services/dynatrace/dynatrace_tag_rules_resource.go @@ -66,30 +66,35 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema { "send_azure_active_directory_logs_enabled": { Type: pluginsdk.TypeBool, Optional: true, + ForceNew: true, Default: false, }, "send_activity_logs_enabled": { Type: pluginsdk.TypeBool, Optional: true, + ForceNew: true, Default: false, }, "send_subscription_logs_enabled": { Type: pluginsdk.TypeBool, Optional: true, + ForceNew: true, Default: false, }, "filtering_tag": { Type: pluginsdk.TypeList, Required: true, + ForceNew: true, MinItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*schema.Schema{ "action": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ "Include", "Exclude", @@ -99,12 +104,14 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema { "name": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringIsNotEmpty, }, "value": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringIsNotEmpty, }, }, @@ -124,12 +131,14 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema { "filtering_tag": { Type: pluginsdk.TypeList, Required: true, + ForceNew: true, MinItems: 1, Elem: &pluginsdk.Resource{ Schema: map[string]*schema.Schema{ "action": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ "Include", "Exclude", @@ -139,12 +148,14 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema { "name": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringIsNotEmpty, }, "value": { Type: pluginsdk.TypeString, Required: true, + ForceNew: true, ValidateFunc: validation.StringIsNotEmpty, }, }, diff --git a/internal/services/dynatrace/dynatrace_tag_rules_resource_test.go b/internal/services/dynatrace/dynatrace_tag_rules_resource_test.go index f32a844e2932..ed2c982ca8c0 100644 --- a/internal/services/dynatrace/dynatrace_tag_rules_resource_test.go +++ b/internal/services/dynatrace/dynatrace_tag_rules_resource_test.go @@ -118,24 +118,8 @@ func (r TagRulesResource) basic(data acceptance.TestData) string { %[1]s resource "azurerm_dynatrace_tag_rules" "test" { - name = "acctestragrules%d" + name = "acctesttagrules%d" monitor_id = azurerm_dynatrace_monitor.test.id - - log_rule { - filtering_tag { - name = "Environment" - value = "Prod" - action = "Include" - } - } - - metric_rule { - filtering_tag { - name = "Environment" - value = "Prod" - action = "Include" - } - } } `, MonitorsResource{}.basic(data), data.RandomInteger) } @@ -145,7 +129,7 @@ func (r TagRulesResource) complete(data acceptance.TestData) string { %[1]s resource "azurerm_dynatrace_tag_rules" "test" { - name = "acctestragrules%d" + name = "acctesttagrules%d" monitor_id = azurerm_dynatrace_monitor.test.id log_rule { diff --git a/website/docs/r/dynatrace_tag_rules.html.markdown b/website/docs/r/dynatrace_tag_rules.html.markdown index 98555b234b04..cf1ea0134d14 100644 --- a/website/docs/r/dynatrace_tag_rules.html.markdown +++ b/website/docs/r/dynatrace_tag_rules.html.markdown @@ -87,13 +87,13 @@ The following arguments are supported: The `log_rule` block supports the following: -* `send_azure_active_directory_logs_enabled` - (Optional) Send Azure Active Directory logs. The default value is `false`. +* `send_azure_active_directory_logs_enabled` - (Optional) Send Azure Active Directory logs. The default value is `false`. Changing this forces a new resource to be created. -* `send_activity_logs_enabled` - (Optional) Send Activity logs. The default value is `false`. +* `send_activity_logs_enabled` - (Optional) Send Activity logs. The default value is `false`. Changing this forces a new resource to be created. -* `send_subscription_logs_enabled` - (Optional) Send Subscription logs. The default value is `false`. +* `send_subscription_logs_enabled` - (Optional) Send Subscription logs. The default value is `false`. Changing this forces a new resource to be created. -* `filtering_tag` - (Optional) Filtering tag for the log rule. A `filtering_tag` block as defined below. +* `filtering_tag` - (Optional) Filtering tag for the log rule. A `filtering_tag` block as defined below. Changing this forces a new resource to be created. --- @@ -105,11 +105,11 @@ The `metric_rule` block supports the following: The `filtering_tag` block supports the following: -* `name` - (Required) Name of the filtering tag. +* `name` - (Required) Name of the filtering tag. Changing this forces a new resource to be created. -* `value` - (Required) Value of the filtering tag. +* `value` - (Required) Value of the filtering tag. Changing this forces a new resource to be created. -* `action` - (Required) Action of the filtering tag. Possible values are `Include` and `Exclude`. +* `action` - (Required) Action of the filtering tag. Possible values are `Include` and `Exclude`. Changing this forces a new resource to be created. ## Attributes Reference