Making Sense of AWS CLI documention

How do you make sense of aws cli documention? Specifically the syntax structuring of commands? For exaample aws dynamodb import-table.
Documentation gives no example on how to structure the values for table-creation-parameters. Do you just guess or google until you find enough info to get it right?

  - AttributeName: somestring
    AttributeType: somestring

AttributeDefinitions can have many items, each with a name and type

Etc with the other stuff, the doc is at least trying to show this structure

My example is yaml, but it’s more or less the same in JSON just with the {}[], in there and quotes around all the keys and strings

I mean that it’s not easy to craft the command by looking at the doc

I’ve seen far worse docs to be honest

This is pretty typical of like API documentation

The fact that it structured this way hints that it’s really part of the body of an API call that the AWSCLI is making for you under the hood

You could probably look up the API it’s using and find that it will have a JSON object structured exactly the same

I’m really just trying to understand how to interpret this doc and make sense of how to structure the command because I understand the api call.

Are you having trouble getting it onto one line or what? Not that it’s impossible but it would be annoying to put that as JSON on a single line

You can use whatever shell you’re in to store it using some nice JSON or yaml though so it’s easier to pass into the cli command

Personally I find yaml much easier to read and write, since you don’t need all the special characters. It’s easy enough to convert between them since yaml is a supertype of json

I’m on a phone or else I would give you a full example. Though you can probably find one on stack overflow with a bit of googling

Or ask chat gpt, it may be able to give you a working example too

I see. I am definitely missing something that’s keeping me from connecting the dots here.

I’m having trouble understanding how the documentation wants me to format values for --table-creation-parameters specifically.

For example, what did you read in the doc that let you know that you can store it a json/yaml and pass to cli? Just looking at the boto3 equivalent. It is super clear how to structure this.

I know how I can find the answer via google etc. I’m more trying to understand how to read this type of documentation and apply it across the board because I understand yaml/json.

I just assume it’s JSON because it’s structured like json

And that’s what APIs typically use