[AWS] Naming Conventions Best Practices

"Our true nationality is mankind." --H. G. Wells

AWS Naming Conventions Best Practices

A naming convention is a well-defined set of rules useful for choosing the name of an AWS resource. Ensure that your AWS resources are using appropriate naming conventions for tagging in order to manage them more efficiently and adhere to AWS resource tagging best practices.

Naming (tagging) your AWS resources consistently have several advantages such as providing additional information about the resource location and usage, promoting consistency within the selected AWS region, distinguishing fast similar resources stacks from one another, avoiding naming collisions, improving clarity in cases of potential ambiguity and enhancing aesthetic and professional appearance.


Default Pattern Components

Region Code

(us-east-1|us-west-1|us-west-2|eu-west-1|eu-central-1|ap-northeast-1|ap-northeast-2|ap-southeast-1|ap-southeast-2|sa-east-1) For us-east-1, us-west-1, us-west-2, eu-west-1, eu-central-1, ap-northeast-1, ap-northeast-2, ap-southeast-1, ap-southeast-2, sa-east-1.

Availability Zone Code

([1-2]{1})([a-c]{1}) (2a|2b|2c) for us-west-2a, us-west-2b, us-west-2c

Environment Code

(dev|test|stg|prod) For development, test, staging, production.

Application Code

([a-z0-9\-]+) For the application stack that runs within the VPC (e.g. bid-data-app-stack).

Subnet Route Code

(public|private) For public, private


VPC Naming Conventions

Default Pattern Format

vpc-RegionCode-EnvironmentCode-ApplicationStackCode

RegExp

^vpc-(us-east-1|us-west-1|us-west-2|eu-west-1|eu-central-1|ap-northeast-1|ap-northeast-2|ap-southeast-1|ap-southeast-2|sa-east-1)-(dev|test|stg|prod)-([a-z0-9\-]+)$

Examples

vpc-us-east-1-prod-big-data-app-stack
vpc-us-west-2-prod-web-app-stack


Subnet Naming Conventions

Default Pattern Format

subnet-RegionCode-AvailabilityZoneCode-SubnetRouteCode-EnvironmentCode-ApplicationStackCode

RegExp

^subnet-(us-east-1|us-west-1|us-west-2|eu-west-1|eu-central-1|ap-northeast-1|ap-northeast-2|ap-southeast-1|ap-southeast-2|sa-east-1)-([1-2]{1})([a-c]{1})-(public|private)-(dev|test|stg|prod)-([a-z0-9\-]+)$

Examples

subnet-us-east-1-2a-public-prod-web-app-stack
subnet-us-west-1-2b-private-prod-database-stack


EC2 Instance Naming Conventions

Default Pattern Format

ec2-RegionCode-AvailabilityZoneCode-EnvironmentCode-ApplicationCode

RegExp

^ec2-(us-east-1|us-west-1|us-west-2|eu-west-1|eu-central-1|ap-northeast-1|ap-northeast-2|ap-southeast-1|ap-southeast-2|sa-east-1)-([1-2]{1})([a-c]{1})-(dev|test|stg|prod)-([a-z0-9\-]+)$

Examples

ec2-us-east-1-2a-prod-tomcat
ec2-us-west-1-2b-prod-nodejs


PEM Key Naming Conventions

Default Pattern Format

RegionCode-EnvironmentCode-ApplicationCode

RegExp

^key-(us-east-1|us-west-1|us-west-2|eu-west-1|eu-central-1|ap-northeast-1|ap-northeast-2|ap-southeast-1|ap-southeast-2|sa-east-1)-(dev|test|stg|prod)-([a-z0-9\-]+)$

Examples

key-us-east-1-prod-web-server
key-us-west-1-prod-database


References