GithubHelp home page GithubHelp logo

easyawsenv's Introduction

Easy Environment in AWS

This project helps you set up instances with configurations quickly in AWS

Prerequisites

it only requires a configuration file(.ini) providing the instance information. Refer to myinstance.ini in the folder InstanceSample. The file consists of the following part:

[GLOBAL]
...
[INSTANCE1]
...
[INSTANCE2]
...

Every section stands for an instance with its parameters, except GLOBAL which has the shared parameters for all the instances, which means the parameters under the section GLOBAL are for all the other sections, and they'll override the parameters under the other sections if they have the same parameter names.

These are the parameters required for an instance.

parameter name description example
ImageId the image id for the instance, it should be quoted if it is a tring, it can also be the value used in cloudformation template ImageId="ami-221dcb4f"
InstanceType the instance type InstanceType=m1.large
DiskSize the disk size DiskSize="60"
SubnetId the subnet id. it should be quoted if it is a tring, it can also be the value used in cloudformation template SubnetId={ "Fn::ImportValue": "PreSubnet" }
Role the Role of the instance, the value depends on what template name you'll use. If it's template_instance, you can just set it to Default; if it's template_spotfleet, you should choose Dc for domain controler, Member for the members under the domain controller and Default if it is an independent one. Role=Default

These are optional parameters

parameter name description example
InstanceName the instance name InstanceName=myinstance_dc
DC the section name of the domain controller that current instance will join DC=dc
InstanceRoleProfile the instance profile for the instance, it should be quoted if it is a tring, it can also be the value used in cloudformation template InstanceRoleProfile={ "Fn::ImportValue": "PreRoleProfileName" }
Step* the Powershell scripts for instance configuration, the scripts will be executed ordered by the number after "Step", e.g. step1, step2 ..., Restart-Computer is allowed among the steps;the scripts should not be as simple as possible; complicate scripts is recommended to be stored somewhere, downloaded and executed within the steps Step1=Get-Host, step2=restart-computer

You can also have self defined parameters, and all the parameters will be set as environment variables of Windows system that can be used for later configuration.

Generate Cloudformation Template

Clone this repository

Git Clone https://github.com/DellHenryHan/EasyAWSEnv.git

Generate Cloudformation template with powershell, select proper templates according to the way you start instance, use the ini file described above. The target file will be %temp%\temp.json, you can also specify it with the parameter -outfile

. .\file_handler.ps1
Make-CfFile -IniFile .\myinstance.ini -templatePath .\templates_instance

Start specific instances

Go to AWS console for Cloudformation and create a stack with the template generated. Wait for the launch and the instances

easyawsenv's People

Contributors

dellhenryhan avatar

Watchers

James Cloos avatar  avatar Gump Yi 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.