Giter Club home page Giter Club logo

machine-cloudformation's Introduction

AWS Cloud Formation Driver for Docker Machine

##Setup First you want to make sure you have a valid cloud formration script. You can either use (this one)(https://github.com/jeffellin/machine-cloudformation/blob/master/cloudformation/docker.json) as a starting point to create your own. The file is JSON an can be edited either using your favorite text editor or the visual editor within the AWS console.

You may want to test the cloud formation script in the AWS console before running it with docker-machine.

Once you have your script you will need to upload it to an S3 bucket. Make sure that the bucket used is in the same region you will be running cloud formation from. Even though you supply the full S3 URL cloud formation cannot find it if it is located in another region.

The cloud formation driver must be in S3 and cannot exist in on your local file system.

###Installing the Driver Currently the driver is compiled against docker-machine .5.4. You can download the binary from Github Either copy the binary to the same location as docker-machine or add its location to your PATH variable.

###Credentials The driver uses the GO SDK for AWS. This means that the credentials can be in any of the standard locations that AWS tools expect. If you have the AWS CLI simply running aws configure is sufficient. Otherwise you will want to set the following environment variables.

Variable Description
AWS_SECRET AWS Secret
AWS_SECRET_KEY Aws Secret Key
AWS_REGION Aws region, e.g. us-east-1

The IAM credentials used should have enough privileges to invoke cloud formation API.

###Available Driver Options

Option Name Description Default Value required
cloudformation-url The url of the cloud formation you wish to use. none yes
cloudformation-keypath The path to the private key to use none no
cloudformation-keypairname The name of the private key pair on AWS none no
cloudformation-useprivateip Use the private IP to communicate with the instance false no
cloudformation-parameters Key value pairs of additional parameters to pass to cloud formation none no
cloudformation-ssh-user username for ssh ubuntu no
cloudformation-tags Tags to provide to cloudformation none no

Parameters are passed using the extraparams option and must be in the following format.

KeyName=KeyValue.

Multiple parameters can be passed using a comma (,) as a separator.

e.g. InstanceType=t1.micro,EBSOptimized=false

Tags can be passed in the same way.

e.g. Owner=jeff

docker-machine create --cloudformaiton-url https://s3.amazonws.amazon.com/somebucket/cloudformation.json --cloudformation-keypairname mykey --cloudformation-keypath /Users/jellin/.ssh/id_rsa

Once the machine is started you can work with it as you would a normal docker-machine.

Use the env, ip, stop, start commands as normal.

You can even remove the stack with the docker-machine rm command. Removing the docker machine will destroy all resources that cloud formation created.

##Building the driver checkout the driver to $GOPATH/src/github.com/jeffellin/machine-cloudformation

install the dependencies using glide

glide install

Run the make script within to build the driver binary.

make build

#foo1

machine-cloudformation's People

Contributors

jeffellin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 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.