Skip to content

Commit d9d97b4

Browse files
committed
mark all attributes as forceNew
1 parent 32e1fd3 commit d9d97b4

3 files changed

Lines changed: 20 additions & 25 deletions

File tree

internal/services/dynatrace/dynatrace_tag_rules_resource.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,30 +66,35 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema {
6666
"send_azure_active_directory_logs_enabled": {
6767
Type: pluginsdk.TypeBool,
6868
Optional: true,
69+
ForceNew: true,
6970
Default: false,
7071
},
7172

7273
"send_activity_logs_enabled": {
7374
Type: pluginsdk.TypeBool,
7475
Optional: true,
76+
ForceNew: true,
7577
Default: false,
7678
},
7779

7880
"send_subscription_logs_enabled": {
7981
Type: pluginsdk.TypeBool,
8082
Optional: true,
83+
ForceNew: true,
8184
Default: false,
8285
},
8386

8487
"filtering_tag": {
8588
Type: pluginsdk.TypeList,
8689
Required: true,
90+
ForceNew: true,
8791
MinItems: 1,
8892
Elem: &pluginsdk.Resource{
8993
Schema: map[string]*schema.Schema{
9094
"action": {
9195
Type: pluginsdk.TypeString,
9296
Required: true,
97+
ForceNew: true,
9398
ValidateFunc: validation.StringInSlice([]string{
9499
"Include",
95100
"Exclude",
@@ -99,12 +104,14 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema {
99104
"name": {
100105
Type: pluginsdk.TypeString,
101106
Required: true,
107+
ForceNew: true,
102108
ValidateFunc: validation.StringIsNotEmpty,
103109
},
104110

105111
"value": {
106112
Type: pluginsdk.TypeString,
107113
Required: true,
114+
ForceNew: true,
108115
ValidateFunc: validation.StringIsNotEmpty,
109116
},
110117
},
@@ -124,12 +131,14 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema {
124131
"filtering_tag": {
125132
Type: pluginsdk.TypeList,
126133
Required: true,
134+
ForceNew: true,
127135
MinItems: 1,
128136
Elem: &pluginsdk.Resource{
129137
Schema: map[string]*schema.Schema{
130138
"action": {
131139
Type: pluginsdk.TypeString,
132140
Required: true,
141+
ForceNew: true,
133142
ValidateFunc: validation.StringInSlice([]string{
134143
"Include",
135144
"Exclude",
@@ -139,12 +148,14 @@ func (r TagRulesResource) Arguments() map[string]*schema.Schema {
139148
"name": {
140149
Type: pluginsdk.TypeString,
141150
Required: true,
151+
ForceNew: true,
142152
ValidateFunc: validation.StringIsNotEmpty,
143153
},
144154

145155
"value": {
146156
Type: pluginsdk.TypeString,
147157
Required: true,
158+
ForceNew: true,
148159
ValidateFunc: validation.StringIsNotEmpty,
149160
},
150161
},

internal/services/dynatrace/dynatrace_tag_rules_resource_test.go

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,24 +118,8 @@ func (r TagRulesResource) basic(data acceptance.TestData) string {
118118
%[1]s
119119
120120
resource "azurerm_dynatrace_tag_rules" "test" {
121-
name = "acctestragrules%d"
121+
name = "acctesttagrules%d"
122122
monitor_id = azurerm_dynatrace_monitor.test.id
123-
124-
log_rule {
125-
filtering_tag {
126-
name = "Environment"
127-
value = "Prod"
128-
action = "Include"
129-
}
130-
}
131-
132-
metric_rule {
133-
filtering_tag {
134-
name = "Environment"
135-
value = "Prod"
136-
action = "Include"
137-
}
138-
}
139123
}
140124
`, MonitorsResource{}.basic(data), data.RandomInteger)
141125
}
@@ -145,7 +129,7 @@ func (r TagRulesResource) complete(data acceptance.TestData) string {
145129
%[1]s
146130
147131
resource "azurerm_dynatrace_tag_rules" "test" {
148-
name = "acctestragrules%d"
132+
name = "acctesttagrules%d"
149133
monitor_id = azurerm_dynatrace_monitor.test.id
150134
151135
log_rule {

website/docs/r/dynatrace_tag_rules.html.markdown

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ The following arguments are supported:
8787

8888
The `log_rule` block supports the following:
8989

90-
* `send_azure_active_directory_logs_enabled` - (Optional) Send Azure Active Directory logs. The default value is `false`.
90+
* `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.
9191

92-
* `send_activity_logs_enabled` - (Optional) Send Activity logs. The default value is `false`.
92+
* `send_activity_logs_enabled` - (Optional) Send Activity logs. The default value is `false`. Changing this forces a new resource to be created.
9393

94-
* `send_subscription_logs_enabled` - (Optional) Send Subscription logs. The default value is `false`.
94+
* `send_subscription_logs_enabled` - (Optional) Send Subscription logs. The default value is `false`. Changing this forces a new resource to be created.
9595

96-
* `filtering_tag` - (Optional) Filtering tag for the log rule. A `filtering_tag` block as defined below.
96+
* `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.
9797

9898
---
9999

@@ -105,11 +105,11 @@ The `metric_rule` block supports the following:
105105

106106
The `filtering_tag` block supports the following:
107107

108-
* `name` - (Required) Name of the filtering tag.
108+
* `name` - (Required) Name of the filtering tag. Changing this forces a new resource to be created.
109109

110-
* `value` - (Required) Value of the filtering tag.
110+
* `value` - (Required) Value of the filtering tag. Changing this forces a new resource to be created.
111111

112-
* `action` - (Required) Action of the filtering tag. Possible values are `Include` and `Exclude`.
112+
* `action` - (Required) Action of the filtering tag. Possible values are `Include` and `Exclude`. Changing this forces a new resource to be created.
113113

114114
## Attributes Reference
115115

0 commit comments

Comments
 (0)