This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
11-14-2017 02:27 PM - edited 07-15-2021 08:32 AM
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:
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:
s3 cp "C:\temp\mylocalfile.csv" "s3://mylocation/mydestinationfilename.csv" --profile MyIAMUser
Test the above
The example above is attached in the 11.3 workflow, SaveToS3_usage.yxzp.
Thanks for this article Dan!
We have been trying to utilize the command tool to write to an AWS bucket that we do not own (but have permissions to). We have followed your instructions and cannot get past an "Error: Run Command (3): The external program "aws" returned an error code: 1"
We have copied exactly the Command that works in the command prompt and cannot figure out why we are receiving this error.
In the image above, I replaced my userid with "machine" and the actual external AWS bucket with "external-bucket". Everything else is as is and what works directly in the command prompt. We receive the same error with the quotes around the file and destination.
The "--profile IAMUser" was not required in the command prompt and tried it in Alteryx, and that generates a 255 error. Is the --profile required for Alteryx?
I have read everything I could find about the Write Source and Read Source and cannot wrap my brain around what their point is and how we are supposed to use them. Is that causing the problem?
Do you have any ideas why it would not work?
Thank you!
kirk
Hi @kirk_yates
Here's what I would check:
I hope this helps!
-Dan
Thanks for the response @DanH !
Below are the responses to your questions:
Any further thoughts on the topic would be very helpful. Feels like we are so close, but cannot get over the finish line on this.
Thanks for your help.
- kirk
It is me again @DanH !
Although this time with great news!
Yesterday I updated Alteryx Designer to Version 2020.2.3.27789. I reopened the same Alteryx .yxmd file, changed nothing, hit Run and everything worked fine!
Not sure what was changed in the Designer version, or if it is just coincidence and I was having something weird going on in my environment, but we are in business.
Thanks once again for your help and attention!
-kirk
kirk
Hi @kirk_yates
I'm glad to hear you got this working. Sorry for the delayed response- I was trying to do some additional testing on my end to give you some next steps.
I looked through the 2020.2 features and fixes, and don't really see anything should have changed the behavior of Run Command. It's possible there was some bug in an older version that had already been resolved pre-20.2, or it's also possible that there was something environmental related to the install location or permissions that was different between your two versions. The error code makes me suspect a path or permission issue. If you ever discover what the issue was, I'd be curious to know.
Thanks,
Dan
I tried doing this on Alteryx server but I got error code 253
I am also getting error code 253 when attempting to run this on server, did you manage to resolve @nitinpango
I managed to get around the "error code 253". The problem was that although we had setup the server config, when running the workflow the AWS Key was not available. I then ran a workflow on the server with a Run Command Tool with this
cd\
cd program files\amazon\awscliv2
Hi @DanH ,
Can we run the workflow which uses AWS CLI & Run Command tool on alteryx gallery?
I have AWS CLI installed on my machine.
Regards,
Mustafa Kanchwala
@MKanchwa Yes, since the engine on Server is the same as on Designer, you can execute the same commands on a (private) Server that had the CLI installed. Note that there may be authentication considerations to manage in an environment with multiple users. Note also that there's a Server configuration option ("Safe Mode)" that intentionally prevents executing the Run Command tool. Also note that the "public" gallery (https://gallery.alteryx.com) doesn't allow execution of tools with Run Command.
Thanks,
Dan