Using the Amazon CLI examples - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Using the Amazon CLI examples

The Amazon Command Line Interface (Amazon CLI) examples in this guide are formatted using the following conventions:

  • Prompt – The command prompt uses the Linux prompt and is displayed as ($ ). For commands that are Windows specific, C:\> is used as the prompt. Do not include the prompt when you type commands.

  • Directory – When commands must be executed from a specific directory, the directory name is shown before the prompt symbol.

  • User input – Command text that you enter at the command line is formatted as user input.

  • Replaceable text – Variable text, including names of resources that you choose, or IDs generated by Amazon services that you must include in commands, is formatted as replaceable text. In multiple-line commands or commands where specific keyboard input is required, keyboard commands can also be shown as replaceable text.

  • Output – Output returned by Amazon services is shown under user input, and is formatted as computer output.

The following aws configure command example demonstrates user input, replaceable text, and output:

  1. Enter aws configure at the command line, and then press Enter.

  2. The Amazon CLI outputs lines of text, prompting you to enter additional information.

  3. Enter each of your access keys in turn, and then press Enter.

  4. Then, enter an Amazon Region name in the format shown, press Enter, and then press Enter a final time to skip the output format setting.

  5. The final Enter command is shown as replaceable text because there is no user input for that line.

    $ aws configure AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY Default region name [None]: us-west-2 Default output format [None]: ENTER

The following example shows a simple command with output. To use this example, enter the full text of the command (the highlighted text after the prompt), and then press Enter. The name of the security group, my-sg, is replaceable to your desired security group name. The JSON document, including the curly braces, is output. If you configure your CLI to output in text or table format, the output will be formatted differently. JSON is the default output format.

$ aws ec2 create-security-group --group-name my-sg --description "My security group" { "GroupId": "sg-903004f8" }