---
AWSTemplateFormatVersion: "2010-09-09"
Resources:
  dynamoDBTable:
    Type: AWS::DynamoDB::Table
    Properties:
      AttributeDefinitions:
        - AttributeName: "Album"
          AttributeType: "S"
        - AttributeName: "Artist"
          AttributeType: "S"
        - AttributeName: "Sales"
          AttributeType: "N"
      KeySchema:
        - AttributeName: "Album"
          KeyType: "HASH"
        - AttributeName: "Artist"
          KeyType: "RANGE"
      ProvisionedThroughput:
        ReadCapacityUnits: 5
        WriteCapacityUnits: 5
      GlobalSecondaryIndexes:
        - IndexName: "myGSI"
          KeySchema:
            - AttributeName: "Artist"
              KeyType: "HASH"
            - AttributeName: "Album"
              KeyType: "RANGE"
          Projection:
            NonKeyAttributes:
              - "Sales"
            ProjectionType: "INCLUDE"
          ProvisionedThroughput:
            ReadCapacityUnits: 5
            WriteCapacityUnits: 5
