Naming Standards
Clear and consistent naming conventions are crucial for maintaining a scalable and manageable infrastructure codebase. These standards help ensure clarity, prevent conflicts, and make resources easily identifiable.
Repository Naming
Module Repositories
- Format:
terraform-{cloud}-{resource} - Purpose: Reusable infrastructure components
- Examples:
terraform-aws-eks-node-groupterraform-aws-rds-instanceterraform-gcp-kubernetes-cluster
Project Repositories
- Format:
tfp-{org}-{purpose} - Purpose: Complete infrastructure solutions
- Examples:
tfp-acme-data-platformtfp-acme-eks-prodtfp-acme-shared-services
Workspace Management Repositories
- Format:
tfw-{org}-{business-unit} - Purpose: Spacelift stack and variable management
- Examples:
tfw-acme-platform-teamtfw-acme-data-teamtfw-acme-shared-services
Branch Naming
Standard Branches
main- Production-ready codeqa- Quality assurance testingdev- Development and integration
Feature Branches
- Format:
feature/{ticket-number}-{brief-description} - Example:
feature/INFRA-123-add-backup-retention
Bugfix Branches
- Format:
bugfix/{ticket-number}-{brief-description} - Example:
bugfix/INFRA-456-fix-subnet-routing
Resource Naming
General Pattern
- Format:
{org}-{env}-{purpose}-{resource} - Examples:
acme-prod-app-eksacme-dev-shared-vpcacme-qa-data-rds
Environment Abbreviations
prod- Productionqa- Quality Assurancedev- Development
Variable Naming
Terraform Variables
- Use descriptive, lowercase names with underscores
- Format:
{resource}_{purpose}_{attribute} - Examples:
vpc_cidr_rangeeks_node_instance_typerds_backup_retention_days
Spacelift Variables
- Environment-specific:
{ENV}_{VARIABLE_NAME} - Global:
GLOBAL_{VARIABLE_NAME} - Examples:
PROD_AWS_ACCOUNT_IDDEV_VPC_CIDRGLOBAL_REGION
Best Practices
- Consistency
- Follow established patterns
- Use lowercase for repository names
- Use underscores for variable names
- Clarity
- Names should be self-descriptive
- Avoid abbreviations except for established standards
- Include purpose in resource names
- Organization
- Include organization identifier where appropriate
- Use environment indicators for environment-specific resources
- Follow business unit boundaries
- Maintainability
- Keep names concise but meaningful
- Document any deviations from standards
- Review naming conventions periodically