mirror of
https://github.com/Sea-Haven-Industries/engineering-handbook.git
synced 2026-09-30 04:33:13 +00:00
Some checks failed
ci / ci / ci (push) Has been cancelled
Make HCP Terraform plus GitHub Actions content CD the default for new workloads, and keep SAM/CDK documented as the remaining path.
52 lines
2 KiB
Markdown
52 lines
2 KiB
Markdown
# Naming Conventions
|
|
|
|
## The Rule
|
|
|
|
kebab-case for everything. No exceptions.
|
|
|
|
No `snake_case`, `PascalCase`, or mixed styles anywhere.
|
|
|
|
## Where It Applies
|
|
|
|
| Resource | Example |
|
|
|---|---|
|
|
| Repository names | `expense-approval-bot`, `door-unlock-api` |
|
|
| CloudFormation stack names | `expense-approval-bot` (must match repo name) |
|
|
| Lambda function names | `expense-approval-bot-process-receipt` |
|
|
| DynamoDB table names | `expense-approval-bot-receipts` |
|
|
| S3 bucket names | `expense-approval-bot-uploads` |
|
|
| Secrets Manager secrets | `expense-approval-bot/slack-signing` |
|
|
| Feature branches | `feature/add-receipt-parser` |
|
|
| HCP workspaces | `expense-approval-bot-dev`, `expense-approval-bot-prod` |
|
|
| HCP apply / plan roles | `hcptf-expense-approval-bot`, `hcptf-expense-approval-bot-plan` |
|
|
| GitHub deploy role | `githubdeploy-expense-approval-bot` |
|
|
| Deploy SSM prefix | `/expense-approval-bot/deploy/` |
|
|
|
|
## CDK Gotcha
|
|
|
|
CDK generates PascalCase stack names by default. Always set an explicit `stackName` (TypeScript) or `stack_name` (Python) in your stack definition to enforce kebab-case.
|
|
|
|
```typescript
|
|
new MyStack(app, 'MyStack', {
|
|
stackName: 'my-stack',
|
|
});
|
|
```
|
|
|
|
## Examples
|
|
|
|
| Bad | Good | Why |
|
|
|---|---|---|
|
|
| `ExpenseApprovalBot` | `expense-approval-bot` | PascalCase |
|
|
| `expense_approval_bot` | `expense-approval-bot` | snake_case |
|
|
| `expenseApprovalBot` | `expense-approval-bot` | camelCase |
|
|
| `Expense-Approval-Bot` | `expense-approval-bot` | Mixed case |
|
|
| `feature/AddParser` | `feature/add-parser` | PascalCase in branch |
|
|
|
|
## Legacy Stacks
|
|
|
|
A handful of stacks predate this convention and remain PascalCase because renaming would require stack replacement (data loss, deploy windows). Examples in active use:
|
|
|
|
- `SeaHavenDoorUnlockStack`
|
|
- `WorkorderIngestStack`
|
|
|
|
Do not rename these solely to enforce kebab-case if doing so means tearing down and recreating production resources. New stacks must follow the convention; legacy stacks may keep their names until a planned migration brings them in line.
|