Git Product home page Git Product logo

eil's Introduction

eil

Ec2 Instance Launcher

usage

The bash script requires the following binaries: jq, aws, ssh, curl.

Set up your AWS credentials

$ aws configure --profile eil
# access key
# secret key
# region

then, run ./eil.

alternative docker usage

To avoid requiring the dependencies locally, there's a docker image with all the binaries. From the root of this repo,

$ docker pull gempesaw/eil:deps
$ docker run -it --rm --entrypoint sh -v $(pwd):$(pwd) -w $(pwd) gempesaw/eil:deps

and then once inside the docker image, you're back at the usage instructions:

$ aws configure --profile eil
$ ./eil

example output

bash-3.2$ ./eil
creating security group acsrCcuK-sg...
opening acsrCcuK-sg security group ports 22 & 80
creating key pair acsrCcuK-key


starting instance...
waiting for instance i-0f77c960c7ad7cc68 to be running...
i-0f77c960c7ad7cc68 is running with public dns ec2-34-254-96-222.eu-west-1.compute.amazonaws.com.


connecting to i-0f77c960c7ad7cc68 at ec2-34-254-96-222.eu-west-1.compute.amazonaws.com to start server...
Warning: Permanently added 'ec2-34-254-96-222.eu-west-1.compute.amazonaws.com,34.254.96.222' (ECDSA) to the list of known hosts.
sleeping a bit to let server start...
testing server via curl:
* Rebuilt URL to: ec2-34-254-96-222.eu-west-1.compute.amazonaws.com/
*   Trying 34.254.96.222...
* TCP_NODELAY set
* Connected to ec2-34-254-96-222.eu-west-1.compute.amazonaws.com (34.254.96.222) port 80 (#0)
> GET / HTTP/1.1
> Host: ec2-34-254-96-222.eu-west-1.compute.amazonaws.com
> User-Agent: curl/7.54.0
> Accept: */*
>
* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: SimpleHTTP/0.6 Python/2.7.14
< Date: Thu, 12 Jul 2018 14:52:03 GMT
< Content-type: text/html
< Content-Length: 12
< Last-Modified: Thu, 12 Jul 2018 14:51:58 GMT
<
hello world
* Closing connection 0


the following may be useful for cleanup:

aws ec2 terminate-instances --instance-id i-0f77c960c7ad7cc68 && \
aws ec2 wait instance-terminated --instance-ids i-0f77c960c7ad7cc68 && \
aws ec2 delete-security-group --group-name acsrCcuK-sg && \
aws ec2 delete-key-pair --key-name acsrCcuK-key && \
rm -f acsrCcuK-key.pem

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.