|  | 
|  | 1 | +This is a Go based repository hosting a Terrform provider for the elastic stack (elasticsearch and kibana) APIs.  This repo currently supports both [plugin framework](https://developer.hashicorp.com/terraform/plugin/framework/getting-started/code-walkthrough) and [sdkv2](https://developer.hashicorp.com/terraform/plugin/sdkv2) resources. All new resources _must_ use the plugin framework.  | 
|  | 2 | + | 
|  | 3 | +For further information, please see [README.md](../README.md) and the [CONTRIBUTING.md](../CONTRIBUTING.md) docs. | 
|  | 4 | + | 
|  | 5 | +## Code Standards | 
|  | 6 | + | 
|  | 7 | +### Required Before Each Commit | 
|  | 8 | +- Run `make fmt` before committing any changes to ensure proper code formatting, this will run gofmt on all Go files to maintain consistent style. | 
|  | 9 | +- Run `make lint` to ensure any linting errors have not surfaced with your changes | 
|  | 10 | + | 
|  | 11 | +### Required Before Pull Request | 
|  | 12 | +- Run `make gen` to update the documentation and code based on your changes. | 
|  | 13 | + | 
|  | 14 | +### Development Flow | 
|  | 15 | +- Develop feature or fix bug | 
|  | 16 | +- Write tests to validate behavior | 
|  | 17 | +- Run `make test` to run test suite | 
|  | 18 | + | 
|  | 19 | +## Repository Structure | 
|  | 20 | + | 
|  | 21 | +• **docs/** - Documentation files | 
|  | 22 | +  • **data-sources/** - Documentation for Terraform data sources (51 files) | 
|  | 23 | +  • **guides/** - User guides and tutorials | 
|  | 24 | +  • **resources/** - Documentation for Terraform resources (35 files) | 
|  | 25 | +• **examples/** - Example Terraform configurations | 
|  | 26 | +  • **cloud/** - Examples using the cloud to launch testing stacks | 
|  | 27 | +  • **data-sources/** - Data source usage examples (45+ examples) | 
|  | 28 | +  • **resources/** - Resource usage examples (30+ examples) | 
|  | 29 | +  • **provider/** - Provider configuration examples | 
|  | 30 | +• **generated/** - Auto-generated clients from the `generate-clients` make target | 
|  | 31 | +  • **alerting/** - Kibana alerting API client | 
|  | 32 | +  • **connectors/** - Kibana connectors API client | 
|  | 33 | +  • **kbapi/** - Kibana API client | 
|  | 34 | +  • **slo/** - SLO (Service Level Objective) API client | 
|  | 35 | +• **internal/** - Internal Go packages | 
|  | 36 | +  • **acctest/** - Acceptance test utilities | 
|  | 37 | +  • **clients/** - API client implementations | 
|  | 38 | +  • **elasticsearch/** - Elasticsearch-specific logic | 
|  | 39 | +  • **fleet/** - Fleet management functionality | 
|  | 40 | +  • **kibana/** - Kibana-specific logic | 
|  | 41 | +  • **models/** - Data models and structures | 
|  | 42 | +  • **schema/** - Connection schema definitions for plugin framework | 
|  | 43 | +  • **utils/** - Utility functions | 
|  | 44 | +  • **versionutils/** - Version handling utilities | 
|  | 45 | +• **libs/** - External libraries | 
|  | 46 | +  • **go-kibana-rest/** - Kibana REST API client library | 
|  | 47 | +• **provider/** - Core Terraform provider implementation | 
|  | 48 | +• **scripts/** - Utility scripts for development and CI | 
|  | 49 | +• **templates/** - Template files for documentation generation | 
|  | 50 | +  • **data-sources/** - Data source documentation templates | 
|  | 51 | +  • **resources/** - Resource documentation templates | 
|  | 52 | +  • **guides/** - Guide documentation templates | 
|  | 53 | +• **xpprovider/** - Additional provider functionality needed for Crossplane | 
|  | 54 | + | 
|  | 55 | +## Key Guidelines | 
|  | 56 | +* Follow Go best practices and idiomatic patterns | 
|  | 57 | +* Maintain existing code structure and organization | 
|  | 58 | +* Write unit tests for new functionality. Use table-driven unit tests when possible. | 
|  | 59 | +* Avoid adding any extra functionality into the `utils` package, instead preferencing adding to a more specific package or creating one to match the purpose | 
|  | 60 | +* Think through your planning first using the codebase as your guide before creating new resources and data sources | 
|  | 61 | + | 
0 commit comments