Code Monkey home page Code Monkey logo

cyoi's Introduction

Choose Your Own Infrastructure

A library to ask an end-user to choose an infrastructure (AWS, OpenStack, etc), region, and login credentials.

This library was extracted from inception-server for reuse by bosh-bootstrap. It might also be useful to your own CLI applications that need to ask a user to give you their infrastructure credentials/region so your application can control their infrastructure (say via fog).

Build StatusCode Climate

When you use the library, your application will attempt to guess what infrastructure/credentials the user will use (via ~/.fog) and then fall back to prompting for remaining information:

Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
1. AWS (default)
2. AWS (starkandwayne)
3. Alternate credentials
Choose infrastructure:  3

1. AWS
2. OpenStack
Choose infrastructure:  1


Using provider aws:

1. *US East (Northern Virginia) Region (us-east-1)
2. US West (Oregon) Region (us-west-2)
3. US West (Northern California) Region (us-west-1)
4. EU (Ireland) Region (eu-west-1)
5. Asia Pacific (Singapore) Region (ap-southeast-1)
6. Asia Pacific (Sydney) Region (ap-southeast-2)
7. Asia Pacific (Tokyo) Region (ap-northeast-1)
8. South America (Sao Paulo) Region (sa-east-1)
Choose AWS region: 2

Access key: KEYGOESHERE
Secret key: SECRETGOESHERE

Confirming: Using aws/us-west-2

Usage

provider_cli = Cyoi::Cli::Provider.new([settings_dir])
provider_cli.execute!
settings = YAML.load_file(File.join(settings_dir, "settings.yml"))

settings["provider"]["name"] # aws, openstack
settings["provider"]["region"] # us-east-1
settings["provider"]["credentials"] # aws or openstack URLs & credentials

Installation

To use as a stand-alone CLI, install the rubygem:

$ gem install cyoi

To use it as a library within your own application, add this line to your application's Gemfile:

gem "cyoi"

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
  6. Send @drnic a big bag of Doritos

cyoi's People

Contributors

drnic avatar frodenas avatar markkropf avatar mstine avatar

Watchers

 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.