Feature request: Support multi-attribute composite keys in GSI with sam validate --lint
Describe your idea/feature/enhancement
AWS now supports GSIs with multi-attribute composite keys - https://aws.amazon.com/about-aws/whats-new/2025/11/amazon-dynamodb-multi-attribute-composite-keys-global-secondary-indexes/
Currently, sam validate --lint will fail as it expects a GSI to have a single HASH key. For example:
GlobalSecondaryIndexes:
- IndexName: myNewIndex
KeySchema:
- AttributeName: attributeA
KeyType: HASH
- AttributeName: attributeB
KeyType: HASH
- AttributeName: attributeC
KeyType: RANGE
Projection:
ProjectionType: ALL
Will fail with:
[[E3032: Check if a array has between min and max number of values specified] (expected maximum item count: 2, found: 3) matched 190, [E3002: Resource properties are invalid] ('RANGE' was expected) matched 194]
Error: Linting failed. At least one linting rule was matched to the provided template.
Proposal
Add details of how to add this to the product.
Things to consider:
- Will this require any updates to the SAM Spec
Additional Details
It seems like this is actually an issue in cfn-lint (which sam validate --lint) is running under the hood. When I ran the latest version of cfn-lint (1.42.0 as I write this) on a template with your snippet, it failed with the following message:
E3032 expected maximum item count: 2, found: 3
template.yaml:23:11
E3002 'RANGE' was expected
template.yaml:27:15
~I am going to transfer this issue to that repository.~ I can't transfer the issue, would you mind creating another one there @craigcorry?