GithubHelp home page GithubHelp logo

kaynenotkanye / create-ec2 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 3.92 MB

CLI to create a new EC2 instance with any custom userdata script. Written in Go, using AWS SDK.

Go 84.79% Shell 15.21%
aws ec2 aws-sdk awssdk golang go cli

create-ec2's Introduction

Golang app to create EC2 from AMI

This is a Golang app that will launch an EC2 instance from a source AMI while also passing along a userdata script upon EC2 launch.

Example usage

The following command will create an EC2 based off of ami-abcd1234 in the us-west-2 region placed in subnet-abcd1234 (notice that we only need subnet-id and not VPC ID) assigned to security group sg-abcd1234 while passing along the sampleUserData.txt file with the instance type of t3.medium.

create-ec2 -r us-west-2 \
-n NameOfEC2instance \
-i ami-abcd1234 \
-u sampleUserData.txt \
-k MyKeyPair \
-v subnet-abcd1234 \
-s sg-abcd1234 \
-t t3.medium

The following command is essentially the same, except it passes in the ami ID through a text file (the typical usage for this is through a CI/CD pipeline as the ami.txt can be from a build artifact, or even passed along from another pipeline.)

create-ec2 -r us-west-2 \
-n NameOfEC2instance \
-i $(cat ami.txt) \
-u sampleUserData.txt \
-k MyKeyPair \
-v subnet-abcd1234 \
-s sg-abcd1234 \
-t t3.medium

create-ec2's People

Contributors

kaynenotkanye avatar

Stargazers

 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.