Coder Social home page Coder Social logo

run-ec2's Introduction

BlueHat Tech EC2 instance creation shell script!

This shell script creates EC2 instances and, in addition, during the process performs the following tasks:

  • Creates group security with rules
  • Create a key pair
  • Adds tags on Instance, Group Security and instance volumes
  • Read a powershall userdata where it change the hostname and administrator password for Windows 2016 or higher

To choose which region the instance will be created in, run aws configure , and specify the region as shown below:

aws configure
AWS Access Key ID [****************5JKA]:
AWS Secret Access Key [****************WcJ0]:
Default region name [us-east-1]: us-east-2
Default output format [json]: 

See, that I just hit Enter for the first two options, because I already have my AWS connection set up. And I specified us-east-2 as a new region. If you are not yet connected to AWS, search for the aws configure command to see how to establish a connection with AWS.

Notes:

  • Before running this shell script, open the code and try to understand what it does. Change it as needed.
  • The userdata here is for Windows only.
  • If an error appears saying that the SubnetId does not exist, it can be for two reasons: 1- It does not really exist. 2- You can be in the different region of the SubnetId that you specified. Which may be the most common mistake.
  • When choosing the option to use the password defined in userdata, wait at least 3 minutes before trying to make an RDP connection.
  • If the option of random password with key pair is chosen, in addition to displaying a cryptographic key in the terminal, a file will be created with the content of the key in the same directory as this script, in the following format: hostname-keypair.pem

To use this shell script, enter the following commands:

git clone https://github.com/marceloeliassantos/run-ec2
cd run-ec2
chmod +x run-ec2.sh
./run-ec2.sh

See the tutorial video for this script on youtube

Visit my Blog https://bluehat.site/

run-ec2's People

Contributors

marceloeliassantos avatar

Stargazers

 avatar

Forkers

igoralves1

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.