使用 CLI 创建 AWS DynamoDB Table 时出错
Error while creating AWS DynamoDB Table using CLI
我正在尝试使用 CLI 在 DynamoDB 中创建 table。
我正在使用以下命令:
aws dynamodb create-table \ --table-name my_table \--attribute-definitions 'AttributeName=Username, AttributeType=S' 'AttributeName=Timestamp, AttributeType=S' \--key-schema 'AttributeName=Username, KeyType=HASH' 'AttributeName=Timestamp, KeyType=RANGE' \--provisioned-throughput 'ReadCapacityUnits=5, WriteCapacityUnits=5' \--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \--region us-east-1
在上面的 运行 上,出现以下错误:
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: the following arguments are required: --attribute-definitions, --key-schema
我是 AWS 的新手,我在命令中声明了属性和密钥模式,错误是什么?
我会尝试对密钥架构和属性定义使用 json 文件。有关 json 语法和示例,请参阅 https://docs.aws.amazon.com/cli/latest/reference/dynamodb/create-table.html。除了 table 之外,您不需要任何其他参数来获得 table 运行。
您键入的命令上的反斜线用于告诉 cmd,当有换行符时,该命令将在下一行继续。
根据您输入的屏幕截图和命令,您正在尝试在一行中执行它。
作为一种解决方案,您可以从命令中删除反斜杠或复制原始命令(教程中的命令)(包括换行符)。
没有换行符:
aws dynamodb create-table --table-name my_table --attribute-definitions 'AttributeName=Username, AttributeType=S' 'AttributeName=Timestamp, AttributeType=S' --key-schema 'AttributeName=Username, KeyType=HASH' 'AttributeName=Timestamp, KeyType=RANGE' --provisioned-throughput 'ReadCapacityUnits=5, WriteCapacityUnits=5' --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES --region us-east-1
有换行符:
aws dynamodb create-table \
--table-name my_table \
--attribute-definitions AttributeName=Username,AttributeType=S AttributeName=Timestamp,AttributeType=S \
--key-schema AttributeName=Username,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \
--region us-east-1
我正在使用以下命令:
aws dynamodb create-table \ --table-name my_table \--attribute-definitions 'AttributeName=Username, AttributeType=S' 'AttributeName=Timestamp, AttributeType=S' \--key-schema 'AttributeName=Username, KeyType=HASH' 'AttributeName=Timestamp, KeyType=RANGE' \--provisioned-throughput 'ReadCapacityUnits=5, WriteCapacityUnits=5' \--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \--region us-east-1
在上面的 运行 上,出现以下错误:
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:
aws help
aws <command> help
aws <command> <subcommand> help
aws: error: the following arguments are required: --attribute-definitions, --key-schema
我是 AWS 的新手,我在命令中声明了属性和密钥模式,错误是什么?
我会尝试对密钥架构和属性定义使用 json 文件。有关 json 语法和示例,请参阅 https://docs.aws.amazon.com/cli/latest/reference/dynamodb/create-table.html。除了 table 之外,您不需要任何其他参数来获得 table 运行。
您键入的命令上的反斜线用于告诉 cmd,当有换行符时,该命令将在下一行继续。
根据您输入的屏幕截图和命令,您正在尝试在一行中执行它。
作为一种解决方案,您可以从命令中删除反斜杠或复制原始命令(教程中的命令)(包括换行符)。
没有换行符:
aws dynamodb create-table --table-name my_table --attribute-definitions 'AttributeName=Username, AttributeType=S' 'AttributeName=Timestamp, AttributeType=S' --key-schema 'AttributeName=Username, KeyType=HASH' 'AttributeName=Timestamp, KeyType=RANGE' --provisioned-throughput 'ReadCapacityUnits=5, WriteCapacityUnits=5' --stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES --region us-east-1
有换行符:
aws dynamodb create-table \
--table-name my_table \
--attribute-definitions AttributeName=Username,AttributeType=S AttributeName=Timestamp,AttributeType=S \
--key-schema AttributeName=Username,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES \
--region us-east-1