The config and credentials files allow some of the Teradata Access Module for S3 parameters, particularly credentials, to be stored in a file rather that placed in the TPT job scripts. For convenience of those users who use the AWS Command Line Interpreter or are familiar with it, these files follow the conventions defined by the AWS CLI. Use of these config files is not dependent on the AWS CLI being installed.
The config file contains the region name where the S3 bucket is located. The config file supports comments.
By convention, the Amazon command line utilities obtain configuration and authentication data from files in the user’s home directory. The files are known as config, with a location of ~/.aws/config and credentials with a location of ~/.aws/credentials. The syntax for these files is defined by the AWS documentation although the examples should be sufficient to create these files if they are not already present.
Many AWS users will have these files present since development and administration is often performed using the AWS CLI utilities. The Teradata Access Module for S3 can interpret these files to obtain the region, access_key_id, and secret_access_key if they are not provided via module parameters or shell environment variables.
These files are broken up into sections called “profiles”. Each section is identified with the profile name in square brackets. The profile [default] is expected to be present and other profiles can be provided as shown in the following example. The desired profile can be selected by the S3Profile module parameter.
The following is an example of the contents of the config file with a default location of ~/.aws/config:
[default] region = us-west-2 [export_job_7] region = us-east [load_job_5] region = us-west-2 # I support comments
The credentials file contains the user credentials such as "Access Key Id", "Secret Access Key", and (optionally) "Session Token".
The following is an example of the contents of the credentials file with a default location of ~/.aws/credentials:
[default] aws_access_key_id = AKIA************T6XA aws_secret_access_key = Mpm1********************************CNT4 [export_job_7] aws_access_key_id = AKIA************WLCX aws_secret_access_key = Mpm1********************************QQL7 [load_job_5] aws_access_key_id = AKIA************WWNB aws_secret_access_key = Mpm1********************************CNT4 [my_mfa_profile] aws_access_key_id = AKIA************WWZX aws_secret_access_key = Ljm3********************************CNL3 aws_session_token = H7G3****************************XYZZ
You must create a .aws directory under your home directory and keep the config file and the credentials file under the .aws directory, unless you choose an alternate location. The .aws directory is the default location to keep the config file and the credentials file.
You can also store the config file and the credentials file in any directory of your choice. However, you must specify the directory path where the config file and the credentials file are stored, through the initialization string parameter named S3ConfigDir.