Naming Conventions
The purpose of this document is not for it to be adhered to by the letter, but to act as a guide which can be used to support the process of defining naming conventions as well as highlight the reason why you should set and follow them.
Placeholders
The following placeholders can be used to define a consistent naming convention.
Placeholder | Description | Example Value | Short Value |
---|---|---|---|
<org_name> |
Organisation that owns the resources | Capgemini Dunder Mifflin Paper Company Genco Pura Olive Oil Company |
cg dmpc genco |
<aws_account> |
AWS Account containing the resources As the name of an account must be a single word, I would recommend setting a value that combines <org_name> & <environment> However this may or may not be suitable depending on the hierarchy and set up of AWS Accounts |
Capgemini Production Account Dunder Mifflin Paper Company Network Account Genco Pura Olive Oil Company Development Account |
cg-prod dmpc-network genco-dev |
<region> |
AWS Region used | eu-west-1 eu-west-2 us-east-1 |
euw1 euw2 ue1 |
<availability_zone> |
AWS Availability Zone | eu-west-2a eu-west-2b eu-west-2c us-east-2a us-east-2b us-east-2c |
euw2a euw2b euw2c ue1a ue1b ue1c |
<aws_resource> |
AWS Resource abbreviation | VPC Subnet Route Table Network ACL Transfer Gateway Security Group EC2 Instance Auto Scaling Group ECS Cluster ECS Task EKS Cluster S3 Bucket KMS Key KMS Policy IAM Role IAM Policy |
vpc subnet rtb nacl tgw sg ec2 asg ecs-cluster ecs-task eks-cluster s3 kms kms-policy iam-role iam-policy |
<environment> |
The environment being used for the resources | Development Test Staging UAT Production Shared Services Sandbox |
dev test staging uat prod shared sandbox |
<business_unit> |
The business unit of the provisioned resources | Cloud Infrastructure Services | cis |
<team> |
The team owning the provisioned resources | Platform Engineering Warehouse Sales |
pe wh sales |
<resource_identifier> |
Free form used to describe the resource This could be the name of an application, the function, the client or a combination of all. |
||
<client> |
If applicable, the client for provisioned resources |
By using placeholders like above, prefixes can be specified for account level/wide resources, such as VPCs, subnets etc.
Prefixes can also be specified for application level resources, which are specific to particular applications/teams/clients, such as EC2 instances, ECS clusters or Lambda functions.
Naming prefixes
Type | Convention | Comment | Example |
---|---|---|---|
Account Naming Prefix | <org_name> -<environment> -<context> <aws_account> -<context> |
Account naming prefixes can follow their own structure, or they could begin with the account name, if AWS accounts have a different convention. <context> can be used if necessary, for example, if there are multiple VPCs within the same AWS account, this can be used to differentiate and describe each. |
cp-prod dmpc-network genco-dev |
Team Naming Prefix | <business_unit> -<team> -<environment> -<context> |
<context> can be used if necessary, for example this could be used to describe a service or sub division within a team. <business_unit> could be used in conjunction with <team> , for example cis-pe-prod <org_name> can be appended as a prefix |
cp-cis-pe-prod dmpc-wh-staging genco-sales-dev |
AWS Examples
Below are examples which can be used for inspiration.
Again, these are suggestions that be adapted for individual use cases. For example, you may chose to omit <region>
if you only deploy into a single region.
AWS Accounts
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
AWS Account Name | <org_name> -<environment> |
cg-prod dmpc-network genco-dev |
VPC Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
VPC | {{account_naming_prefix}}-<region>-<aws_resource> |
cg-prod-ue1-sharedservices-vpc dmpc-network-euw1-vpc genco-dev-vpc |
|
Subnets | {{account_naming_prefix}}-<region>-<availability_zone>-{{subnet_type}}-<aws_resource> |
{{subnet_type}} should describe the purpose of the subnet. For example, it could be one of:
<availability_zone> can also be used after <aws_resource> . The value of this could be a shortened version of the AWS availability zone, or just the letter for the availability zone. |
cg-prod-ue1-sharedservices-private-subnet-a dmpc-network-euw1b-public-subnet genco-dev-data-subnet-euw2c |
Route Tables | {{account_naming_prefix}}-<region>-{{route_type}}-<aws_resource> |
{{route_type}} should describe the purpose. It could be one of:
|
cg-prod-ue1-sharedservices-private-rt dmpc-network-public-rt genco-dev-private-rt |
Network ACL | {{account_naming_prefix}}-<region>-{{nacl_type}}-<aws_resource> |
{{nacl_type}} should describe the NACL. It could be one of
|
cg-prod-ue1-sharedservices-private-nacl dmpc-network-euw1-public-nacl genco-dev-private-nacl |
Transit Gateway | {{account_naming_prefix}}-<region>-<aws_resource> |
cg-prod-ue1-sharedservices-tgw dmpc-network-euw1-tgw genco-dev-tgw |
|
Transit Gateway Attachment | {{account_naming_prefix}}-<region>-<aws_resource> |
cg-prod-ue1-sharedservices-tgwa dmpc-network-euw1-tgw-att genco-dev-tga |
|
NAT Gateway | {{account_naming_prefix}}-<region>-<aws_resource> |
cg-prod-ue1-sharedservices-ngw dmpc-network-euw1-ngw genco-dev-ngw |
|
Endpoint | {{account_naming_prefix}}-<region>-{{endpoint_type}}-<aws_resource> |
{{endpoint_type}} should describe the endpoint type:
|
cg-prod-ue1-sharedservices-s3-endpoint dmpc-network-euw1-ec2-endpoint genco-dev-ssm-endpoint |
IAM Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
IAM User | Users:
Service Accounts:
Third Party Accounts:
|
Users: {{username}} can vary based upon how you authenticate users within AWS. You could adopt the first part of email addresses, or import users from third party access management tools, such as Okta or Active Directory Service Accounts: {{service_name}} should describe the service, for example: Third Party Accounts: {{client}} & {{identifier}} should be used to clearly define the user. For example: |
User: Service Account: Third Party Accounts: |
IAM Role | {{account_naming_prefix}}-{{role_purpose}}-<aws_resource> {{team_naming_prefix}}-{{role_purpose}}- <aws_resource> |
{{role_purpose}} should explain what the role is for: For {{team_naming_prefix}} the <context> can be used to describe a service/project/function |
Account naming:
Team naming:
|
IAM Group | {{account_naming_prefix}}-{{group_purpose}} | {{group_purpose}} should describe the group:
|
cg-prod-administrators dmpc-network-managers genco-dev-billing |
IAM Policy | {{account_naming_prefix}}-{{policy_purpose}}-<aws_resource> {{team_naming_prefix}}-{{policy_purpose}}- <aws_resource> |
{{policy_purpose}} should explain the purpose of the policy:
<policy_purpose> can also match the resource being used, or the naming of the role it will be attached to:
|
Account naming:
Team naming:
|
KMS | {{account_naming_prefix}}-{{kms_type}}-<aws_resource> {{team_naming_prefix}}-{{kms_type}}- <aws_resource> |
{{kms_type}} should reference the AWS resource the KMS key is for:
|
cg-prod-ue1-sharedservices-s3-kms-key cg-prod-ue1-sharedservices-s3-kms-policy dmpc-network-euw1-ebs-kms-key dmpc-network-euw1-ebs-kms-policy genco-dev-ecr-kms-key genco-dev-ecr-kms-policy |
SSL Certificate | {{naming_prefix}}-<resource_identifier> -{{product}}-{{cert_type}}-<aws_resource> |
{{product}} could describe where the certificate is used: {{cert_type}} should describe the certificate: <resource_identifier> should describe the function of the resource: It is also possible match the name of the certificate to the domain name e.g.: |
cg-prod-gitlab-alb-wildcard-cert dmpc-staging-orders-cloudfront-domain-sslcert genco-dev-reports-alb-domain-sslcert |
EC2 Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
Instances | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
Security Groups | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
Auto Scaling Groups | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
Elastic Load Balancers | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
Launch Configuration | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
AMI | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
Key Pairs | {{account_naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
cg-prod-ue1-gitlab-key-pair dmpc-network-staging-euw2-ec2-keypair genco-dev-reports-dashboard-kp |
AWS Serverless Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
Lambda | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource |
Account naming:
Team naming:
|
Step Functions | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
Account naming:
Team naming:
|
Container Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
ECS Cluster | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
ECS Task | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
ECR Repository | {{naming_prefix}}-<region> -<resource_identifier> -<aws_resource> |
<resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
EKS Cluster | {{naming_prefix}}-<region> -{{cluster_type}}-<aws_resource> |
{{cluster_type}} should describe cluster:
|
Account naming:
Team naming:
|
EKS Node | {{naming_prefix}}-<region> -{{cluster_type}}-{{node_type}}-<aws_resource> |
{{cluster_type}} should describe cluster the node belongs to:
{{node_type}} should describe the node purpose. This could reference a characteristic or a specific application:
|
Account naming:
Team naming:
|
S3 Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
S3 Bucket | {{naming_prefix}}-<region> -{{bucket_purpose}}-<aws_resource> |
{{bucket_purpose}} should describe the bucket function: |
cg-prod-ue1-logs-bucket cg-cis-pe-prod-ue1-deployment-bucket dmpc-network-staging-euw2-tfstate-bucket dmpc-wh-staging-euw2-dispatch-bucket genco-dev-cloudwatch-logs-bucket genco-sales-dev-monthlyreport-bucket |
S3 Bucket Policy | {{naming_prefix}}-<region> -{{bucket_purpose}}-<aws_resource> |
{{bucket_purpose}} should describe the bucket function: |
cg-prod-ue1-logs-bucket-policy cg-cis-pe-prod-ue1-deployment-bucket-policy dmpc-network-staging-euw2-tfstate-bucket-policy dmpc-wh-staging-euw2-dispatch-bucket-policy genco-dev-cloudwatch-logs-bucket-policy genco-sales-dev-monthlyreport-bucket-policy |
ElastiCache Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
ElastiCache | {{naming_prefix}}-<region> -<resource_identifier> -{{engine}}-{{deployment_type}}-<aws_resource> |
{{engine}} can be one of: {{deployment_type}} can be one of: {{db_resource}} can be one of: <resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
CloudWatch Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
CloudWatch Alarm | {{naming_prefix}}-<region> -<resource_identifier> -{{alarm_type}}-<aws_resource> |
{{alarm_type}} should describe the alarm: <resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
RDS Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
RDS Instance | {{naming_prefix}}-<region> -<resource_identifier> -{{db_engine}}-{{deployment_type}}-{{db_resource}} |
{{db_engine}} can be one of: {{deployment_type}} can be one of: {{db_resource}} can be one of: <resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
Parameter Group | {{naming_prefix}}-<region> -<resource_identifier> -{{db_engine}}-{{deployment_type}}-{{db_resource}}-<aws_resource> |
{{db_engine}} can be one of: {{deployment_type}} can be one of: {{db_resource}} can be one of: <resource_identifier> should describe the function of the resource: |
Account naming:
Team naming:
|
Secrets Resources
AWS Resource | Naming Convention | Comment | Example |
---|---|---|---|
Secrets Manager | <environment> /{{secret_type}} /<team> /<resource_identifier> /{{secret_name}} |
By using a tiered naming approach, you can better control access to secrets using IAM policies. For example, you could deny access within a policy by including prod/app/team/* ; alternatively, you could grant access to shared secrets by allowing access to prod/common/* |
prod/app/cis/pe/gitlab/database staging/wh/app/dispatch/rds dev/common/sharedcredential |
Parameter Store | <environment> /{{parameter_type}} /<team> /<resource_identifier> /{{parameter_name}} |
prod/app/cis/pe/gitlab/user staging/wh/app/dispatch/user dev/common/shareduser |