Introduction

Using AWS S3 allows you to send us data to us in the most convenient way possible if you are already in AWS, by using the AWS CLI sync and cp command.

What we'll need from you

If your data is located in S3

This option is for situations where you have your files already in S3, and would like to move them from your bucket to ours.

  • Company Name
  • AWS Account IDAWS Account ID - Finding Your Account ID using the console: In the navigation bar, choose Support, and then Support Center. Your currently signed-in 12-digit account number (ID) appears in the Support Center navigation pane.
  • Your S3 Bucket name
  • The KMSKMS - AWS Key Management Service Key ARNARN - Amazon Resource Names if your data is encrypted at rest

If the location is other then S3

This option is for situations where your data is on a drive or database and can be copied directly from a server.

  • Company Name
  • AWS Account ID

Creating a IAM user

Before you can assume the IAMIAM - AWS Identity and Access Management Role created for your company, you have to create an IAM user which will be used by you to assume the set role. Since the role that we make references the IAM username, and the AWS Account ID that you provided us.

Navigate to the IAM console,

  1. create a new user named banyan_input_s3.
  2. Select programmatic access,
  3. Hit next until you are shown your security credentials. Be sure to record them safely.
  4. Once the user is created, attach the following inline policy.

📘

Important

Make sure to replace COMPANY_NAME with your company name.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "sts:AssumeRole",
            "Resource": "arn:aws:iam::356687812700:role/banyan_input_s3_merchant_COMPANY_NAME"
        }
    ]
}

Preparation before assuming the role

📘

Note

  1. Install the latest version of the AWS CLI.
  2. The following work needs to be done under a *UNIX system.

First, we need to make sure you have the right environment setup.

If you've used the AWS CLI before

If you have used the AWS CLI in the past, and run the aws configure command, you will have a folder .aws in the home directory of the user you are logged in as in the OS with all the files needed in place. You can skip the next step.

If you've never used the AWS CLI before

If you have never used the AWS CLI, then please create the folder with two files in them, following the instructions below:

  1. mkdir ~/.aws - to create the folder in your home directory.
  2. touch ~/.aws/config - to create an empty file for the AWS CLI configuration.
  3. touch ~/.aws/credentials - to create an empty file where the user credentials will go.

Setup the credentials

With the folder structure and files now in place, add the following content in the ~/.aws/config file, making sure to replace COMPANY_NAME with the one you provided:

[profile banyan]
role_arn = arn:aws:iam::356687812700:role/banyan_input_s3_merchant_COMPANY_NAME
source_profile = banyan_credentials

In the ~/.aws/credentials file, add the following content inside, making sure to replace DATA with the correct values you've saved when making the IAM user:

[banyan_credentials]
aws_access_key_id=DATA
aws_secret_access_key=DATA

Now that the data is in the right place, you can run the following command in the terminal which will copy the evaluation data in the folder where you'll run the command using the profile that you just made above. The CLI will take care of the IAM Role assumption.

Transferring data to our bucket

📘

Important

Make sure to replace COMPANY_NAME with your company name.

With the command line, navigate to the folder you want to transfer to Banyan and run the following command:

aws s3 sync . s3://banyan-production-us-east-1-input-s3-COMPANY_NAME --delete

Additionally you can copy, list and delete

aws s3 cp . s3://banyan-production-us-east-1-input-s3-COMPANY_NAME --recursive
aws s3 ls s3://banyan-production-us-east-1-input-s3-COMPANY_NAME
aws s3 rm s3://banyan-production-us-east-1-input-s3-COMPANY_NAME/FILE_NAME

Did this page help you?