Skip to content

Feature request: Support multi-attribute composite keys in GSI with sam validate --lint #8463

@craigcorry

Description

@craigcorry

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:

  1. Will this require any updates to the SAM Spec

Additional Details

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/needs-triageAutomatically applied to new issues and PRs, indicating they haven't been looked at.type/featureFeature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions