2017-03-21 3 views
0

Ich versuche, eine Cloud-Formationsvorlage für eine Dynamo-DB-Tabelle zu erstellen, die ich erstellen möchte. Ich möchte die folgenden Felder in der Tabelle: GUID, UniqueID, Service.Unique Key als Array Cloud-Formationsvorlage AWS

Wie kann ich die GUID und Service einen Primärschlüssel, der ein Array ist.

hier ist was ich

{ 
    "AWSTemplateFormatVersion": "2010-09-09", 
    "Parameters": { 
    "UsersUniqueIdsTableName": { 
     "Description": "Table name to use", 
     "Type": "String", 
     "Default": "test-db-user-unique-ids" 
    }, 
    "UniqueIdsReadCapacityUnits": { 
     "Description": "Provisioned read throughput", 
     "Type": "Number", 
     "Default": "1", 
     "MinValue": "1", 
     "MaxValue": "10000", 
     "ConstraintDescription": "must be between 1 and 10000" 
    }, 
    "UniqueIdsWriteCapacityUnits": { 
     "Description": "Provisioned write throughput", 
     "Type": "Number", 
     "Default": "1", 
     "MinValue": "1", 
     "MaxValue": "10000", 
     "ConstraintDescription": "must be between 1 and 10000" 
    } 
    }, 
    "Resources": { 
    "marvelUsers": { 
     "Type": "AWS::DynamoDB::Table", 
     "Properties": { 
     "TableName": { 
      "Ref": "UsersUniqueIdsTableName" 
     }, 
     "AttributeDefinitions": [ 
      { 
      "AttributeName": "guid", 
      "AttributeType": "S" 
      }, 
      { 
      "AttributeName": "service", 
      "AttributeType": "S" 
      }, 
      { 
      "AttributeName": "uniqueid", 
      "AttributeType": "S" 
      } 
     ], 
     "KeySchema": [ 
      { 
      "AttributeName": "guid", 
      "KeyType": "HASH" 
      } 
     ], 
     "GlobalSecondaryIndexes": [ 
      { 
      "IndexName": "unique", 
      "KeySchema": [ 
       { 
       "AttributeName": "reminder_day", 
       "KeyType": "HASH" 
       } 
      ], 
      "Projection": { 
       "ProjectionType": "ALL" 
      }, 
      "ProvisionedThroughput": { 
       "ReadCapacityUnits": { 
       "Ref": "UniqueIdsReadCapacityUnits" 
       }, 
       "WriteCapacityUnits": { 
       "Ref": "UniqueIdsWriteCapacityUnits" 
       } 
      } 
      } 
     ], 
     "ProvisionedThroughput": { 
      "ReadCapacityUnits": { 
      "Ref": "UniqueIdsReadCapacityUnits" 
      }, 
      "WriteCapacityUnits": { 
      "Ref": "UniqueIdsUsersWriteCapacityUnits" 
      } 
     } 
     } 
    } 
    } 
} 

Antwort

0

DynamoDB Partition oder Sortierschlüssel sollten skalaren Datentyp (d String, Zahl, Boolean usw.) sein. Die Dokumentdatentypen wie map, list, set können nicht Teil des Schlüsselattributs sein.

Verwandte Themen