0
votes

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?

2

2 Answers

1
votes

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
0
votes

If you haven't found any solution in the cli documentation take a look at the unix yes command.

You can do something like:

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

This command will keep on entering the specified string (q in this case) until the program finishes.