Skip to content

Commit

Permalink
mark all attributes as forceNew
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaweitao001 committed Jan 10, 2025
1 parent 32e1fd3 commit d9d97b4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 25 deletions.
11 changes: 11 additions & 0 deletions internal/services/dynatrace/dynatrace_tag_rules_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
},
},
Expand All @@ -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",
Expand All @@ -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,
},
},
Expand Down
20 changes: 2 additions & 18 deletions internal/services/dynatrace/dynatrace_tag_rules_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions website/docs/r/dynatrace_tag_rules.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand All @@ -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

Expand Down

0 comments on commit d9d97b4

Please sign in to comment.