Resource Naming Convention
Introduction
Establishing consistent and well-defined naming conventions is critical for maintaining clarity, organization, and effective management of AWS resources. A solid naming strategy ensures:- Easy identification and management of resources.
- Proper cost allocation.
- Compliance with regulatory requirements.
Key Considerations
Document Your Convention
- Create a clear guide that outlines naming standards and tag usage.
- Share this guide with your team to ensure consistent application.
- Maintain version control to track changes and provide historical context.
Maintain Consistency
- Apply naming conventions uniformly across all AWS resources.
- Use tools like Service Control Policies (SCPs) and Tag Policies to enforce standards.
Practical Guidelines
Abbreviations
- Standardize Abbreviations: Ensure all abbreviations are documented and understood.
- Use unique identifiers (e.g., timestamps or sequence numbers) to prevent duplication.
- Avoid ambiguous abbreviations to reduce confusion.
Leverage Constraints
- Follow service-specific naming rules, such as character limits and allowed symbols.
-
Use prefixes (e.g.,
aws:
) to protect tags and add clarity.
Be Descriptive
-
Choose names that clearly indicate the resource’s function or purpose (e.g.,
finance-sql-prod
). -
Avoid generic names like
server-1
orbucket-2
.
Hierarchical Organization
-
Reflect relationships between resources using hierarchical structures.
- Example:
appname-resourcetype-env
- Example:
-
Include versioning or timestamps for tracking (e.g.,
app-v1-prod
).
Avoid Redundancies
-
Skip obvious repetitions in names where the context is already clear.
- Example: Avoid
ec2-instance-instance-prod
.
- Example: Avoid
Readability Best Practices
- Use Lowercase Characters: AWS recommends lowercase names to avoid case sensitivity issues.
-
Hyphens or Underscores: Separate words with
-
or_
for clarity, depending on service constraints. - Avoid Special Characters: Refrain from using unsupported symbols or spaces.
Iteration and Flexibility
- Revise your naming conventions as needs evolve.
- Strike a balance between consistency and adaptability to future changes.
Examples
Simple Naming Example
- Basic:
prod-db-server
Advanced Naming Example
-
Complex:
{app}-{resource}-{team}-{environment}
- Example:
myapp-s3-storage-prod
- Example: