我可以使用 AWS CLI 在本地模拟器中创建 dynamodb table 吗?

Can I use AWS CLI to create a dynamodb table in the local emulator?

有没有办法使用下面的

aws dynamodb create-table --table-name TableName l --attribute-definitions AttributeName=Id,AttributeType=S --key-schema AttributeName=Id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5

要在本地发电机模拟器上创建 table?

是的,您需要使用 --endpoint-url 选项。

引用自 AWS CLI documentation:

The AWS CLI can interact with DynamoDB running on your computer. To enable this, add the --endpoint-url parameter to each command:

--endpoint-url http://localhost:8000

Here is an example, using the AWS CLI to list the tables in a local database:

aws dynamodb list-tables --endpoint-url http://localhost:8000

If DynamoDB is using a port number other than the default (8000), you will need to modify the --endpoint-url value accordingly.

Note At this time, the AWS CLI cannot use the downloadable version of DynamoDB as a default endpoint; therefore, you will need to specify --endpoint-url with each CLI command.