Giter VIP home page Giter VIP logo

fetch-rewards-coding-exercise's Introduction

Description

This submission consists of a deployer script that deploys instances in AWS using a YAML specification.

Implementation Notes:

  • Deployer script reuses user scoped credentials stored in ~/.aws/credentials via boto3
  • Default VPC and Security group should allow inbound traffic on port 22
  • jsonschema is used to validate the YAML structure

Steps to Run Locally

Install Dependencies

user@user-MacBook-Pro fetch % pip3 install -r requirements.txt
user@user-MacBook-Pro fetch % pip3 install awscli

AWS Configure

user@user-MacBook-Pro fetch % aws configure
AWS Access Key ID [****************ABCD]: KEY-HERE
AWS Secret Access Key [****************ABCD]: KEY-HERE
Default region name [us-west-2]:
Default output format [None]:

Sample Deployment Specification:

---
server:
  instance_type: t2.nano
  ami_type: amzn2-ami-hvm
  architecture: x86_64
  root_device_type: ebs
  virtualization_type: hvm
  min_count: 1
  max_count: 1
  volumes:
    - device: /dev/xvda
      size_gb: 40
      type: ext4
      mount: /
    - device: /dev/xvdf
      size_gb: 40
      type: xfs
      mount: /data
  users:
    - login: ec2-user
      ssh_key: # add public key here
    - login: my-test-user
      ssh_key: # add public key here

Running the Deployer

Usage:

user@user-MacBook-Pro fetch % python3 deployer.py
Usage: python3 deployer.py /path/to/file.yaml
user@user-MacBook-Pro fetch % python3 deployer.py spec.yaml  
INFO:botocore.utils:IMDS ENDPOINT: http://169.254.169.254/
INFO:botocore.credentials:Found credentials in shared credentials file: ~/.aws/credentials
INFO:root:Creating Instances with Deployer Tag deployer-2020-10-23T20:29:58.868030
INFO:root:Will create 2 block devices
INFO:root:Lunching Instances
user@user-MacBook-Pro fetch %

Screenshots

Running the Deployer Script Locally:

Run Log

Instance Deployed in AWS Console

AWS Console

ec2-user being able to write to /data

AWS Console

my-test-user being able to write to /data & see ec2-user's file

AWS Console

fetch-rewards-coding-exercise's People

Contributors

apurvah avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.