community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx Knowledge Base

Definitive answers from Designer experts.
New Data Science Blog

Check out the latest post: All Models Are Wrong

READ MORE

Extending Integration with AWS

Alteryx
Alteryx

Amazon offers many different services that can be accessed from the AWS Command Line Interface (aka the AWS CLI). Alteryx workflows can take advantage of these services using the AWS CLI from the Run Command tool.

 

Some of the common uses of the Amazon CLI within Alteryx include:

  • Using S3 with IAM roles
  • Uploading/Downloading file types not currently supported by the S3 Upload / Download tools
  • Interacting with Athena

As an example of using the AWS CLI, let’s build a process that can take a local file and copy to S3, using an AWS IAM profile. Here are the steps involved:

  • Review the documentation for the service. In this example, we're using the "S3" service, but Amazon has many different AWS services.
  • Install the AWS CLI on any machines that will need to execute the AWS functions
  • From Windows Command Line, create a working command
    1. (Optional step to make calling the CLI easier in the future) – Add reference to the AWS CLI executable to Window Environment variables via My Computer > Right Click > Properties > Advanced System Settings > Environment Variables > System Variables > Select “Path” > Edit > (Add the path to the directory of your installed “aws.exe” file, separated by a semicolon. Do not delete/modify any pre-existing values in the Path variable.) > OK > OK
    2. Per the AWS documentation, create a local profile using your IAM role. The local profile references your credentials so that you don't have to pass the credentials in every command.
    3. Test the following command in your Windows command prompt, making sure to use a valid local file to copy, and a valid destination location on your S3, and a valid profile name:

s3 cp "C:\temp\mylocalfile.csv" "s3://mylocation/mydestinationfilename.csv" --profile MyIAMUser

 

  • Once you've validated your command in the command prompt, transfer it to an Alteryx workflow
    1. In a new workflow, pull in a “Run Command” tool from the “Developer” category
    2. Configure the Run Command tool using the working command:

 RunCommandAWS_Example.png

Test the above

  • As an optional step, we can wrap this functionality into a macro to make it easy to update, and to support batch uploads
    1. Add a Control Parameter for “Local File Path” and configure its action to update the specific string value “C:\temp\myfile.csv
    2. Add a Control Parameter for “Destination File Path” and configure its action to update the specific string value “s3://mybucket/myfiletest1.csv
    3. Add a Text Box and configure its action to update the command value “aws” in case the user hasn’t placed the CLI exe in their PATH variables

The example above is attached in the 11.3 workflow, SaveToS3_usage.yxzp.