Environment names should be longest in your lowest environment
2026-Jan-05 • by David Norton
When starting a project, we don't always put a lot of thought into our environment names. Perhaps we start with dev and prod. This results in resource names like book-service-dev and book-service-prod. Easy enough, right? Your declarative infrastructure will automatically insert the environment name into the appropriate resources.
However, many cloud platforms impose character limits on resource names. For example, on AWS, S3 bucket names are limited to 63 characters, Lambda function names to 64, and CloudFormation stack names to 128. When you start with short names in development, you might not notice these limits until you're deploying to production. By then, changing it becomes a migration headache.
Instead, use the longest environment name in your lowest environment. For example: book-service-development, book-service-staging, book-service-production. This way, if your resource names fit in development, they'll definitely fit in production. You're testing against the longest possible name from the start.
Additionally, sometimes you have pseudo-environments that may not exist in lower environments, like prod-pci-us-west-2. A resource name pattern that fits in development may not fit in production. Now you need an optional name override, and you have additional headaches. One of our clients ended up in a similar situation with a Kubernetes cluster. Our solution to prevent further headaches was to create an artificially long "development-long" cluster name, forcing it to be longer than the production cluster name.
Start with the longest environment name in your lowest environment. Your future self will thank you when deploying to production without hitting unexpected character limits. Or even better—your future self won't even think about this problem again after solving it from the beginning.
Shameless plug: If you need help with public cloud, declarative infrastructure, or naming conventions specifically -- Platformers can probably help. Please reach out today!
Author's note: Cursor's Tab Completion came up with "naming conventions specifically" in the paragraph above. It was too good not to leave in.