Search code examples
amazon-dynamodbaws-cliamazon-dynamodb-local

how to run aws cli command silently to create a dynamodb table


I am creating a shell script that will create a couple of dynamodb tables locally among other things. This is the create table AWS CLI command I am using:

aws dynamodb create-table --cli-input-json file://table-user.json --endpoint-url http://localhost:8000

with table-user.json having all table related information for creation.

The problem with this command is I need to click on key 'q' to proceed to the next line for execution as it gives table details as output. ex:

{
    "TableDescription": {
        "AttributeDefinitions": [
            {
                "AttributeName": "id",
                "AttributeType": "S"
            },
            {
                "AttributeName": "externalId",
                "AttributeType": "S"
            },
.
.
.

How can I silently run the create table command?


Solution

  • Set AWS_PAGER="".

    So your command would be:

    AWS_PAGER="" aws dynamodb create-table --cli-input-json file://table-user.json --endpoint-url http://localhost:8000