engineering-handbook/confluence/01-naming-conventions.md

44 lines
1.4 KiB
Markdown
Raw Normal View History

# Naming Conventions
## The rule
Use kebab-case for everything: lowercase words separated by hyphens. Do not use `snake_case`, `PascalCase`, `camelCase`, or mixed styles.
## Where it applies
| Resource | Example |
|---|---|
| Repository | `expense-approval-bot` |
| Stack or workspace name | `expense-approval-bot` (matches the repo name) |
| Lambda function | `expense-approval-bot-process-receipt` |
| DynamoDB table | `expense-approval-bot-receipts` |
| S3 bucket | `expense-approval-bot-uploads` |
| Secrets Manager secret | `expense-approval-bot/slack-signing` |
| Branch | `feature/add-receipt-parser` |
| Workflow file | `deploy-api.yaml` |
Resource names start with the repo or stack name so ownership is obvious.
## Examples
| Bad | Good | Why |
|---|---|---|
| `ExpenseApprovalBot` | `expense-approval-bot` | PascalCase |
| `expense_approval_bot` | `expense-approval-bot` | snake_case |
| `expenseApprovalBot` | `expense-approval-bot` | camelCase |
| `feature/AddParser` | `feature/add-parser` | PascalCase in branch |
## Existing names
A few older resources do not follow this convention. Leave them as they are: renaming them would force a rebuild of production resources. Everything new must use kebab-case.
## CDK note
CDK generates PascalCase stack names by default. Always set `stackName` explicitly:
```typescript
new MyStack(app, 'MyStack', {
stackName: 'my-stack',
});
```