Skip to main content

Importing from Amazon S3

You can import data directly from Amazon S3 into MetaLocator

Written by Michael Fatica

Follow the below steps to import a CSV data file from an Amazon S3 Bucket into MetaLocator.

The first step is to ensure your CSV files are ready and available in an Amazon S3 bucket.

Creating and Configuring the Amazon S3 Bucket

AWS recommends using IAM permissions and least-privilege policies for this type of access, and access keys are used for programmatic access to AWS resources.

Goal

Create credentials that can:

  • List the contents of one specific S3 bucket.

  • Download files from that bucket.

  • Not upload, delete, modify, or access other buckets.

1. Create the S3 bucket

  1. Sign in to the AWS Console.

  2. Go to S3.

  3. Click Create bucket.

  4. Enter a globally unique bucket name, for example:

my-company-download-files
  1. Choose the AWS Region.

  2. Leave Block all public access enabled.

  3. Keep ACLs disabled unless you have a specific reason to use them.

  4. Enable encryption if desired.

  5. Click Create bucket.

2. Create an IAM policy for download-only access

Go to IAM → Policies → Create policy → JSON.

Use this policy, replacing YOUR-BUCKET-NAME with the actual bucket name:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListOnlyThisBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME"
},
{
"Sid": "DownloadOnlyFromThisBucket",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
}
]
}

Example with a real bucket name:

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListOnlyThisBucket",
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::my-company-download-files"
},
{
"Sid": "DownloadOnlyFromThisBucket",
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::my-company-download-files/*"
}
]
}

Name the policy something like:

DownloadOnly-my-company-download-files

This grants only s3:ListBucket on the bucket itself and s3:GetObject on objects inside the bucket. AWS S3 permissions distinguish bucket-level actions from object-level actions, so both resource ARNs are needed.


3. Create an IAM user for programmatic access

  1. Go to IAM → Users.

  2. Click Create user.

  3. Enter a name such as:

s3-download-only-user
  1. Do not give the user AWS Console access unless required.

  2. On permissions, choose Attach policies directly.

  3. Select the policy you created:

DownloadOnly-my-company-download-files
  1. Click Create user.


4. Create the Access Key ID and Secret Access Key

  1. Open the IAM user you just created.

  2. Go to the Security credentials tab.

  3. Under Access keys, click Create access key.

  4. Choose the use case, usually Application running outside AWS or equivalent.

  5. Confirm the recommendation notice.

  6. Click Create access key.

  7. Copy or download the credentials.

You will receive:

AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY

Important: AWS only shows the secret access key once. Store it securely when it is created. If it is lost, you must delete the key and create a new one.

5. Test the Credentials

  1. Login to MetaLocator

  2. Click Locations -> Import

  3. Choose Amazon S3

  4. Enter your Access ID, Secret Key, Region and Bucket Name.

  5. Provide a path if needed to indicate any sub-directory to load files from.

  6. Click Load File List

Import Data​

At this stage, if you have not uploaded any CSV files into this bucket, you will see an error that there are no CSV files available. Otherwise, if successful, the "Files" dropdown will show files available for download as shown below:

Choose a file from the "Files" list and click Next.

Click Next, and the import process will continue as usual.

Be sure to appropriately map your CSV columns to MetaLocator System columns as provided during the next step in the import process.

Did this answer your question?