Skip to content

Commit e8d6b4f

Browse files
committed
few changes after @JunyiYi review
1 parent eaef681 commit e8d6b4f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

provider/CONTRIBUTE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ For each piece of code that you write into the provider, you need to make sure t
152152
- the implementation in both `data source` and `resource` definition
153153
- acceptance test created or updated
154154
- documentation created or updated
155-
- example created or updated
155+
- example created or updated (optional)
156156

157157
Data sources, resources and tests are defined in the [azurerm](https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/azurerm) folder of the repository.
158158

@@ -197,13 +197,13 @@ client.registerBatchClients(endpoint, c.SubscriptionID, auth)
197197

198198
By doing the four steps above, you will make sure that when developping the data source or the resource, you can access the Azure SDK for Go clients that you need.
199199

200-
### Developping a Data Source
200+
### Developing a Data Source
201201

202202
The file for a data source is named following the convention: data_source_*NAME_OF_THE_DATA_SOURCE*.go.
203203

204204
A data source is composed of two relevant functions:
205205

206-
- The function that creates a `schema.Resource` object that returns the schema (definition) of the data source,i.e. the property that compose the data source, and some rules about those properties (for example, if it is mandatory or not, computed etc.). This function is named by convention dataSourceArm*NAME_OF_THE_DATA_SOURCE*, for example `dataSourceArmBatchAccount` for a Batch Account.
206+
- The function that creates a `schema.Resource` object that returns the schema (definition) of the data source,i.e. the property that compose the data source, and some rules about those properties. You only need to provide required properties to locate that resource, and mark all other properties returned from the service as `Computed`. This function is named by convention dataSourceArm*NAME_OF_THE_DATA_SOURCE*, for example `dataSourceArmBatchAccount` for a Batch Account.
207207
- The function that retrieves the data from Azure using the Azure SDK for Go client and set all the values related to the data source. This function is named by convention dataSourceArm*NAME_OF_THE_DATA_SOURCE*Read, for example `dataSourceArmBatchAccountRead` for a Batch Account.
208208

209209
This function takes a `schema.ResourceData` in parameter. You can get the name of the object to retrieve and any property that is defined by the user on that object:
@@ -232,7 +232,7 @@ You can check the whole definition of the Azure Batch Account data source [here]
232232
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:
233233

234234
- The file is named using the convention: resource_arm_*NAME_OF_RESOURCE*.go
235-
- One function to define the structure of the resource, named by convention resourceArm*NAME_OF_RESOURCE*, for example `resourceArmBatchAccount`.
235+
- One function to define the schema of the resource, named by convention resourceArm*NAME_OF_RESOURCE*, for example `resourceArmBatchAccount`.
236236
- One function to create the resource, named by convention resourceArm*NAME_OF_RESOURCE*Create, for example `resourceArmBatchAccountCreate`.
237237
- One function to read the resource, named by convention resourceArm*NAME_OF_RESOURCE*Read, for example `resourceArmBatchAccountRead`.
238238
- One function to update the resource, named by convention resourceArm*NAME_OF_RESOURCE*Update, for example `resourceArmBatchAccountUpdate`.

0 commit comments

Comments
 (0)