Neo4j provides LOAD CSV cypher command to load data from CSV files into Neo4j or access CSV files via HTTPS, HTTP and FTP. But how do you load data from CSV files available on AWS S3 bucket as access to files requires login to AWS account and have file access? That is possible by making use of presign URL for the CSV file on S3 bucket.
We will quickly walk through on how to create a presign URL for a file on AWS S3 bucket.
We will need aws command line utility for it.
aws command line utility is installed, setup the aws command line using
aws configure command.
Rohans-MacBook-Pro-2:bin rohankharwar$ aws configure AWS Access Key ID [****************KSRQ]: AWS Secret Access Key [****************t9gZ]: Default region name [us-east]: us-east-2 Default output format [None]:
For this example the
actors.csv file is available in
rohank S3 bucket.
Run the below command to create the presign URL for
aws s3 presign s3://rohank/actors.csv
The command will create and output the following presign URL
Then use the URL to access the file from S3 bucket using LOAD CSV as
LOAD CSV WITH HEADERS FROM "https://rohank.s3.amazonaws.com/actors.csv" as row return count(row)
- Last Modified: 2020-09-23 21:26:58 UTC by Rohan Kharwar.
- Relevant for Neo4j Versions: 3.2, 3.3, 3.4, 3.5.
- Relevant keywords aws, s3, import, cli.