Config File Locator

AWS CLI config file locations


Commands use a POSIX shell (macOS, Linux, or WSL). Install the named editor or CLI first. Before using an environment-variable path, check that the variable is set to a non-empty, intended path. When using vi or Notepad, ensure the parent directory exists and is writable. A missing file is created when you save it; Notepad may ask to create it.

AWS_CONFIG_FILE selects a configuration file instead of the default ~/.aws/config. The files are not merged. This page covers the config file only.

  1. AWS_CONFIG_FILE

    First choice

    Selects a custom file path, not a directory. There is no equivalent command-line flag.

    Config file location
    $AWS_CONFIG_FILE
    Only use this command when AWS_CONFIG_FILE is set to a file path.
    Commands
    vi "$AWS_CONFIG_FILE"
  2. Default user config

    Default location

    Used when AWS_CONFIG_FILE is unset. Stores settings such as region, output format, and named profiles.

    Config file location
    ~/.aws/config
    The file may not exist yet. Profile sections use [default] or [profile <name>].
    Commands
    vi "$HOME/.aws/config"

Official AWS CLI documentation