|
| 1 | +# Repository Guidelines |
| 2 | + |
| 3 | +## Project Structure & Module Organization |
| 4 | +- `src/`: Terraform component (`main.tf`, `variables.tf`, `outputs.tf`, `providers.tf`, `versions.tf`, `context.tf`). This is the source of truth. |
| 5 | +- `test/`: Go Terratest suite using Atmos fixtures (`component_test.go`, `fixtures/`, `test_suite.yaml`). Tests deploy/destroy real AWS resources. |
| 6 | +- `README.yaml`: Source for the generated `README.md` (via atmos + terraform-docs). |
| 7 | +- `.github/`: CI/CD, Renovate/Dependabot, labels, and automerge settings. |
| 8 | +- `docs/`: Project docs (if any). Keep lightweight and current. |
| 9 | + |
| 10 | +## Build, Test, and Development Commands |
| 11 | +- To install atmos read this docs https://github.com/cloudposse/atmos |
| 12 | +- `atmos docs generate readme`: Regenerate `README.md` from `README.yaml` and terraform source. |
| 13 | +- `atmos docs generate readme-simple`: Regenerate `src/README.md` from `README.yaml` and terraform source. |
| 14 | +- `atmos test run`: Run Terratest suite in `test/` (uses Atmos fixtures; creates and destroys AWS resources). |
| 15 | +- Pre-commit locally: `pre-commit install && pre-commit run -a` (runs `terraform_fmt`, `terraform_docs`, `tflint`). |
| 16 | +- TFLint plugin setup: `tflint --init` (uses `.tflint.hcl`). |
| 17 | + |
| 18 | +## Coding Style & Naming Conventions |
| 19 | +- Indentation: Terraform 2 spaces; YAML/Markdown 2 spaces. |
| 20 | +- Terraform: prefer lower_snake_case for variables/locals; keep resources/data sources descriptive and aligned with Cloud Posse null-label patterns. |
| 21 | +- Lint/format: `terraform fmt -recursive`, TFLint rules per `.tflint.hcl`. Do not commit formatting or lint violations. |
| 22 | + |
| 23 | +## Testing Guidelines |
| 24 | +- Framework: Go Terratest with `github.com/cloudposse/test-helpers` and `atmos` fixtures. |
| 25 | +- Location/naming: put tests in `test/` and name files `*_test.go`. Add scenarios under `test/fixtures/stacks/catalog/usecase/`. |
| 26 | +- Run: `atmos test run`. Ensure AWS credentials are configured; tests may incur AWS costs and will clean up after themselves. |
| 27 | + |
| 28 | +## Commit & Pull Request Guidelines |
| 29 | +- Commits: follow Conventional Commits (e.g., `feat:`, `fix:`, `chore(deps):`, `docs:`). Keep messages concise and scoped. |
| 30 | +- PRs: include a clear description, linked issues, and any behavioral changes. Update `README.yaml` when inputs/outputs change and run `atmos docs generate readme`. |
| 31 | +- CI: ensure pre-commit, TFLint, and tests pass. Avoid unrelated changes in the same PR. |
| 32 | + |
| 33 | +## Security & Configuration Tips |
| 34 | +- Never commit secrets. Configure AWS credentials/role assumption externally; the provider setup in `src/providers.tf` supports role assumption via the `iam_roles` module. |
| 35 | +- Global quotas must be applied in `us-east-1`; place in the `gbl` stack and set `region: us-east-1` in `vars`. |
0 commit comments