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

New Resource: azurerm_monitor_data_collection_rule_association #17948

Merged

Conversation

teowa
Copy link
Contributor

@teowa teowa commented Aug 10, 2022

New resource azurerm_monitor_data_collection_rule_association

Resolves #17831
Reference:

  1. Microsoft doc
  2. REST API specification 2021-04-01
Test Result
make acctests SERVICE='monitor' TESTARGS='-run=TestAccMonitorDataCollectionRuleAssociation_' TESTTIMEOUT='60m'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test -v ./internal/services/monitor -run=TestAccMonitorDataCollectionRuleAssociation_ -timeout 60m -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccMonitorDataCollectionRuleAssociation_basic
=== PAUSE TestAccMonitorDataCollectionRuleAssociation_basic
=== RUN   TestAccMonitorDataCollectionRuleAssociation_basicEndpoint
=== PAUSE TestAccMonitorDataCollectionRuleAssociation_basicEndpoint
=== RUN   TestAccMonitorDataCollectionRuleAssociation_requiresImport
=== PAUSE TestAccMonitorDataCollectionRuleAssociation_requiresImport
=== RUN   TestAccMonitorDataCollectionRuleAssociation_update
=== PAUSE TestAccMonitorDataCollectionRuleAssociation_update
=== RUN   TestAccMonitorDataCollectionRuleAssociation_updateDataCollectionRuleId
=== PAUSE TestAccMonitorDataCollectionRuleAssociation_updateDataCollectionRuleId
=== RUN   TestAccMonitorDataCollectionRuleAssociation_complete
=== PAUSE TestAccMonitorDataCollectionRuleAssociation_complete
=== CONT  TestAccMonitorDataCollectionRuleAssociation_basic
=== CONT  TestAccMonitorDataCollectionRuleAssociation_update
=== CONT  TestAccMonitorDataCollectionRuleAssociation_requiresImport
=== CONT  TestAccMonitorDataCollectionRuleAssociation_basicEndpoint
=== CONT  TestAccMonitorDataCollectionRuleAssociation_complete
=== CONT  TestAccMonitorDataCollectionRuleAssociation_updateDataCollectionRuleId
--- PASS: TestAccMonitorDataCollectionRuleAssociation_complete (342.13s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_basic (343.31s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_basicEndpoint (350.74s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_requiresImport (364.89s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_updateDataCollectionRuleId (431.38s)
--- PASS: TestAccMonitorDataCollectionRuleAssociation_update (519.71s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/monitor       519.745s


The following arguments are supported:

* `name` - (Required) The name which should be used for this Data Collection Rule. Changing this forces a new Data Collection Rule to be created.
Copy link
Collaborator

Choose a reason for hiding this comment

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

if this cannot be configured to anything but configurationAccessEndpoint should we even be exposing the name? maybe we should remove it>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Like mentioned above, if data_collection_rule_id is configured, then the name can be customized. I am going to add this in the doc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

they it sounds like this property should be optional and only required when data_collection_rule_id is configured, and if it is we populate it with configurationAccessEndpoint ?

teowa added 2 commits August 30, 2022 15:47
…m into monitor_data_collection_rule_association
…m into monitor_data_collection_rule_association
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

LGTM 🦺

@katbyte katbyte merged commit 13e60f2 into hashicorp:main Sep 9, 2022
@github-actions github-actions bot added this to the v3.22.0 milestone Sep 9, 2022
katbyte added a commit that referenced this pull request Sep 9, 2022
@github-actions
Copy link

github-actions bot commented Sep 9, 2022

This functionality has been released in v3.22.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

}

# associate to a Data Collection Endpoint
resource "azurerm_data_collection_rule_association" "example1" {
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be named example2? I tried pasting the code from https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_data_collection_rule_association and hit a 'example1' already exists error from the resource above defined on line 96

Copy link
Contributor

Choose a reason for hiding this comment

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

also line 106, data_collection_endpoint_id = azurerm_monitor_data_collection_endpoint.test.id ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out, I have submitted another PR #18536 to fix this.

@github-actions
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 Oct 27, 2022
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.

Support for data collection rule association
3 participants