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_kusto_cosmosdb_data_connection #22295

Merged
merged 23 commits into from
Jul 5, 2023

Conversation

liuwuliuyun
Copy link
Contributor

@liuwuliuyun liuwuliuyun commented Jun 27, 2023

New Resource: azurerm_kusto_cosmosdb_data_connection

Swagger

New Properties:

  • cluster_name - (Required) The name of the Kusto cluster. Changing this forces a new Data Explorer to be created.

  • cosmosdb_account_id - (Required) The resource ID of the Cosmos DB account used to create the data connection. Changing this forces a new Data Explorer to be created.

  • cosmosdb_container - (Required) The name of an existing container in the Cosmos DB database. Changing this forces a new Data Explorer to be created.

  • cosmosdb_database - (Required) The name of an existing database in the Cosmos DB account. Changing this forces a new Data Explorer to be created.

  • database_name - (Required) The name of the database in the Kusto cluster. Changing this forces a new Data Explorer to be created.

  • location - (Required) The Azure Region where the Data Explorer should exist. Changing this forces a new Data Explorer to be created.

  • managed_identity_id - (Required) The resource ID of a managed system or user-assigned identity. The identity is used to authenticate with Cosmos DB. Changing this forces a new Data Explorer to be created.

  • name - (Required) The name of the data connection. Changing this forces a new Data Explorer to be created.

  • resource_group_name - (Required) The name of the Resource Group where the Data Explorer should exist. Changing this forces a new Data Explorer to be created.

  • table_name - (Required) The case-sensitive name of the existing target table in your cluster. Retrieved data is ingested into this table. Changing this forces a new Data Explorer to be created.

  • mapping_rule_name - (Optional) The name of an existing mapping rule to use when ingesting the retrieved data.

  • retrieval_start_date - (Optional) If defined, the data connection retrieves Cosmos DB documents created or updated after the specified retrieval start date.

@liuwuliuyun
Copy link
Contributor Author

TF_ACC=1 go test -parallel 10 -v ./internal/services/kusto -run=TestAccKustoCosmosDBDataConnection_ -timeout '720m' -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
========================== Starting Command Output ===========================
/usr/bin/bash /mnt/vss/_work/_temp/dd466eea-de42-4276-9aa2-06ea826ebc3d.sh
=== RUN TestAccKustoCosmosDBDataConnection_basic
=== PAUSE TestAccKustoCosmosDBDataConnection_basic
=== RUN TestAccKustoCosmosDBDataConnection_complete
=== PAUSE TestAccKustoCosmosDBDataConnection_complete
=== RUN TestAccKustoCosmosDBDataConnection_requiresImport
=== PAUSE TestAccKustoCosmosDBDataConnection_requiresImport
=== CONT TestAccKustoCosmosDBDataConnection_basic
=== CONT TestAccKustoCosmosDBDataConnection_requiresImport
=== CONT TestAccKustoCosmosDBDataConnection_complete
--- PASS: TestAccKustoCosmosDBDataConnection_basic (1509.48s)
--- PASS: TestAccKustoCosmosDBDataConnection_requiresImport (1534.44s)
--- PASS: TestAccKustoCosmosDBDataConnection_complete (1588.97s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto 1589.008s
Finishing: Run test in parallel

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 for this PR @liuwuliuyun.

I've left some comments in-line which need to be addressed. Once that's done I can proceed with my review.

Thanks!

ForceNew: true,
ValidateFunc: validate.DatabaseName,
},
"managed_identity_id": {
Copy link
Member

Choose a reason for hiding this comment

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

If this is the managed identity from the cosmosdb resource can we specify that in the name?

Suggested change
"managed_identity_id": {
"cosmosdb_managed_identity_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.

not exactly, this identity id could be user assigned identity id or a system assigned identity id (resource id) in some cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You could see the similar managed_identity_id in other kusto data connection resources

@liuwuliuyun
Copy link
Contributor Author

liuwuliuyun commented Jun 30, 2023

Finshied suggested change and here is the testing evidence.

TF_ACC=1 go test -parallel 10 -v ./internal/services/kusto -run=TestAccKustoCosmosDBDataConnection_ -timeout '720m' -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
========================== Starting Command Output ===========================
/usr/bin/bash /mnt/vss/_work/_temp/3d9e695c-51fb-4894-851f-7a938c6cbdbd.sh
=== RUN   TestAccKustoCosmosDBDataConnection_basic
=== PAUSE TestAccKustoCosmosDBDataConnection_basic
=== RUN   TestAccKustoCosmosDBDataConnection_complete
=== PAUSE TestAccKustoCosmosDBDataConnection_complete
=== RUN   TestAccKustoCosmosDBDataConnection_requiresImport
=== PAUSE TestAccKustoCosmosDBDataConnection_requiresImport
=== CONT  TestAccKustoCosmosDBDataConnection_basic
=== CONT  TestAccKustoCosmosDBDataConnection_requiresImport
=== CONT  TestAccKustoCosmosDBDataConnection_complete
--- PASS: TestAccKustoCosmosDBDataConnection_complete (1568.89s)
--- PASS: TestAccKustoCosmosDBDataConnection_requiresImport (1596.37s)
--- PASS: TestAccKustoCosmosDBDataConnection_basic (1883.40s)
PASS
ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto	1883.419s
Finishing: Run test in parallel

@liuwuliuyun liuwuliuyun requested a review from stephybun July 3, 2023 05:51
@liuwuliuyun
Copy link
Contributor Author

Generating script.
Script contents:
TF_ACC=1 go test -parallel 10 -v ./internal/services/kusto -run=TestAccKustoCosmosDBDataConnection_ -timeout '720m' -ldflags="-X=github.com/hashicorp/terraform-provider-azurerm/version.ProviderVersion=acc"
========================== Starting Command Output ===========================
/usr/bin/bash /mnt/vss/_work/_temp/efaa4bde-7613-4c0b-80cc-9f1bc6bb68bc.sh
=== RUN   TestAccKustoCosmosDBDataConnection_basic
=== PAUSE TestAccKustoCosmosDBDataConnection_basic
=== RUN   TestAccKustoCosmosDBDataConnection_complete
=== PAUSE TestAccKustoCosmosDBDataConnection_complete
=== RUN   TestAccKustoCosmosDBDataConnection_requiresImport
=== PAUSE TestAccKustoCosmosDBDataConnection_requiresImport
=== CONT  TestAccKustoCosmosDBDataConnection_basic
=== CONT  TestAccKustoCosmosDBDataConnection_requiresImport
=== CONT  TestAccKustoCosmosDBDataConnection_complete
--- PASS: TestAccKustoCosmosDBDataConnection_complete (1535.57s)
--- PASS: TestAccKustoCosmosDBDataConnection_basic (1550.99s)
--- PASS: TestAccKustoCosmosDBDataConnection_requiresImport (1587.07s)
PASS
ok  	github.com/hashicorp/terraform-provider-azurerm/internal/services/kusto	1587.114s
Finishing: Run test in parallel

@liuwuliuyun liuwuliuyun requested a review from stephybun July 5, 2023 02:50
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 @liuwuliuyun LGTM 💭

@stephybun stephybun merged commit 5bcb3f4 into hashicorp:main Jul 5, 2023
@github-actions github-actions bot added this to the v3.64.0 milestone Jul 5, 2023
stephybun added a commit that referenced this pull request Jul 5, 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 24, 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