separator
Character used to separate name components (default: hyphen for maximum compatibility)
Separator Options
The separator character joins the different components of your resource names. The default is a hyphen (-), which is the most widely compatible option.
Common Separators
| Separator | Example | Compatibility |
|---|---|---|
Hyphen - | prod-myapp-use1 | Universal |
Underscore _ | prod_myapp_use1 | Most services |
Period . | prod.myapp.use1 | Limited |
AWS Service Compatibility
Different AWS services have varying requirements for resource names:
| Service | Allowed Separators | Notes |
|---|---|---|
| S3 | -, . | No underscores |
| EC2 | -, _ | Hyphens preferred |
| Lambda | -, _ | Either works |
| RDS | - | Hyphens only |
| IAM | -, _ | Both supported |
Best Practices
- Use hyphens (
-) for maximum compatibility - Choose one separator and use it consistently
- Avoid changing separators after initial deployment
- Consider readability in AWS Console and CLI output
- Test separator choice with all target AWS services
Full Module Example
module "naming_convention" {
source = "registry.patterneddesigns.ca/standardnat/naming-convention/aws"
version = "0.1.0"
# separator
separator = "..."
# Other required inputs
environment = "..."
project = "..."
}