awslabs / amazon-documentdb-tools

Tools for use with the Amazon DocumentDB managed document database service.
Apache License 2.0
124 stars 59 forks source link

Update documentdb_index_tool.py to add optional index name shorten option #95

Closed gurubayari closed 10 months ago

gurubayari commented 10 months ago

Implemented an optional feature to shorten index names to 7 characters consisting of "i_" plus a 5 character random string. This addresses the index name (\<db>.\<col>.$\<index>) length requirement of 6-127 characters. Since fully qualified collection name can be up to 120 characters in the format \<db>.\<col>, index names need to be limited to 7 characters to meet the combined name length restriction.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

gurubayari commented 10 months ago

Added logic to shorten long Index name. Long index names are shortened to meet the limit and replace the last 5 characters with random string.