Question: Can colons and special characters be used in DynamoDB attributes?

Answered by Rafal Wilinski
Last updated: October 23rd, 2026
Answer
Yes. DynamoDB attribute names can contain colons, dots, spaces and other special characters. The restricted character list for table names does not apply to attribute names.
The catch is expression syntax. A dot normally separates document-path components, # introduces an attribute-name placeholder and : introduces a value placeholder. Use ExpressionAttributeNames to reference a literal name that would otherwise be ambiguous:
aws dynamodb get-item --table-name Products \ --key '{"pk":{"S":"product-123"}}' \ --projection-expression '#field' \ --expression-attribute-names '{"#field":"spec:color.primary"}'
Here the entire string spec:color.primary is one attribute name. To read a nested primary field inside a map instead, alias the individual path components and join the aliases with a dot.
The same technique handles reserved words and names that start with a digit. Placeholder names have their own syntax, so use simple aliases such as #field; do not copy punctuation from the actual name into the alias.
Prefer short, readable names when you control the schema, but there is no need to rename existing attributes merely because they contain punctuation. See naming conventions and the reserved-word checker.
Source: AWS expression attribute names.
Other Common DynamoDB FAQ (with Answers)
- How do you access DynamoDB from an Android app?
- Can you force-delete a DynamoDB table?
- Can you store lists in DynamoDB?
- How to count rows in DynamoDB?
- Is DynamoDB ACID compliant?
- Is DynamoDB PaaS or SaaS?
- Is DynamoDB HIPAA compliant?
- How do you mock DynamoDB in a test?
- Can DynamoDB store documents?
- Are DynamoDB table names unique?
- What are the key differences between DynamoDB and Elasticsearch?
- How is data stored in DynamoDB?
- Should you make a new DynamoDB client for each request?
- Is DynamoDB based on MongoDB?
- What are the naming conventions in DynamoDB?
Dynobase is a Professional GUI Client for DynamoDB
Start your 7-day free trial today