diff --git a/docs/content/develop/add-handwritten-datasource.md b/docs/content/develop/add-handwritten-datasource.md index 9c4038c3da44..76d75c1ffb9f 100644 --- a/docs/content/develop/add-handwritten-datasource.md +++ b/docs/content/develop/add-handwritten-datasource.md @@ -22,6 +22,8 @@ a new datasource there are 5 steps to doing so. 1. Create a new datasource declaration file and a corresponding test file 1. Add Schema and Read operation implementation + - If there is `labels` field with type `KeyValueLabels` in the corresponding resource, in the datasource Read operation implementation, after the resource read method, call the function `tpgresource.SetDataSourceLabels(d)` to make `labels` and `terraform_labels` have all of the labels on the resource. + - If there is `annotations` field with type `KeyValueAnnotations` in the corresponding resource, in the datasource Read operation implementation, after the resource read method, call the function `tpgresource.SetDataSourceAnnotations(d)` to make `annotations` have all of the annotations on the resource. 1. Add the datasource to the `provider.go.erb` index 1. Implement a test which will create and resources and read the corresponding datasource diff --git a/docs/content/develop/resource.md b/docs/content/develop/resource.md index a2e605c71dad..b6862779f424 100644 --- a/docs/content/develop/resource.md +++ b/docs/content/develop/resource.md @@ -223,6 +223,8 @@ For more information about types of resources and the generation process overall ```yaml # Supported types: String, Integer, Boolean, Double, Enum, # ResourceRef (link to a GCP resource), KeyValuePairs (string -> string map), +# KeyValueLabels (for standard resource 'labels' field), +# KeyValueAnnotations (for standard resource 'annotations' field) # Array, and NestedObject - !ruby/object:Api::Type::String name: 'API_FIELD_NAME'