# AWS Resource Naming Conventions
Below is a practical, opinionated "cheat-sheet" for AWS resource naming conventions.
## 1. Universal naming-pattern template
----<Service/Component>--
| Element | Examples | Typical length |
|---|---|---|
| `<Org>` | acme, nasa, dev-team-a | 2–10 |
| `<Proj>` | webshop, data-lake, iot | 3–12 |
| `<Env>` | dev, qa, stg, prod | <=5 |
| `<Region>` | us-east-1, eu-central-1 | 7–11 |
| `<Service/Component>` | ec2, s3, eks, rds, sns | 2–10 |
| `<ResourceType>` | inst, bucket, nodegrp, subnet | 2–12 |
| `<FreeForm>` | 001, john, blue, backend | 1–20 |
**Guidelines**
• Use kebab-case (`-`) to separate logical parts.
• Keep the whole thing ≤ 64 chars unless the service demands otherwise.
• Avoid dots (`.`) in anything that might become a DNS label (S3 buckets, VPCs, etc.).
• Avoid uppercase if the service is case-sensitive (many are).
## 2. Global AWS character & length rules
| Always Allowed | Sometimes Allowed | Usually Forbidden |
|---|---|---|
| a-z 0-9 | uppercase A-Z (many services convert to lowercase) | spaces |
| hyphen (-) | underscore (_) | special symbols `!@#$%^&*()` |
| period (.) | forward-slash (/) (mostly IAM-only) | consecutive `..` or `--` |
| length 1–64 | length 1–255 (larger services like SSM docs) | names starting with aws– |
## 3. Appendix – per-service specifics (A→Z)
### A – C (27 services)
| Service | Resource Examples | Extra Rules / Tips |
|---|---|---|
| Alexa for Business | skill, room | 1–50, alphanum + hyphen, no spaces |
| Amplify | app, env, domain | 1–255, lowercase only |
| API Gateway | rest-api, stage, usage-plan | 1–128, alphanum + dash + underscore |
| AppConfig | application, env, conf-profile | 1–64 |
| AppFlow | flow | 1–256, no spaces |
| AppMesh | mesh, virtual-node, virtual-router | 1–255, must be RFC 1035 label (a-z0-9-), start/end with alphanum |
| AppRunner | service | 4–40, lowercase, a-z0-9 |
| AppStream 2.0 | fleet, stack | 1–100, no spaces |
| AppSync | api, data-source | 1–1024, no spaces |
| Athena | workgroup, data-catalog | 1–128, no spaces |
| Audit Manager | assessment | 1–300, no special chars |
| Auto Scaling | asg, lifecycle-hook | 1–255; no forward slash |
| Backup | vault, plan | 2–50, lower alphanum + hyphen |
| Batch | job-queue, comp-env | 1–128, no spaces |
| Billing & Cost Mgmt | cost-cat | follows tags (128 UTF-8 max) |
| Braket | quantum-job | 1–64 |
| Certificate Manager (ACM) | cert tag key/value | tag key ≤128, value ≤256 |
| Chatbot | slack-channel-config | 1–256, no spaces |
| Cloud9 | env | 1–128, no spaces |
| CloudDirectory | schema | 1–35 |
| CloudFormation | stack | 1–128, alphanum + hyphen, must start with letter |
| CloudFront | distribution | autogenerated ID, **BUT** you name Cache-Policies (max 128) |
| CloudHSM | hsm-cluster | 1–32, alphanum + hyphen |
| CloudSearch | domain | 3–28, lowercase letters + numbers only, must start with letter |
| CloudTrail | trail | 3–128, must start with letter, alpha-numeric, hyphen |
| CloudWatch | log-group, alarm | 1–512, allowed `/ : . - _` ; cannot start with `/` |
| CodeArtifact | domain, repo | 2–50, lowercase, alphanum + hyphen |
| CodeBuild | project | 1–255, no spaces |
| CodeCommit | repo | 1–100, no spaces, must not end with `.git` |
| CodeDeploy | app, deployment-group | 1–100, no spaces, alphanum + ./@_ |
| CodeGuru | profiler-group | 1–64, alphanum + hyphen |
| CodePipeline | pipeline | 1–100 |
| CodeStar | project | 2–12, lower alphanum |
| Comprehend | flywheel, dataset | 1–256 |
| Config | recorder, rule, aggregator | 1–256, no spaces |
| Connect | instance alias | 1–62, lower alphanum + hyphen |
| Control Tower | landing-zone name | 1–32, no spaces |
### D – F (34 services)
| Service | Resource Examples | Extra Rules / Tips |
|---|---|---|
| DataBrew | recipe, job | 1–255 |
| DataExchange | data-set, revision | 1–128, no spaces |
| DataPipeline | pipeline | 1–1024 |
| DataSync | task, agent | 1–256 |
| Detective | graph | 1–256 |
| DevOps Guru | insight, notification-channel | 1–128 |
| Device Farm | project, device-pool | 1–256 |
| Direct Connect | dx-connection name | 1–100, no colons |
| Directory Service | directory alias | 1–62, lower alphanum + hyphen |
| DMS (Database Migration Service) | replication-task | 1–255, no spaces |
| DocDB | cluster, instance | 1–63, lowercase, letters/nums/hyphen, must start with letter |
| DynamoDB | table | 3–255, `A-Z a-z 0-9 _ - . /` allowed |
| EBS | snapshot description | 1–255 UTF-8 |
| EC2 | instance name tag | tag key ≤128, value ≤256 |
| ECR | repo | 2–256, lowercase, separators `/` (for namespaces) |
| ECS | cluster, service, task-def | 1–255, no spaces |
| EFS | file-system tag name | same as tags |
| EKS | cluster | 1–100, lower a-z0-9A-Z, hyphen, underscore |
| ElastiCache | cluster | 1–20, lowercase letters + numbers, hyphen (no consecutive) |
| Elastic Beanstalk | app, env | 4–40, alphanum + hyphen, must start with letter |
| Elastic Inference | ei-endpoint | 1–255 |
| ElasticSearch / OpenSearch | domain | 3–28, lowercase letters/numbers, must start with letter |
| Elemental Media* (all) | channel/input | 1–100, no spaces |
| EMR | cluster | 1–256 |
| EventBridge | event-bus, rule | 1–256, no spaces |
| FinSpace | env | 1–100 |
| Firehose | delivery-stream | 1–64, alphanum + `_-.` |
| Forecast | dataset-group | 1–63, no spaces |
| Fraud Detector | detector, entity-type | 1–64, alphanum + underscore |
| FSx | file-system | 1–256 |
| FIS (Fault Injection Simulator) | experiment-template | 1–64 |
| Fusion (Amazon AppFlow + Honeycode) | integration | 1–80 |
### G – L (27 services)
| Service | Resource Examples | Extra Rules / Tips |
|---|---|---|
| GameLift | fleet | 1–1024 |
| Global Accelerator | ga-accelerator | 1–64, no spaces |
| Glue | job, database | 1–255, pattern `^[A-Za-z0-9_\.]+$` |
| Ground Station | config | 1–256 |
| GuardDuty | detector | autogenerated, but filters 1–64 |
| HealthLake | datastore | 1–32, lowercase |
| IAM | user, role, policy | 1–128, alphanum + `+=,.@-`, no spaces |
| Image Builder | image-pipeline | 3–128 |
| Inspector | assessment-template | 1–300 |
| IoT Core | thing, topic-rule | 1–128, no spaces |
| IoT Greengrass | core-device, component | 1–128 |
| IVS | channel | 1–128 |
| Kendra | index, data-source | 1–100, no spaces |
| Keyspaces (Cassandra) | keyspace, table | 3–48, lowercase a-z0-9_ (must start with letter) |
| Kinesis Data Streams | stream | 1–128, no spaces |
| Kinesis Data Firehose | see Firehose above |
| KMS | key-alias | `alias/<1–256>`, no spaces |
| Lake Formation | data-location | same as S3 path rules |
| Lambda | function | 1–64, `^[a-zA-Z0-9-_]+$` |
| Lex | bot, alias | 2–50, alphanum + hyphen |
| License Manager | license-configuration | 1–256 |
| Lightsail | instance | 2–255, lowercase alphanum + hyphen, must start/end with alphanum |
| Location Service | tracker, place-index | 1–100, lowercase, alphanum + hyphen |
| Lookout for Metrics | alert | 1–63, no spaces |
| Lookout for Vision | project | 1–63 |
| Lustre (FSx) | file-system | inherit FSx rules |
### M – P (29 services)
| Service | Resource Examples | Extra Rules / Tips |
|---|---|---|
| Macie | session, classification-job | 1–128 |
| Managed Blockchain | network, member | 1–32, lowercase, no spaces |
| Managed Grafana | workspace | 1–255 |
| Managed Prometheus (AMP) | workspace | 1–255 |
| MemoryDB | cluster | 1–40, lowercase, letters/numbers/hyphen |
| Migration Hub | app-portfolio | 1–256 |
| MQ (ActiveMQ/RabbitMQ) | broker | 1–249, no spaces |
| MSK (Kafka) | cluster | 1–64, lowercase |
| MTurk | hit-type | 1–128, no spaces |
| Neptune | cluster | 1–63, lowercase, letters/numbers/hyphen |
| Network Firewall | firewall-policy | 1–128 |
| OpsWorks | stack, layer | 1–255 |
| Organizations | account name | 1–50, no leading/trailing spaces, allowed `+-.@_` |
| Outposts | outpost | 1–255, no spaces |
| Panorama | app-instance | 1–255 |
| Personalize | dataset-group | 1–63, no spaces |
| Pinpoint | app | 1–64 |
| Polly | lexicon name | 1–20, alphanum + underscore |
| Proton | service, env | 1–100, lower alphanum + hyphen |
| QLDB | ledger | 1–32, lowercase, must start with letter |
| QuickSight | dataset, user | 1–256, no spaces |
| RAM (Resource Access Manager) | resource-share | 1–255 |
| RDS | db-instance | 1–63, lowercase, letters/numbers/hyphen, must start with letter |
| Redshift | cluster | 1–63, lowercase, letters/numbers/hyphen |
| Rekognition | collection | 1–255 |
| Resilience Hub | app | 1–256 |
| RoboMaker | simulation-app | 1–255 |
| Route 53 | hosted-zone | FQDN rules (RFC 1123), max 255 |
| Route 53 Resolver | rule | 1–64, no spaces |
### S – Z (the rest!)
| Service | Resource Examples | Extra Rules / Tips |
|---|---|---|
| S3 | bucket | 3–63, lowercase letters/numbers, periods, hyphens, must be DNS-compliant, no uppercase, no `_` |
| S3 Glacier | vault | 1–255, no slash |
| SageMaker | model, endpoint | 1–63, alphanum + hyphen |
| Secrets Manager | secret name | 1–512, can include `/` for path |
| Security Hub | findings aggregator | 1–256 |
| Service Catalog | product | 1–8191 (!), no `<>"%&\{}|^[]` etc. |
| Service Quotas | template | 1–256 |
| SES | config-set, template | 1–64 |
| Shield | protection group | 1–64 |
| Signer | signing-profile | 2–64, alphanum + `_` |
| SNS | topic | 1–256, alpha-numeric + `_ . -` (no spaces) |
| SQS | queue | 1–80 (FIFO adds `.fifo`), alphanum + `_ . -` |
| Step Functions | state machine | 1–80, `^[\.\-a-zA-Z0-9]+$` |
| Storage Gateway | gateway | 2–255 |
| STS | role-session-name | 2–64, no leading `aws` |
| SWF | domain | 1–256, no colons |
| Systems Manager (SSM) | parameter | 1–2048, path-style `/foo/bar`, no spaces |
| Textract | adapter | 1–128 |
| Timestream | database, table | 3–64, alphanum + `_` |
| Transfer Family | server | 3–100, no spaces |
| Translate | terminology | 1–256 |
| TrustAdvisor | check-name | controlled by AWS |
| VPC | vpc-id is generated; for Name tag follow template |
| Vendor Insights | profile | 1–64 |
| Verified Permissions | policy-store | 1–128 |
| Vertex (IoT) | topic | 1–128 |
| WAFv2 | web-acl, rule-group | 1–128, no spaces |
| WorkDocs | org-name | 1–64 |
| WorkMail | org-name, domain | 1–64, lowercase letters/numbers/hyphen |
| WorkSpaces | directory-alias | 1–62, lower alphanum + hyphen |
| X-Ray | group, sampling-rule | 1–128, no spaces |
| Zero Trust (Zelkova / IAM) | policy names follow IAM rules |
| Zonal Shift | shift-event | 1–128 |
## 4. Examples for Common AWS Services
For our examples, let's assume:
* **Organization (`<Org>`):** `acme`
* **Project (`<Proj>`):** `webshop`
* **Environment (`<Env>`):** `prod`
* **Region (`<Region>`):** `us-east-1`
### Universal Template (for reference)
acme-webshop-prod-us-east-1-<Service/Component>--
### EC2 Examples
| Resource Type | Full Example Name | Notes |
|---|---|---|
| EC2 Instance | `acme-webshop-prod-us-east-1-webserver-inst-001` | This is for the `Name` tag. |
| | `acme-webshop-prod-us-east-1-bastion-inst-001` | A bastion host for secure administrative access. |
| Security Group | `acme-webshop-prod-us-east-1-webserver-sg` | The SG for web servers, allowing HTTP/S traffic. |
| | `acme-webshop-prod-us-east-1-rds-mysql-sg` | SG for the RDS database, allowing port 3306. |
| | `acme-webshop-prod-us-east-1-bastion-sg` | SG for the bastion host, allowing SSH. |
| Elastic Network Interface | `acme-webshop-prod-us-east-1-eni-nat-gateway-az1` | Name tag for the ENI used by a NAT Gateway. |
| | `acme-webshop-prod-us-east-1-eni-rds-primary` | Name tag for the ENI attached to the primary RDS instance. |
### Lambda Examples
| Resource Type | Full Example Name | Notes |
|---|---|---|
| Lambda Function | `acme-webshop-prod-us-east-1-orders-lambda-process` | Component is `orders` (the service), freeform is `process`. |
| | `acme-webshop-dev-us-east-1-users-lambda-auth` | A `dev` environment example for a user authentication function. |
| IAM Role | `acme-webshop-prod-lambda-orders-role` | The role is *for* the `orders` Lambda function. |
| | `acme-webshop-prod-ec2-webserver-role` | The IAM Role attached to the EC2 web server instances. |
### EventBridge Examples
| Resource Type | Full Example Name | Notes |
|---|---|---|
| EventBridge Bus | `acme-webshop-prod-us-east-1-orders-bus` | A custom event bus for all events related to the `orders` domain. |
| EventBridge Rule | `acme-webshop-prod-us-east-1-order-created-rule` | The rule name describes the event it's listening for. |
| | `acme-webshop-prod-us-east-1-nightly-report-rule` | A scheduled (cron) rule that runs a report nightly. |
### ENI (Elastic Network Interface) Examples
| Resource Type | Full Example Name | Notes |
|---|---|---|
| ENI | `acme-webshop-prod-us-east-1-eni-nat-gateway-az1` | Name tag for NAT Gateway ENI. |
| | `acme-webshop-prod-us-east-1-eni-rds-primary` | Name tag for primary RDS ENI. |
| | `acme-webshop-prod-us-east-1-eni-eks-node` | Name tag for EKS node ENI. |
### IGW (Internet Gateway) Examples
| Resource Type | Full Example Name | Notes |
|---|---|---|
| Internet Gateway | `acme-webshop-prod-us-east-1-igw` | Standard name for the VPC's internet gateway. |
| | `acme-webshop-prod-us-east-1-dr-igw` | If you have multiple VPCs (like a DR environment), you can add that to the component. |
### Other Common Services
| Service | Example Name | Notes |
|---|---|---|
| S3 Bucket | `acme-webshop-prod-us-east-1-customer-uploads` | **Lowercase only**, globally unique. |
| | `acme-webshop-prod-us-east-1-static-assets` | For hosting website assets. |
| DynamoDB Table | `acme-webshop-prod-us-east-1-orders-table` | Unique per account/region. |
| | `acme-webshop-prod-us-east-1-users-table` | |
| VPC | `acme-webshop-prod-us-east-1-vpc` | The central network. |
| Subnet | `acme-webshop-prod-us-east-1-subnet-public-az1` | Public subnet in AZ1. |
| | `acme-webshop-prod-us-east-1-subnet-private-db-az2` | Private subnet for databases in AZ2. |
| NAT Gateway | `acme-webshop-prod-us-east-1-natgw-az1` | Component = `natgw`, resource type is implied. |
| RDS Instance | `acme-webshop-prod-us-east-1-mysql-db` | Service = `rds` implied, resource type = `db`. |
| CloudFront Distribution | `acme-webshop-prod-us-east-1-cdn` | Component = `cdn`, resource type is implied. |
## Key Takeaways
1. **Consistency is Key:** Apply the same pattern everywhere for easy resource identification.
2. **The "Component" part is flexible:** It describes the *workload* (e.g., `webserver`, `orders`, `rds-mysql`).
3. **The "FreeForm" part adds specifics:** Use it for numbering (`-001`), availability zones (`-az1`), or clarifying actions (`-process`).
4. **Adapt for Constraints:** For services with shorter name limits, you may need to drop less critical parts.
5. **Tags vs. Names:** For resources like EC2 Instances, the "name" you see is a `Name` tag. The naming convention applies to the tag value.
Remember to check the service-specific rules in the appendix section if you need to name resources that have special constraints.