-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_data_factory_dataset_cosmosdb_mongoapi #28185
base: main
Are you sure you want to change the base?
New Resource: azurerm_data_factory_dataset_cosmosdb_mongoapi #28185
Conversation
There was a problem hiding this 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!
I've taken a look through and left some comments inline, but this is mostly looking good to me 👍
internal/services/datafactory/data_factory_dataset_cosmosdb_mongoapi_resource.go
Outdated
Show resolved
Hide resolved
internal/services/datafactory/data_factory_dataset_cosmosdb_mongoapi_resource.go
Outdated
Show resolved
Hide resolved
internal/services/datafactory/data_factory_dataset_cosmosdb_mongoapi_resource.go
Outdated
Show resolved
Hide resolved
internal/services/datafactory/data_factory_dataset_cosmosdb_mongoapi_resource_test.go
Outdated
Show resolved
Hide resolved
- Reorder schema properties - Change AdditionalProperties model type to map[string]string - Change Parameters to map[string]string - Use existing utils.FlattenStringSlice instead of creating a new function - acctest: update: add 1 more step to update back to basic - terrafmt fix for acctest and docs
LGTM! Thank you @gerrytan! |
Acctest passes as of commit f65b76f : acctests_TestAccDataFactoryDatasetCosmosDbMongoDb_20241209-1628+1100.log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gerrytan - Few questions and observations below, the key one is the choice of SDK for this new resource. We should prefer go-azure-sdk
over kermit
unless there's a compelling technical reason as we are attempting to discontinue the use of kermit
entirely.
If you can take a look I'll continue review. Thanks!
|
||
* `folder` - (Optional) The folder that this Dataset is in. If not specified, the Dataset will appear at the root level. | ||
|
||
* `parameters` - (Optional) A map of parameters to associate with the Data Factory Dataset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these exclusively strings? Are there no defined keys for these parameters? If only string values are supported here for technical reasons, it should be called out as a note?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added additional info that only string -> string is supported. I decided not to support other parameter type to maintain consistency with the other _dataset_
resources in the folder.
@@ -0,0 +1,339 @@ | |||
package datafactory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This filename seems so be mismatched from the resource name? Should it be data_factory_dataset_cosmosdb_mongodb_resource.go
, or should the resource model be named DataFactoryDatasetCosmosDbMongoAPIResource
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, have fixed this into _mondodbapi_resource
and corresponding go model type.
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" | ||
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" | ||
"github.com/hashicorp/terraform-provider-azurerm/utils" | ||
"github.com/jackofallops/kermit/sdk/datafactory/2018-06-01/datafactory" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason we're using kermit
here rather than go-azure-sdk
? It appears supported. We should be avoiding any new usages of Kermit as we are attempting to deprecate and remove this workaround SDK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have switched to go-azure-sdk in d95a18f. There are tons of other resources in this folder still using kermit though, I've decided they're out of scope of this PR.
|
||
--- | ||
|
||
* `additional_properties` - (Optional) A map of additional properties to associate with the Data Factory Dataset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per parameters
, can we make this a little more clear as to what is expected here, and what is supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have added more info to the doc in d95a18f
- Switch to go-azure-sdk - Add nil checks, remove additional_properties from acctest - Document the limited support of string parameters - Renamed resource go type to be consistent with file name
acctest passed at the latest commit 645977d: acctests_TestAccDataFactoryDatasetCosmosDbMongoDbApi_645977dfbd_20241213-1238+1100.zip |
Community Note
Description
Adds a new resource for Data Factory CosmosDB MongoDB dataset. The resource is modelled similar to data_factory_dataset_cosmosdb_sqlapi
Resource relationship:
Resource screenshot in portal:
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Testing
acctest log: acctests_TestAccDataFactoryDatasetCosmosDbMongoDb_7358021176_20241205-1121+1100.log
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_data_factory_dataset_cosmosdb_mongoapi
- new resource [Cosmos DB MongoDB-API Data Factory dataset #27106]This is a (please select all that apply):
Related Issue(s)
Closes #27106
Note
If this PR changes meaningfully during the course of review please update the title and description as required.