Skip to content

Commit 8b65cc2

Browse files
committed
add data source/resource registration in provider.go
1 parent e8d6b4f commit 8b65cc2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

provider/CONTRIBUTE.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ If you are a new contributor, there is a [good first issue](https://github.com/t
149149

150150
For each piece of code that you write into the provider, you need to make sure that you have:
151151

152-
- the implementation in both `data source` and `resource` definition
152+
- the implementations of the `data source` and/or `resource` definition
153153
- acceptance test created or updated
154154
- documentation created or updated
155155
- example created or updated (optional)
@@ -227,6 +227,13 @@ d.Set("account_endpoint", resp.AccountEndpoint)
227227

228228
You can check the whole definition of the Azure Batch Account data source [here](https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/azurerm/data_source_batch_account.go).
229229

230+
Once your data source is defined, you need to register it into data sources map in the `provider.go` file:
231+
232+
```go
233+
DataSourcesMap: map[string]*schema.Resource{
234+
"azurerm_api_management": dataSourceApiManagementService(),
235+
```
236+
230237
### Developing a resource
231238
232239
Developing a resource is really similar to developing a data source. Instead of having only a function to read the data from Azure, it also offers the possibility to write functions to create, update and delete the resource. Apart from that, concepts are the same:
@@ -250,6 +257,13 @@ You can find examples of tests for Azure Batch Account data source [here](https:
250257
251258
Please refer to the above section to learn on to run the acceptance tests on your laptop.
252259
260+
Once your resource is defined, you need to register it into the resources map in the `provider.go` file:
261+
262+
```go
263+
ResourcesMap: map[string]*schema.Resource{
264+
"azurerm_api_management": resourceArmApiManagementService(),
265+
```
266+
253267
## Other
254268
255269
### Slack

0 commit comments

Comments
 (0)