Skip to content
smorken edited this page Oct 6, 2017 · 18 revisions

AWSBootStrapper is a set of python scripts for automating EC2 and S3 tasks. This script is based on (and requires) the boto3 package.

Links:

boto3 on pypi

boto3 documentation

Setup

When running this script locally it derives AWS permissions from your AWS access key

In windows setting the environment variables “AWS_ACCESS_KEY_ID” and “AWS_SECRET_ACCESS_KEY” with the values for your AWS access key will allow boto3 to interact with AWS using your credentials.

Workflow

1. Upload files to S3

uploader.py --manifest ./manifest.json --localWorkingDir ./temp

The documents for upload referenced in the manifest, and the manifest itself, are uploaded to AWS S3. The specified localWorkingDir is used to create temp files for compressing documents.

2. Launch

launcher.py --manifest ./manifest.json --instanceConfigPath ./instanceConfig.json --localWorkingDir ./temp

All instances enumerated in the manifest are created and started. All instances are configured using values in instanceConfig.json, and instance specific commands, such as documents to download, and jobs to run are specified in manifest.json

3. Download

downloader.py --manifest ./manifest.json --instanceConfigPath ./instanceConfig.json --localWorkingDir ./temp

The documents for download referenced in the manifest, are downloaded from AWS S3 to the local paths specified for each document. The specified localWorkingDir is used to unpack compressed files before copying to the final path.

Manifest file path

The manifest file describes the instance commands to run and S3 documents. The path to this file is one of 2 arguments to the scripts in awsbootstrapper. documentation

Instance Config file path

The instance config file contains boto3 configuration for launching instances via the boto3 create_instances command