You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CONTRIBUTING.md
+2
Original file line number
Diff line number
Diff line change
@@ -325,6 +325,8 @@ make scaffold resource_name=streamInstance type=resource
325
325
326
326
This will generate resource/data source files and accompanying test files needed for starting the development, and will contain multiple comments with `TODO:` statements which give guidance for the development.
327
327
328
+
As a follow up step, use [Scaffolding Schema and Model Definitions](#scaffolding-schema-and-model-definitions) to autogenerate the schema via the Open API specification. This will require making adjustments to the generated `./internal/service/<resource_name>/tfplugingen/generator_config.yml` file.
329
+
328
330
#### Scaffolding Schema and Model Definitions
329
331
330
332
Complementary to the `scaffold` command, there is a command which generates the initial Terraform schema definition and associated Go types for a resource or data source. This processes leverages [Code Generation Tools](https://developer.hashicorp.com/terraform/plugin/code-generation) developed by HashiCorp, which in turn make use of the [Atlas Admin API](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/) OpenAPI Specification.
// TODO: Schema and model must be defined in data_source_{{.NameSnakeCase}}_schema.go. Details on scaffolding this file found in CONTRIBUTING.md under "Scaffolding Schema and Model Definitions"
map[string]schema.Attribute{}, // TODO: define arguments of the data source
41
-
map[string]schema.Attribute{}, // TODO: define attributes of the result elements, schema from singular data source can be reused
42
-
)
30
+
// TODO: Schema and model must be defined in data_source_{{.NameSnakeCase}}s_schema.go. Details on scaffolding this file found in CONTRIBUTING.md under "Scaffolding Schema and Model Definitions"
// TODO: Schema and model must be defined in resource_{{.NameSnakeCase}}_schema.go. Details on scaffolding this file found in CONTRIBUTING.md under "Scaffolding Schema and Model Definitions"
0 commit comments