Create an AWS stack
Introduction
This guide will help you build an AWS stack. Amazon Web Services (AWS) offers a suite of cloud-computing services that make up an on-demand computing platform in several geographically distributed data centers.
You can configure the number of VMs and applications installed on each VM instance. Along with configuring VM size and region. Your new team members will be able to use your stack to build their VMs environment and start working from day one.
Step by step guide
-
Click Stacks
-
Click New Stack
-
Choose Amazon Web Services and click Create Stack
-
You will now see the default stack template for AWS. You can give your stack a name by clicking on the Edit Name on top beside your stack title. The three tabs represent:
- Custom variables: define custom variables to use in your stack template, hidden from Team members
- Readme: this text will be shown in a message box when your team starts to build this stack. You can add instructions or notes for your team to read
- Credentials: add your AWS account credentials here
Review the Stack Template file to add/modify/remove any of your VM configurations
You can add commands to run once your VM starts under the user_data section. For example you can choose to install services/packages once a VM starts. Commands under the user_data section will run as
root
when the VM boots.Click on the stack name to return to your Stack template editor.
-
Edit your Readme section to greet your team and provide them with information or instructions. You can use markdown format
-
Go to the Credentials tab and click Add A New Credentials
-
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
If you do not have an AWS account yet, please create one on Amazon AWS here aws.amazon.com. After you login:
- Make sure you subscribe to EC2 service on AWS Console
- Click Services (top left) -> EC2
- To generate your Credentials keys follow first 5 steps at the bottom of this AWS guide .
Add your AWS Credentials
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 guide to know which roles should be assigned for this user in order to use the credentials and build your stack successfully.
- Title: add a name to your key pairs, the title is a name for your reference it can be any name you want make it something easy to remember your credentials with.
- Access Key ID: your AWS access key id
- Secret Access Key: your AWS secret access key id
- Region: the data center location where you want your VMs to be created in
When you are done please click Save This & Continue.
-
Your AWS credentials will be verified and you will be directed back to the Stack Template editor. Also the red exclamation mark that used to appear beside your Credentials tab should disappear. Click SAVE to save your stack and test your stack template file, it should save successfully
-
Click Initialize to initialize your stack
You can have multiple stacks within a team, click Make Team Default when you want to make this stack your team’s default stack.
-
The build stack modal will appear, the Instructions tab will include the message you wrote in your Read Me tab. Click Next to continue
-
Click on Build Stack to start building your Stack
You can have multiple saved credentials to use within a team, the Credentials tab in your Build stack modal allows you to choose the one you want to use with this stack template.
Your stack will start building..
-
Your stack was successfully built. Click Start Coding to start using your new VM
Congratulations, you can now start working on 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:
# 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
See more options and information for creating an AWS instance here AWS_INSTANCE.