Unknown parameter in input: "BillingMode"

0

My old DynamoDB script that works:

{
    "AttributeDefinitions": [
        {
            "AttributeName": "userId",
            "AttributeType": "S"
        }
    ],
    "TableName": "DEV_Users",
    "KeySchema": [
        {
            "AttributeName": "userId",
            "KeyType": "HASH"
        }
    ],
    "ProvisionedThroughput": {
        "ReadCapacityUnits": 1,
        "WriteCapacityUnits": 1
    }
}

My two attempts at updating this script to work for on-demand:

{
    "AttributeDefinitions": [
        {
            "AttributeName": "userId",
            "AttributeType": "S"
        }
    ],
    "TableName": "TEMP_Users",
    "KeySchema": [
        {
            "AttributeName": "userId",
            "KeyType": "HASH"
        }
    ],
    "BillingMode": "PAY_PER_REQUEST"
}

And also

{
    "AttributeDefinitions": [
        {
            "AttributeName": "userId",
            "AttributeType": "S"
        }
    ],
    "TableName": "TEMP_Users",
    "KeySchema": [
        {
            "AttributeName": "userId",
            "KeyType": "HASH"
        }
    ],
    "BillingModeSummary": [
		{
			"BillingMode ": "PAY_PER_REQUEST"
		}
    ]
}

Both attempts result in:

Parameter validation failed:
Missing required parameter in input: "ProvisionedThroughput"
Unknown parameter in input: "BillingMode", must be one of: AttributeDefinitions, TableName, KeySchema, LocalSecondaryIndexes, GlobalSecondaryIndexes, ProvisionedThroughput, StreamSpecification, SSESpecification

Am I doing anything wrong? Looks like I am complying with the create-table CLI? https://docs.aws.amazon.com/cli/latest/reference/dynamodb/create-table.html

preguntada hace 5 años470 visualizaciones
3 Respuestas
0
Respuesta aceptada

I believe you might be using an older version of aws cli and hence its not able to recognize recently added parameter 'BillingMode'. Can you update aws cli using following command 'sudo pip3 install --upgrade awscli' to latest version and then retry.

AWS
respondido hace 5 años
0

Thank you - this was the problem.

respondido hace 5 años
0

I am glad issue is resolved.

AWS
respondido hace 5 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas