Configuration and Credentials File Format
Separating configuration and credentials into distinct files enables multiple users or applications to utilize the same credentials while maintaining individual settings. It is considered best practice to store credentials and shared settings in the credentials file, and all other settings in the configuration file.
The configuration and credentials files are structured into various sections. Each section, marked by a name, contains a set of related settings. These sections persist until a new section begins. It's possible to have multiple profiles and sections within these files.
The format of these files is straightforward:
Sections are identified by names within brackets, like [default], [profile user1].
Within a section, settings are formatted as setting_name=value.
Lines beginning with a hashtag (#) are comments and are not processed.
In the AWSCONF configuration file, profile sections are named [default] or [profile user1].
In the AWSCRED credentials file, they are named [default] or [user1]. Avoid using 'profile' in the credentials file.
The following example shows related configuration and credentials files.
AWSCRED Sample
[default]
aws_access_key_id=AKIASDFRTHTJDFHD2EFF
aws_secret_access_key=l38ufsaHlrasdfe88af3oijad0N5evWAQ26K
[user1]
aws_access_key_id=AKIAXFJDHSRTSDFHSTRHF
aws_secret_access_key=l38ufsaHljasdfao88jadsfjoaweijfiQ26K
AWSCONF
[default]
region=us-west-2
[profile user1]
region=us-east-1