Building the Test Automation Framework Building the Test Automation Framework Module 1 : A Practical Introduction to Amazon Web Services for Testers
Building the Test Automation Framework
Building theTest Automation Framework
Module 1 : A Practical Introduction to Amazon Web Services for Testers
The Test AutomationFramework
Building the AWS Environment
1. Creating an AWS Account
2. Configuring Security Groups
3. Creating Key Pairs
4. Creating Virtual Machines (Instances)
5. Connecting and configuring Putty / SSH
6. Monitoring Usage
Six Key Aspects to Setting Up AWS
Why Use AWS?
1. It’s fast to get setup
2. No provisioning hardware and installing operating systems
3. Increase capacity or shut down on demand
4. Pay only what you useNo buying everything up front and having kit sitting around dormant
Prerequisites
1. Windows machine with RDP or MAC equivalent
2. Credit Card
3. Your Telephone number
Module PartsPart 1: Creating an AWS Account
Part 2: AWS Fundamentals
Part 3: Configuring Security Groups
Part 4: Creating a Security Key Pair
Part 5: Running up the Windows Instance
Part 6: Running up the Ubuntu Unix Instance
Part 7: Connecting to the Windows Master Machine
Part 8: Installing Putty and SSH
Part 9: Connecting to the Unix Client Machine
Part 10: The Difference Between Terminate and Stop
Part 11: How to Check Your AWS Spend
PART 1:Creating an AWS
AccountClick the button here:
http://aws.amazon.com/
A few points on signing up:
Then you’ll have access to the AWS Management Console
1. you will need to provide a valid telephone number2. you will need to provide valid credit card details3. select the free support plan
PART 2:AWS Fundamentals
● Services: A service can be thought of as the type of work a particular cloud resource provides.
● Zones and Regions: Amazon provisions these services in data centers located in different regions
● Management Console: console gives you the ability to start, configure and manage the services you need
● EC2: the service that delivers resizeable computing capacity
● EC2 Instances: Each virtual machine you run up is referred to as an ‘instance’
● EC2 Instance Types: defines the the CPU, memory, storage and networking capability of the ‘Instance’
● Images and AMIs: capability to start the machine with a predefined image already installed
● Elastic Block Store and Volumes: service that provides storage volumes that can be attached to running ‘Instances’
● Network and Security: ‘Instances’ are created in your own Virtual Private Cloud (VPC)
● Security Groups: security group contains a set of fire wall rules which can then be associated with your ‘Instances’
● Key Pairs: used to encrypt and decrypt login details (e.g. passwords).
PART 3:Configuring Security
GroupsYou can configure security groups by following these steps….
1. select your region
2. on the Management Console home page click the “EC2” icon
3. on the EC2 page click on “Security Groups” menu item
4. on the security groups page click the ‘Create Security Group’ button
NOTE: you’ll see under security groups that by default you already have one security group created. This group will have a source id that refers to the same security group id (e.g. sg-xxxxx). It’s a circular reference if you like but just means that any instances in this security group can access any other instances in the same security group.
PART 4:Creating a Security
Key PairYou can create a key pair by following these steps….
1. on the EC2 Dashboard page click on “Key Pairs” menu item
2. on the key pairs page click the ‘Create Key Pair’ button
3. give the Key Pair a name (e.g. FirstKeyPair)
4. at this point you should be prompted to download the .pem file
5. click okay and save the .pem file somewhere safe
NOTE: The private key you obtain from this process you’ll need to keep safe. We’ll need it later in the process. It’s used to decrypt the windows password and to login to the Unix machine using SSH/Putty.
PART 5:Running up the
Windows InstanceFour pieces of information we need:
AMI – Microsoft Windows Server 2008 R2 Base – ami-c5a7bea4Instance Type – t2.microSecurity Group – Windows-Master (we created this earlier)Private Key – .pem file (from our key pair created earlier)
Eight steps to create our Windows Instance:Step 1: select the AMI listed above (2008 R2 Base – ami-c5a7bea4)Step 2: select the Type listed above (t2.micro)Step 3: accept all the ‘Instance Config’ defaultsStep 4: accept all the ‘Storage’ defaultsStep 5: [optional] add a tag for the Name if you like (e.g. Windows-Master)Step 6: for the security group we’ll need to:Step 6a: Select an existing security groupStep 6b: Check the ‘Windows-Master’ security group ANDStep 6c: Check the ‘default’ security group *Step 7: Review and then ‘Launch’Step 8a: Choose an existing key pair and select the ‘FirstKeyPair’Step 8b: Acknowledge the warning and click ‘Launch Instances’
PART 6:Running up the Ubuntu
Linux InstanceFour pieces of information we need:
AMI – Ubuntu Server 14.04 LTS (HVM), SSD ami-5189a661Instance Type – t2.microSecurity Group – Unix-AUT (we created this earlier)Private Key – .pem file (from our key pair created earlier)
Eight steps to create our Ubuntu Instance:Step 1: select the AMI listed above (Ubuntu Server 14.04 LTS*)Step 2: select the Type listed above (t2.micro)Step 3: accept all the ‘Instance Config’ defaultsStep 4: accept all the ‘Storage’ defaults*Step 5: [optional] add a tag for the Name if you like (e.g. Unix-Client)Step 6: for the security group we’ll need to:Step 6a: Select an existing security groupStep 6b: Check the ‘Unix-AUT’ security group ANDStep 6c: Check the ‘default’ security groupStep 7: Review and then ‘Launch’Step 8a: Choose an existing key pair and select the ‘FirstKeyPair’Step 8b: Acknowledge the warning and click ‘Launch Instances’
NOTE: this instance does not come with EBS storage. Storage is temporary storage.
PART 7:Connecting to the Windows Master
Machine
1. To connect to your Windows machine right click on the Instance and select ‘Connect’
2. Open the Remote Desktop Connection File
3. Enter your password and connect
PART 8:Installing Putty
for SSH
1. Open Internet Explorer within the RDP
session on your Windows server
2. Either search for Putty or enter this URL
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
3. Download the Putty Installer: putty-0.66-installer.exe
4. Run the installer selecting all the defaults
PuTTYgen: allows us to convert our .pem key Pagent: authentication agent PuTTY: Secure Shell client
PART 9:Connecting to the Unix
Client Machine
1. Convert you .pem key
2. Run Putty Agent and load your key
3. Start Putty and configure host
4. Connect with SSH
PART 10:The Difference Between
Terminate and Stop
You’ll notice in the management console that you have 2 options for bringing your servers down (both for Windows and Unix).
Stop: When an instance is shutdown you can restart the instance when you need it again. Things like instance ID, EBS storage, private DNS and private IPs are maintained and restored.
Terminate: If you terminate the instance everything is deleted. Terminate an instance if you no longer need it as you can NOT restart it or connect to it again.
PART 11:How to Check Your
AWS Spend
Within the AWS management console you’ll find a ‘Billing and Cost Management’ option:
In here you’ll see what your current balance is (should remain at $0.00 if you stay within your free tier constraints).