簡體   English   中英

唯一密鑰作為陣列雲形成模板AWS

[英]Unique Key as array cloud formation template AWS

我正在嘗試為我要創建的發電機數據庫表創建雲形成模板。 我想要表中的以下字段:guid,uniqueid,service。

我怎樣才能使GUID和服務的主鍵是一個數組。

這就是我所擁有的

{
  "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"
          }
        }
      }
    }
  }
}

Dynamodb分區或排序鍵應為標量數據類型(即字符串,數字,布爾值等)。 映射,列表,集合等文檔數據類型不能作為鍵屬性的一部分。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM