Downloading a File from Amazon S3

Problem

You need to download a file from the Amazon Simple Storage Service (Amazon S3).

Solution

You can add the Download File From Amazon S3 transformation to a SAS Data Integration Studio job. Then you can select a file to download and specify the parameters of the connection to Amazon S3.

Tasks

Create and Configure an Amazon S3 Download Job

Perform the following steps to create and configure an Amazon S3 Download Job:
  1. Drop the Download File From Amazon S3 transformation in the Diagram tab in the Job Editor window.
  2. Open the Properties window in the Download File From Amazon S3 transformation.
  3. Click Options. Then click AWS S3 Connection Options.
  4. In the Use configuration file field, select either Yes or No in the drop-down menu.
  5. If you select Yes in the Use configuration file option, then specify a full path and filename for your configuration file in the Specify configuration file field. This configuration file provides the connection parameters to Amazon S3. You can store it anywhere accessible to your SAS Application Server.
    A sample configuration file is similar to the following text:
    ssl=yes
    keyId=AKFKI8OMEVIM3XJHKEUQ
    secret=wb89GergI/3xejxudQugFj5Wi4iqlFJhGpLvYVv
    region=usstd
  6. If you select No in the Use configuration file option, then you must enter appropriate values in the four required connection parameters fields, as shown in the following table.
    Note: The following four connection options are displayed only when the Use configuration file option is set to No. Entering values for each option is required.
    Connection Parameters
    Option
    Description
    Value
    Specify AWS Region
    Specifies the AWS region for the connection. The following values are accepted: usstd, uswest, uswestca, euireland, eufrankfurt, apsingapore, apsydney, aptokyo, sa, usgov, and fips.
    Text
    Specify AWS Access Key ID
    Specifies the AWS access key ID, which you obtain from Amazon. This key is a 20-character alphanumeric string, similar to AKIAIOSF0DNNEXAMPLE.
    Text
    Specify AWS Secret Key
    Specifies the AWS secret key, which you obtain from Amazon. This key is a 40-character string, similar to wKalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY.
    Text
    Enable SSL data encryption
    Specifies whether SSL data encryption is used. Yes specifies that SSL data encryption is used. No specifies that SSL data encryption is not used.
    Yes
    No
  7. Click OK.
  8. Click Input and Output Options. Then enter appropriate values in the Specify S3 full path and file name field. The path and filename must be fully qualified from the Amazon S3 bucket name to the filename. This value should use the following pattern: my Amazon S3 bucket name/my Amazon S3 folder/my Amazon S3 file.
  9. Click in the Specify output file field. Enter the full path and filename of the output file that contains the contents of the file that you download from Amazon S3. Filenames that contain special characters might not work with the Download File From Amazon S3 transformation.
  10. Review the setting of the Replace output file field. If you want to replace the existing output file, select Yes. Otherwise, select No.
  11. Click OK.
  12. Run the job in SAS Data Integration. Review the Details pane to ensure that the job ran successfully. Then check the output file to ensure that the expected data was downloaded.
Last updated: January 16, 2018