### Pattern Breakdown
| Element | Examples | Length | Notes |
|------------------|------------------------|---------|--------------------------------|
| `<Org>` | `acme`, `nasa` | 2-10 | Company/team abbreviation |
| `<Proj>` | `webshop`, `data-lake` | 3-12 | Project identifier |
| `<Env>` | `dev`, `prod` | ≤5 | Environment |
| `<Region>` | `us-east-1` | 7-11 | AWS region |
| `<Service>` | `ec2`, `lambda` | 2-10 | AWS service |
| `<ResourceType>` | `inst`, `sg` | 2-12 | Resource type |
| `<FreeForm>` | `001`, `backend` | 1-20 | Additional context |
**Rules:**
- Use kebab-case (`-` separators)
- Max 64 chars unless service requires shorter
- Avoid uppercase in case-sensitive services
- No special chars except `-_.` where allowed
## Common Resource Examples
### Networking
| Service | Resource Type | Example Name |
|---------------|---------------------|---------------------------------------------------|
| VPC | `vpc` | `acme-webshop-prod-us-east-1-vpc` |
| Subnet | `subnet` | `acme-webshop-prod-us-east-1-subnet-public-az1` |
| IGW | `igw` | `acme-webshop-prod-us-east-1-igw` |
| ENI (Name tag)| `eni` | `acme-webshop-prod-us-east-1-eni-nat-gateway-az1` |
| Route Table | `rtb` | `acme-webshop-prod-us-east-1-rtb-public` |
### Compute
| Service | Resource Type | Example Name |
|---------------|---------------------|---------------------------------------------------|
| EC2 (Name tag)| `inst` | `acme-webshop-prod-us-east-1-webserver-inst-001` |
| Lambda | `lambda` | `acme-webshop-prod-us-east-1-orders-lambda-process` |
| ECS | `cluster` | `acme-webshop-prod-us-east-1-ecs-cluster` |
| Security Group| `sg` | `acme-webshop-prod-us-east-1-webserver-sg` |
### Event-Driven
| Service | Resource Type | Example Name |
|---------------|---------------------|---------------------------------------------------|
| EventBridge | `rule` | `acme-webshop-prod-us-east-1-order-created-rule` |
| SQS | `queue` | `acme-webshop-prod-order-processing-queue` |
| SNS | `topic` | `acme-webshop-prod-user-notifications-topic` |
### Storage
| Service | Resource Type | Example Name |
|---------------|---------------------|---------------------------------------------------|
| S3 | `bucket` | `acme-webshop-prod-us-east-1-customer-uploads` |
| DynamoDB | `table` | `acme-webshop-prod-us-east-1-orders-table` |
| RDS | `instance` | `acme-webshop-prod-us-east-1-rds-mysql-001` |
### IAM
| Resource Type | Example Name |
|---------------|---------------------------------------------|
| Role | `acme-webshop-prod-lambda-orders-role` |
| Policy | `acme-webshop-prod-s3-readonly-policy` |
## Service-Specific Rules
### Critical Constraints
| Service | Special Rules |
|---------------|---------------------------------------------|
| **S3** | - 3-63 chars<br>- Lowercase only<br>- No underscores<br>- Globally unique |
| **IAM** | - 1-64 chars<br>- Alphanumeric + `=,.@-_` |
| **Lambda** | - 1-64 chars<br>- Alphanumeric + `-_` |
| **SQS** | - 1-80 chars (FIFO: + `.fifo` suffix) |
## Enforcement Recommendations
1. **Documentation**: Add this to your `CONTRIBUTING.md`
2. **Automation**:
```bash
# Example AWS CLI tag enforcement
aws ec2 create-tags --resources i-1234567890abcdef0 \
--tags Key=Name,Value="acme-webshop-dev-us-east-1-web-inst-001"
Infrastructure as Code:
hcl
# Terraform example
resource "aws_instance" "web" {
tags = {
Name = "${var.org}-${var.project}-${var.env}-${var.region}-web-inst-001"
}
}
Pro Tip: Use AWS Config rules to enforce naming conventions across your organization.
code
This MD document includes:
1. The universal pattern with a breakdown table
2. Real-world examples organized by service category
3. Critical service-specific constraints
4. Enforcement recommendations
5. Proper Markdown formatting for GitHub (tables, code blocks, etc.)
You can paste this directly into a GitHub repository's `.md` file and it will render beautifully. The kebab-case examples and clear structure make it easy for teams to adopt.