Using AWS with Ronin#

Enable Ronin#

Take a tutorial course for ronin.

Storing files on S3 using Ronin#

The goal is to first create an S3 bucket using Ronin.(link)

Setting up AWS CLI#

Guide

To install aws cli for linux,

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
# General Install
sudo ./aws/install
# Local Install
./aws/install -i /usr/local/aws-cli -b /usr/local/bin

Configure AWS#

# import aws configuration from csv file.
# Note 1: Prepend "file://", or it will not work.
# Note 2: in the csv file, add a column with header User Name. (This replaces the --profile option) User name does not have to be the login username.
aws configure import --csv file://[Filepath]
# Set region. If empty, aws uses the default
# Note: [Profile Name] is the User Name specified in the csv fileß
aws configure set region ap-southeast-1 --profile [Profile Name]
# Check if configuration have been added successfully
more ~/.aws/credentials
# Check if configuration have been added successfully
more ~/.aws/config
# Check if aws configuration is successful (It should show buckets in the accnt)
aws --profile [Profile Name] s3 ls

S3#

Under Object Storage, select target bucket, choose connect info, look for path.

# List files in S3
aws --profile [Profile Name] s3 ls s3://<bucket>/<path>/<path of file>
# Copy files to s3
aws --profile [Profile Name] s3 cp <path of file on local disk> s3://<bucket>/<path>/<path of file>
# Sync folder to s3
aws --profile [Profile Name] s3 sync <path of file on local disk> s3://<bucket>/<path>

Note: For GIS ronin, you won't be able to use aws s3 ls (Access denied). Instead, you need to specify the specific bucket. Retrieve the configuration file which includes username, accessid and secret key. The username will look something like csbfivemod_admin_xxx where xxx is the name of the bucket.

# List files in S3
aws --profile [Profile Name] s3 ls s3://xxx

Add Users#

Connect to cyberduck#

SFTP into AWS machine#

  1. Create a machine
  2. Create a .pem file
  3. Change the permission of the .pem file to 700 using chmod
  4. ssh -i <pem file> <username>@<machine address>

For example, ssh -i ~/GIS/ronin/csb5-jon.pem ubuntu@kraken.genome.sg