

キースキーマをhash+rengeにしたい場合、どう書くのが正しいのでしょう？

* * *

### 起こったエラー

[code]

    1 validation error detected: Value 'RENGE' at 'keySchema.
    2.member.keyType' failed to satisfy constraint: Member must satisfy enum value set: [HASH, RANGE] (Service: AmazonDynamoDBv2;
    Status Code: 400; Error Code: ValidationException; Request ID: L6GDTPVEFBAVKUOA4DR2LM9SHBVV4KQNSO5AEMVJF66Q9ASUAAJG)
    
[/code]

### 以下、dynamodbリソース作成コードのみ抜粋

[code]

    "DynamoDBTable":{
        "Type": "AWS::DynamoDB::Table",
        "Properties":{
            "TableName": {"Ref" : "DynamoDBTableName"},
            "BillingMode": "PAY_PER_REQUEST",
            "AttributeDefinitions":[
                {
                    "AttributeName": "Id",
                    "AttributeType": "S"
                },
                {
                    "AttributeName": "Time",
                    "AttributeType": "N"
                }
            ],
            "KeySchema":[
                {
                    "AttributeName": "Id",
                    "KeyType": "HASH"
                },
                {
                    "AttributeName": "Time",
                    "KeyType": "RENGE"
                }
            ],
            "Tags":[
                {
                    "Key": "Name",
                    "Value": {"Ref" : "DynamoDBTableName"}
                }
            ]
        }
    },
    
[/code]


CC BY-SA 4.0
2020-07-26T23:52:46.647
68998
2020-07-27T00:39:38.707
2020-07-27T00:02:49.880
3060
36855
question
aws aws-lambda aws-cloudformation
cloudfomationでdynamodbのhash+rengeの属性のテーブル作りたいがエラーが出る。


綴りミスが原因で、RENGE ではなく RANGE でした。

[code]

    "DynamoDBTable":{
        "Type": "AWS::DynamoDB::Table",
        "Properties":{
            "TableName": {"Ref" : "DynamoDBTableName"},
            "BillingMode": "PAY_PER_REQUEST",
            "AttributeDefinitions":[
                {
                    "AttributeName": "Id",
                    "AttributeType": "S"
                },
                {
                    "AttributeName": "Time",
                    "AttributeType": "N"
                }
            ],
            "KeySchema":[
                {
                    "AttributeName": "Id",
                    "KeyType": "HASH"
                },
                {
                    "AttributeName": "Time",
                    "KeyType": "RANGE"
                }
            ],
            "Tags":[
                {
                    "Key": "Name",
                    "Value": {"Ref" : "DynamoDBTableName"}
                }
            ]
        }
    },
    
[/code]


CC BY-SA 4.0
2020-07-27T00:34:41.157
68999
2020-07-27T00:39:38.707
2020-07-27T00:39:38.707
3060
36855
68998
answer