This tutorial will walk you through how to copy files from the local drive to an AWS S3 bucket during a UiPath RPA process. One use case is creating a feed where data is scraped from a website, the data is stored in a .csv file during the process and then the .csv file is copied to an S3 bucket for use by another system.
Create an S3 user for the process in AWS IAM see this article Download the public and secret access keys for the user for use in the AWS CLI tool Download, install and configure the AWS CLI tool, see this article This needs to be done in all environments where the process will be used – e.g. development, production etc. Write the process to extract the data and create the .csv file in UIPath Studio Method:
Use the Invoke Power Shell activity
In the Properties panel, add the CLI CommandText to copy the file from its current location to the S3 bucket
"aws s3 cp YOURFILEPATH s3://YOURBUCKETNAME/YOURFILENAME"
UiPath AWS S3 Power Shell Activity
UiPath AWS S3 Power Shell Activity Properties Panel
In this tutorial I am going to show you how to create an AWS IAM role so you can create access keys to use to copy files to and from AWS S3 buckets via the AWS Command Line Interface (CLI).
This is useful if you need to transfer files from S3 to an EC2 instance using the CLI.
You have an AWS account
You have an EC2 instance created
You have access to IAM within the AWS Console
Creating an IAM Role
Step 1 – Open the IAM Console
Step 2 – Click on Users
Click on Users
Step 3 – Click ‘Add user’
Click ‘Add User’
Step 4 – Enter a unique user name
Step 5 – Check Programmatic Access
Enter a user name and check programmatic access
Step 6 – Click Next: Permissions
Step 7 – Click ‘Attach existing policies directly’
Click ‘Attach existing policies directly’
Step 8 – Enter S3 in the’ Filter policies’ field
Step 9 – Check ‘AmazonS3FullAccess’ or ‘AmazonS3ReadOnlyAccess’ depending on your requirements
Enter S3 in ‘Filter policies’ and check S3FullAccess or AmazonS3ReadOnlyAccess
Step 10 – Click Next: Review
Step 11 – Review and Click ‘Create user’
Review and click ‘Create user’
Step 12 – Download the key pair and store securely – don’t email, share them outside your organization – keep the keys confidential. You can only download them once.
View and download the key pair
In this tutorial I will show you how you can copy files from S3 to an Amazon Web Services EC2 instance using the AWS Command Line Interface (CLI).
The basic concept of the AWS CLI S3 commands is that you have two types of path arguments: LocalPath and S3Uri.
The LocalPath is the local file or directory. The S3Uri is the location of a S3 object or bucket written in the form S3://mybucket/myobjectkey.
In each command, one path argument represents the source and the other the destination.
You have an EC2 instance running and can get access to it using SSH
You have configured the AWS CLI on your instance using keys with read/write access to S3 – see
How to Configure the AWS CLI You have a bucket or buckets set up containing some test files or objects
Copying a file to S3
aws s3 cp MyFile.txt s3:
//my-bucket/path/ Moving all files from S3
aws s3 mv
s3:/ /my-bucket/path ./MyDirectory --recursive Removing a file from S3
aws s3 rm s3:
//my-bucket/path/MyFile.txt Syncing current directory with a S3 bucket
aws s3 sync . s3:
//my-bucket/path Delete all contents of a bucket
aws s3 rm s3:
//my-bucket/path --recursive List all buckets
aws s3 ls List contents of a bucket
aws s3 ls s3: