forked from koding/koding
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from kwagdy/master
add create new aws stack guide
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
layout: doc | ||
title: Create an AWS stack | ||
permalink: /docs/creating-an-aws-stack | ||
parent: /docs/home | ||
--- | ||
|
||
# {{ page.title }} | ||
|
||
## Introduction | ||
|
||
**Stacks** allows you to configure the number of servers and applications to install on each of the VMs. Your new team members will be able to use your stack to build their Koding VMs and start working from day one. | ||
|
||
## Step by step guide | ||
|
||
1. Click **STACKS** | ||
 | ||
2. Click **New Stack** button | ||
 | ||
3. The stack builder guide will open, click **Create A New Stack** | ||
 | ||
4. Click **amazon web services** and click **Next**  | ||
5. You can now choose your machine type and add any extra configurations or services that you want installed on your machine. | ||
- Machine Types | ||
1. t2.nano | ||
2. t2.micro | ||
3. t2.small | ||
4. t2.medium | ||
 | ||
6. Pull your project codebase, you can pull your code to your machine directly from one of the below providers. If you do not have your code hosted on any of them or you do not wish to pull your code now, click **Next**. | ||
 | ||
7. You can give your stack a name by clicking on the **Stack Name**. In this modal you will find _four tabs_: | ||
|
||
1. **Stack template**: configuration file for your VMs | ||
2. **Custom variables** to define custom variables to be used in your stack template | ||
3. **Readme** This text will be shown in a message box when your team uses this stack | ||
4. **Credentials** add your AWS credentials here | ||
8. Review the **Stack Template** (see point 6.1) file to add/modify/remove any of your VM configurations | ||
 | ||
**Note:** You will notice that the _Stack File_ will include the required commands to install your selected services/packages under the `user_data` section. You may further include any commands you want to run when the machine starts in the stack file under the same section. | ||
9. Edit your **Readme** (see point 6.3) file to greet your team and provide them with information about this particular stack  | ||
10. Go to the **Credentials** tab and click **Create New** | ||
 | ||
11. For this step you will need to have your Amazon AWS **Access Key ID** & **Secret Access Key**. You can generate and acquire yours from your AWS account. | ||
|
||
> **Tip** | ||
> If you do not have an AWS account yet, please create one on Amazon AWS here [aws.amazon.com](http://aws.amazon.com), login and make sure you subscribe to EC2 service on AWS console, click **Services** (top left) **-> EC2**. | ||
> Then <span>_follow first 5 steps_ at the bottom of this [AWS guide ](http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html)to generate your keys. | ||
> **Alert** | ||
> If you followed AWS recommended tip on creating an IAM user rather than using your AWS root user account to generate the crednetials, you need to make sure your new IAM user has enough privileges to create EC2's. Please follow our [Setup AWS IAM user](/docs/setup-aws-iam-user) guide to know which roles should be assigned for this user in order to use the credentials to build your stack successfully. | ||
- Add a **Title** to your key pairs - _the title is a name for your reference it can be any name you want._ | ||
- Add your AWS keys - **Access Key ID** & **Secret Access Key**. | ||
- Choose a **Region** - (data center location) where you want your VMs to be created. | ||
When you are done please click **Save**. | ||
 | ||
|
||
12. Click **USE THIS & CONTINUE** to use your AWS keys, you should see your key highlighted with "**IN USE**" if all went well. You can also **show** and **delete** your AWS keys when you hover your mouse over your AWS key.  | ||
13. You will be directed to the Stack Template section. Click **SAVE** to save your stack and test your stack configuration file  | ||
14. Click on **Build Stack** and your new Stack will start building..  | ||
Stack building..  | ||
15. Congratulations, your Stack was successfully built and you can now use your new VM  | ||
|
||
## Advanced notes for creating an AWS Stack | ||
|
||
This is an example stack script the defines the drive size which you can use with your AWS Stack: | ||
|
||
```yaml | ||
# Here is your stack preview | ||
# You can make advanced changes like modifying your VM, | ||
# installing packages, and running shell commands. | ||
|
||
provider: | ||
aws: | ||
access_key: "${var.aws_access_key}" | ||
secret_key: "${var.aws_secret_key}" | ||
resource: | ||
aws_instance: | ||
# this is the name of your VM | ||
my_instance_name: | ||
# select your instance_type here: eg. c3.xlarge | ||
instance_type: t2.micro | ||
# customize details about the root block device of the instance | ||
root_block_device: | ||
# define the size of the volume in gigabytes | ||
volume_size: 12 | ||
user_data: |- | ||
df -h | ||
``` | ||
> **Tip** | ||
> See more options and information for creating an AWS instance here [AWS_INSTANCE](/docs/aws_instance). |