39

I understand the AWS CLI can make use of the config and credentials files for storing it's local profile configurations.

Does anyone know of any general guidance and or best practice with regards to what should go in each file?

PicoutputCls
  • 1,392
  • 1
  • 12
  • 24

1 Answers1

40

The AWS documentation which covers the two files can be found under Configuration and Credential Files in the AWS CLI documentation.

To summarise:

  • The two files are distinct in order to enable the separation of credentials from less sensitive configuration information.
  • The credentials file is intended for storing just credential information for the configured profiles. (Currently limited to: aws_access_key_id, aws_secret_access_key and aws_session_token)
  • The config file is intended for storing non-sensitive configuration options for the configured profiles.
  • The config file can also be configured to contain any information which could also be stored in the credentials file.
  • In the case of conflicting credential information being specified for a profile in the config and credentials file, those in the credentials file will take precedence.
PicoutputCls
  • 1,392
  • 1
  • 12
  • 24
  • 1
    Bullet 2 is potentially misleading: region and output are stored in the config file (alone), not the credentials file. – jarmod Nov 03 '17 at 13:45
  • @jarmod You are correct. I misunderstood the AWS documentation linked in my answer. I have edited my answer to remove those entries. – PicoutputCls Nov 03 '17 at 14:52