aws-cloudformation / cfn-lint

CloudFormation Linter
MIT No Attribution
2.4k stars 576 forks source link

v1.3.0 not recognizing Global Table KeySchema attributes (error E3002) #3336

Closed mtschneiders closed 2 weeks ago

mtschneiders commented 2 weeks ago

CloudFormation Lint Version

1.3.0

What operating system are you using?

Ubuntu

Describe the bug

Lint error E3002 is thrown for a valid Global table definition. Error message:

E3002 Additional properties are not allowed ('AttributeName' was unexpected) templates/test.yml:19:15

E3002 Additional properties are not allowed ('AttributeName' was unexpected) templates/test.yml:26:11

Expected behavior

No error should be raised.

Reproduction template

AWSTemplateFormatVersion: 2010-09-09
Resources:
  SomeTable:
    Type: AWS::DynamoDB::GlobalTable
    DeletionPolicy: Retain
    UpdateReplacePolicy: Retain
    Properties:
      AttributeDefinitions:
        - AttributeName: Id
          AttributeType: S
        - AttributeName: Type
          AttributeType: S
        - AttributeName: Name
          AttributeType: S
      BillingMode: PAY_PER_REQUEST
      GlobalSecondaryIndexes:
        - IndexName: Full-Index
          KeySchema:
            - AttributeName: Name
              KeyType: HASH
            - AttributeName: Id
              KeyType: RANGE
          Projection:
            ProjectionType: ALL
      KeySchema:
        - AttributeName: Id
          KeyType: HASH
        - AttributeName: Type
          KeyType: RANGE
      Replicas:
        - PointInTimeRecoverySpecification:
            PointInTimeRecoveryEnabled: true
          Region: us-west-2
          TableClass: STANDARD
      SSESpecification:
        SSEEnabled: true
        SSEType: KMS
      StreamSpecification: 
        StreamViewType: NEW_AND_OLD_IMAGES
      TableName: some-table