diff --git a/docs/content/develop/add-resource.md b/docs/content/develop/add-resource.md index db6cd2c1993d..1a50218d3808 100644 --- a/docs/content/develop/add-resource.md +++ b/docs/content/develop/add-resource.md @@ -158,6 +158,7 @@ For more information about types of resources and the generation process overall - Documentation: [`magic-modules/mmv1/third_party/terraform/website/docs/r`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/website/docs/r) - Tests: Copy to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services), and remove `_generated` from the filename - Sweepers: Put to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services), and add `_sweeper` suffix to the filename + - Metadata: Copy `*_meta.yaml` to the appropriate service folder inside [`magic-modules/mmv1/third_party/terraform/services`](https://github.com/GoogleCloudPlatform/magic-modules/tree/main/mmv1/third_party/terraform/services), and remove `_generated` from the filename 4. Modify the Go code as needed. - Replace all occurrences of `github.com/hashicorp/terraform-provider-google-beta/google-beta` with `github.com/hashicorp/terraform-provider-google/google` - Remove the `Example` suffix from all test function names. diff --git a/docs/content/reference/metadata.md b/docs/content/reference/metadata.md new file mode 100644 index 000000000000..5b5e0cd7ae50 --- /dev/null +++ b/docs/content/reference/metadata.md @@ -0,0 +1,32 @@ +--- +title: "MMv1 metadata reference" +weight: 35 +--- + +# MMv1 metadata reference + +This page documents all properties for metadata. Metadata does not impact the provider itself, but is used by Google internally for coverage metrics. + +## Required + +### `resource` + +The name of the Terraform resource e.g., "google_cloudfunctions2_function". + +### `generation_type` + +The generation method used to create the Terraform resource e.g., "mmv1", "dcl", "handwritten". + +## Optional + +### `api_service_name` + +The base name of the API used for this resource e.g., "cloudfunctions.googleapis.com". + +### `api_version` + +The version of the API used for this resource e.g., "v2". + +### `api_resource_type_kind` + +The API "resource type kind" used for this resource e.g., "Function". diff --git a/mmv1/api/resource.go b/mmv1/api/resource.go index 3edcd10210c1..0599004861d2 100644 --- a/mmv1/api/resource.go +++ b/mmv1/api/resource.go @@ -331,6 +331,10 @@ type Resource struct { // The compiler to generate the downstream files, for example "terraformgoogleconversion-codegen". Compiler string `yaml:"-"` + // The API "resource type kind" used for this resource e.g., "Function". + // If this is not set, then :name is used instead, which is strongly + // preferred wherever possible. Its main purpose is for supporting + // fine-grained resources and legacy resources. ApiResourceTypeKind string `yaml:"api_resource_type_kind,omitempty"` ImportPath string `yaml:"-"`