Uploading a File to Amazon S3

Problem

You need to upload a file to Amazon S3.

Solution

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

Tasks

Create an Amazon S3 Upload Job

  1. Drop the Upload File To Amazon S3 transformation in the Job Editor window.
  2. To specify the file that you want to upload to Amazon S3, drop it in the Diagram tab. Then connect it an open input port in the Upload File To Amazon S3 transformation.
  3. (Optional) To specify an input file in the Properties window, click the Options tab. Then select the Input and Output Options pane, and select the Specify input file field.

Configure an Amazon S3 Upload Job

Perform the following steps to configure an Amazon S3 Upload Job:
  1. Open the Properties window in the Upload File To Amazon S3 transformation.
  2. Click Options. Then click AWS S3 Connection Options.
  3. Click the Use configuration file field, and select either Yes or No.
  4. If you select Yes in the Use configuration file field, 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
  5. If you select No in the Use configuration file field, 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
  6. Click OK.
  7. Click Input and Output Options. If you did not connect the input table to the transformation in the Diagram tab, browse for the table in the Specify input file field.
    The data in the input table that you upload to Amazon S3 must be in its final form. If you need to change the content of the data, you can use an appropriate transformation to make the needed changes. You must place this transformation in front of the Upload File To Amazon S3 transformation in the SAS Data Integration Studio job.
    Filenames that contain special characters might not work with the Upload File To Amazon S3 transformation. If the input file is stored in Linux, enter the filename in lowercase.
  8. Click in the Specify S3 bucket folder name field. Enter the full path in Amazon S3 from the bucket name to the folder name.
  9. If the Amazon S3 file has a name that is different from the input filename, enter the Amazon S3 filename in the Specify S3 file name field.
  10. Review the setting of the Replace S3 file field. If you want to replace the existing S3 file, select Yes. Otherwise, select No.
  11. Review the setting of the Convert connected input table to CSV file field. SAS data sets can be uploaded to Amazon S3 in their native SAS format or in CSV format. Select Yes to convert a SAS data set to CSV data before upload or No to upload the table as SAS data. Tables that do not contain SAS data must be converted to CSV before they can be uploaded. Therefore, always select Yes for non-input tables that contain data other than SAS data.
  12. Click OK.
  13. Run the job in SAS Data Integration. Review the Details pane to ensure that the job ran successfully. Then check in Amazon S3 to ensure that the expected data was uploaded.
Last updated: January 16, 2018