Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_monitor_data_collection_rule - force a new rule to be created when change a previous set kind #22811

Merged
merged 4 commits into from
Aug 7, 2023

Conversation

teowa
Copy link
Contributor

@teowa teowa commented Aug 4, 2023

failure:

    testcase.go:113: Step 5/8 error: Error running apply: exit status 1
        Error: updating Data Collection Rule (Subscription: "*******"
        Resource Group Name: "acctestRG-DataCollectionRule-230804003052837407"
        Data Collection Rule Name: "acctestmdcr-230804003052837407"): datacollectionrules.DataCollectionRulesClient#Create: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="InvalidPayload" Message="The new DCR kind `` is different from the previous one `Linux`. The kind is immutable." Details=[{"code":"InvalidPayload","message":"The new DCR kind `` is different from the previous one `Linux`. The kind is immutable."}]
          with azurerm_monitor_data_collection_rule.test,
          on terraform_plugin_test.tf line 99, in resource "azurerm_monitor_data_collection_rule" "test":
          99: resource "azurerm_monitor_data_collection_rule" "test" {
        updating Data Collection Rule (Subscription:
        "*******"
        Resource Group Name: "acctestRG-DataCollectionRule-230804003052837407"
        Data Collection Rule Name: "acctestmdcr-230804003052837407"):
        datacollectionrules.DataCollectionRulesClient#Create: Failure responding to
        request: StatusCode=400 -- Original Error: autorest/azure: Service returned
        an error. Status=400 Code="InvalidPayload" Message="The new DCR kind `` is
        different from the previous one `Linux`. The kind is immutable."
        Details=[{"code":"InvalidPayload","message":"The new DCR kind `` is different
        from the previous one `Linux`. The kind is immutable."}]

@teowa
Copy link
Contributor Author

teowa commented Aug 4, 2023

--- PASS: TestAccMonitorDataCollectionRule_requiresImport (139.09s)
--- PASS: TestAccMonitorDataCollectionRule_basic (177.50s)
--- PASS: TestAccMonitorDataCollectionRule_identity (226.20s)
--- PASS: TestAccMonitorDataCollectionRule_complete (227.72s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_basic (268.27s)
--- PASS: TestAccMonitorDataCollectionRule_kindDirectToStore (298.05s)
--- PASS: TestAccMonitorDataCollectionRuleDataSource_complete (314.30s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_basicEndpoint (329.64s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_complete (334.62s)
--- PASS: TestAccMonitorDataCollectionRule_update (353.58s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_requiresImport (356.33s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_update (403.79s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_updateDataCollectionRuleId (415.44s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor       415.510s

@@ -234,6 +235,8 @@ The following arguments are supported:

* `kind` - (Optional) The kind of the Data Collection Rule. Possible values are `Linux`, `Windows`,and `AgentDirectToStore`. A rule of kind `Linux` does not allow for `windows_event_log` data sources. And a rule of kind `Windows` does not allow for `syslog` data sources. If kind is not specified, all kinds of data sources are allowed.

~> **NOTE** Once `kind` has been set, change it forces a new Data Collection Rule to be created.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
~> **NOTE** Once `kind` has been set, change it forces a new Data Collection Rule to be created.
~> **NOTE** Once `kind` has been set, changing it forces a new Data Collection Rule to be created.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @teowa LGTM 👍

@stephybun stephybun merged commit 68c9853 into hashicorp:main Aug 7, 2023
23 checks passed
@github-actions github-actions bot added this to the v3.69.0 milestone Aug 7, 2023
stephybun added a commit that referenced this pull request Aug 7, 2023
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants