|
| 1 | +# Stub Generator |
| 2 | + |
| 3 | +## Generator |
| 4 | + |
| 5 | +This will accept a name, then generate the correct files needed to implement the provider functionality. |
| 6 | + |
| 7 | +The name should match what the Terraform data source will be called (e.g., `corefunc_example`). |
| 8 | + |
| 9 | +From this `generator/` directory, run the command. |
| 10 | + |
| 11 | +```bash |
| 12 | +go run main.go --name corefunc_example |
| 13 | +``` |
| 14 | + |
| 15 | +After that, search the project for `@TODO` and make the appropriate changes. Exclude `./generator,*.md,.*.yml`. |
| 16 | + |
| 17 | +## Checklist |
| 18 | + |
| 19 | +* [ ] Generate the stub files. |
| 20 | +* [ ] In the new `*_data_source.go` file, update the `*SourceModel` struct. |
| 21 | +* [ ] In the new `*_data_source.go` file, update the Schema Attributes to match the `*SourceModel` struct. |
| 22 | +* [ ] In the new `*_data_source.go` file, implement the remainder of the `Read` function. |
| 23 | +* [ ] In the new test fixture file, implement the test cases. |
| 24 | +* [ ] In the new `*_data_source_fixture.tftpl` file, ensure the fixture is implemented correctly. |
| 25 | +* [ ] In the new `*_data_source_test.go` file, ensure the test references the fixture correctly. |
| 26 | +* [ ] Run the integration tests. |
| 27 | +* [ ] In the new `examples/data-sources/*/data-source.tf` file, ensure the example is implemented correctly. |
| 28 | +* [ ] In the new `examples/data-sources/*/terraform-plan.example` file, copy content or delete. |
| 29 | +* [ ] In the new `templates/data-sources/*.tmpl` file, update the template that will be used by the `tfplugindocs` package. |
| 30 | +* [ ] Generate the Terraform provider documentation. |
| 31 | +* [ ] Run `tfschema data show -format=json DATASOURCE | jq -Mrc '.attributes[]'`. |
| 32 | +* [ ] In the new `bats/*.bats.sh` file, update its contents to match the `tfschema` output. |
| 33 | +* [ ] Run the bats tests. |
0 commit comments