AWS Lab Practice Guide by WWW - Server-Computer - Com - v1
AWS Lab Practice Guide by WWW - Server-Computer - Com - v1
Document has been prepared for lab practice only not for production deployments
Prepared for:
Public
Prepared by:
Ankam Ravi Kumar
Table of Contents
1. About Author .................................................................................................................................................................. 5
2. Services we provide to our customers ............................................................................................................................ 6
3. Cloud Computing Models................................................................................................................................................ 7
3.1. Infrastructure as a Service (IaaS): ............................................................................................................................... 7
3.2. Platform as a Service (PaaS): ....................................................................................................................................... 7
3.3. Software as a Service (SaaS): ...................................................................................................................................... 7
4. Amazon Free Tier Account Creation ............................................................................................................................... 8
5. Enabling Multi-Factor Authentication to Secure Your Access ...................................................................................... 12
6. Creating First Linux Instance ......................................................................................................................................... 16
7. Adding New EBS Volume to Linux Instance .................................................................................................................. 22
8. Creating Amazon Machine Image (AMI) ....................................................................................................................... 25
9. Create your First EC2 windows instance ....................................................................................................................... 27
10. Assigning Elastic IP Addresses to Instance (Static IP Address) .................................................................................. 31
11. Amazon Elastic File System ....................................................................................................................................... 32
12. Launching RDS Instance ............................................................................................................................................ 34
13. Accessing MySQL Instance Using Workbench .......................................................................................................... 43
14. AWS S3 Bucket – (Object Storage) ............................................................................................................................ 48
14.1. AWS S3 Lifecycle Management............................................................................................................................. 50
14.2. S3 Bucket Replication to Cross-Region ................................................................................................................. 53
14.3. S3 Bucket Policies to control Access ..................................................................................................................... 54
15. VPC – Virtual Private Cloud (isolated Network) ........................................................................................................ 55
15.1. Create subnets ...................................................................................................................................................... 58
15.2. Create Internet gateway and attach to VPC ......................................................................................................... 59
15.3. Create Virtual Private Gateway and Attach to VPC .............................................................................................. 59
15.4. Create route tables and attach to subnets ........................................................................................................... 60
16. AWS Elastic Load Balancer (ELB) ............................................................................................................................... 63
17. AWS CloudTrail – Enable Governance and Auditing ................................................................................................. 67
17.1. How to Create CloudTrail ...................................................................................................................................... 67
18. Athena Analytics ....................................................................................................................................................... 68
19. Auto Scaling............................................................................................................................................................... 70
19.1. Launch configuration ............................................................................................................................................ 70
Table of Contents 2
Table of Contents 3
Table of Contents 4
1. About Author
Ankam Ravi Kumar has more than 10+ years of experience in Information Technology
Operations and production support streams. He served more than 5 companies in his career and
still continuing.
We provide server and data center related services from purchasing of underlying hardware to
provisioning the applications.
Operating System Management Such has Linux Different Flavors, Red hat, Fedora,
Ubuntu, AIX, Solaris and Windows
Enterprise Server Management
Installing and configuring Blade Servers
Core Storage Management Dell-EMC, IBM and NetApp
Database Management MSSQL, POSTGRESQL, MariaDB and MySQL
Process Management ITIL
Virtualization management RHEV, vSphere, VMware, KVM, Hyper-V and XEN
Backup and Recovery Management NetVault, Commvault and Symantec Backup Exec
Application Server Management and Storage Cluster Management
Data Center Management and Hosting Solutions
Programming Languages such as PHP and HTML
Scripting Languages Shell, Perl and Python
Specialized in managing and building the Teams for IT services delivery and Service Support,
Training and Operations in both smaller and larger companies. Rich experience and strong
exposure in IT Infrastructure & Data Center Management.
Implementation of monitoring solutions for Enterprise, Using Tools Nagios, NagiosXI, Cacti,
Solarwinds and LogicMonitor.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 5
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 6
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
There are three main models for cloud computing. Each model represents a different part of
the cloud-computing stack.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 7
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
https://aws.amazon.com/free/
Prerequisites:
https://aws.amazon.com/console/
Click on
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 8
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Provide your credit card details correctly, Card Number, Expiry Date and Card Holder Name
Click on Secure Submit
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 9
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
It will ask you to enter phone number, Security check then click on Call Me Now
You will receive a call from AWS tele communication and ask you to enter the code displayed
on screen.
Note: Listen All the Details carefully and proceed by entering code displayed on screen.
After successful verification
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 10
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Continue
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 11
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
You successfully completed Free Tier Account Creation. Login and Enjoy AWS Free Tier.
AWS Console
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 12
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Programmatic Access – Required for automation, run any operation using programs
AWS Management Console Access – User will have web console access
User creation has been completed successfully now you will get on access URL with your account number. Note the URL.
Use any method based on your requirement. Here I am showing Virtual MFA Device method
Click Continue
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 15
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click in Show QR Code and scan the same code from your Google authenticator App. It will generate six digit codes enter
one code in first MFA code 1 wait 1 minute and second code in MFA Code 2 Click on Assign MFA
Here after if you want to login, you have to enter credentials and MFA code to Login.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 16
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 17
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Add storage – EBS Elastic Block Storage volume will attached to your instance
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 18
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
For the first time you create a new key pair and Download Key Pair
Launch Instances
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 19
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Install putty msi installer you will get PuttyGen and Putty for accessing Linux machine
Click Ok.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 20
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click on Open
As example, we are going to install web server in Linux server and access using web browser
https://github.com/techtutorials/aws-lab-guide/blob/aws/webserver.sh
You can also use above shell script to automatically build webserver for you
sudo yum update –y;
sudo yum install httpd –y;
sudo service httpd start;
sudo service httpd status;
sudo chkconfig httpd on;
Open browser and type your instance public IP address you can access web-server test page.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 21
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Remember maximum size of EBS volume is 16TB, Select appropriate AZ, if you want to create a volume using existing
snapshot select from snapshot ID drop down list. Tick mark Encryption to encrypt data inside volume automatically.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 22
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Add tags for easy identification later point of time and click Create Volume
Select created EBS volume to attach to the EC2 instance Click Actions Attach Volume
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 23
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
In order to format and create new partition use below commands (shown in screenshot)
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 24
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 25
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
A template for the root volume for the instance (for example, an operating system, an application server, and
applications)
Launch permissions that control which AWS accounts can use the AMI to launch instances
A block device mapping that specifies the volumes to attach to the instance when it's launched
First, follow above steps to create EC2 instance, modify all the required settings, and install required applications. Right
click on instance Image Create Image
Provide Image name (Easy to Identify), Image Description and Click Create Image
Go to EC2 AMIs
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 26
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Select appropriate details Click Next: Add Storage Next: Add Tags Next: Configure Security Group Review and
Launch Launch
Note: Storing AMI will be charged based on your EC2 instance size.
Choose an Instance Type General Purpose (t2.micro) Click Next: Configure Instance Details
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 27
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Add Tags to identify instance details Like Name, Purpose, Account and so and so
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 28
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 29
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click connect and type user name and password you are connected to your EC2 windows instance.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 30
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
However, after stop and start of instance assigned public IP address will release to the amazon free pool
If would like to assign an static public address then navigate to Elastic IP’s
EC2 console right side bar go down Elastic IPs Allocate New Address
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 31
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Note: If you have, multiple interfaces to the instance click on Radio button Network Interface and select correct NIC
card name and Local IP Address.
Now your existing instance has static Public IP address, if you restart your instance also you will get same IP address until
you detach from instance.
Amazon EFS supports the Network File System version 4 (NFSv4.1 and NFSv4.0) protocol, so the applications and tools
that you use today work seamlessly with Amazon EFS. Multiple Amazon EC2 instances can access an Amazon EFS file
system at the same time, providing a common data source for workloads and applications running on more than one
instance or server.
Services EFS
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 32
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 33
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Login to EC2 Linux instance and mount EFS using below commands
# sudo yum –y install nfs-utils*
# sudo mount –t nfs4 IP_ADDRESS_OF_EFS:/ MOUNTPOINT
Login to AWS Console and Click on services to list all services. Navigate to Database RDS
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 34
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Now we are going to create a new Database instance with empty database
Amazon will support below 5 types of Relational database engines as managed services
Select any one of the database engine, which you want to launch and Click Next
Note: Careful if you are using free tier account. MSSQL and Oracle are charged.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 35
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Choose appropriate usage of your instance. In this scenario, I am using Dev/Test instance Click Next
Note: If you select Free Tier. Selected version and options will overwritten free options.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 36
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 37
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Provide
DO NOT FORGOT TO SELECT IF YOU’RE USING FREE TIER OTHERWISE YOU WILL BE CHARGED
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 38
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
If you want access database from remote machine put “Public Accessibility” Yes
Choose existing VPC security groups if you have already or it will create new security group for this instance access.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 39
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Provide database name, default port number is 3306 you can even customize the port number if you want.
Enabling IAM DB Authentication. IAM Users also can access your instance based on IAM policies.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 40
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
If you have particular backup window for database select it otherwise leave it default.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 41
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 42
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
https://dev.mysql.com/downloads/workbench/
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 43
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 44
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 45
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click on Database name and come down copy the Endpoint URL
Click OK
After successful creation, Click on Connection it will ask you for the password
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 46
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Successfully launched MySQL RDS Instance and accessed via MySQL Work bench.
If you know much more database queries like select, insert and delete statement try doing more. Good Luck.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 47
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click on
Provide bucket name, it should be a unique name. To Access your S3 bucket over internet it will create DNS entry.
Click Next
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 48
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Keep All Version of object means it will not delete any files if you upload same file multiple times. It will keep all
the files as multiple versions
Log Requests for access to your bucket option will log all the actions users did on this particular S3 bucket
Object-level Logging used to monitor all the object level modifications. Additional cost.
Encryption You can encrypt S3 bucket data or Encrypt and upload the data either way your data is encrypted.
Object Lock
Cloudwatch request metrics for monitoring purpose
Click Next
AWS recent update is to block public access by default, if you want to enable public access to your S3 bucket un-check all
above tick marks.
Still you can provide access to other users on bucket level and object level.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 49
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click Next
Your S3 bucket created successfully. Click bucket name you will see all the options
https://s3.ap-south-1.amazonaws.com/server-computer-bucket
You can manage an objects lifecycle using this feature/rule, which defines
Click Next
Current Versions
Previous Versions
Based on selected versions action will be performed example if you want to keep current versions in A1 or maybe
previous versions on Glacier as per your requirement
Click Next
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 51
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Explanation: Previous versions of files after 365 days means one year permanently delete from S3 bucket.
Click Next
Click Save.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 52
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click Next
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 53
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click Next
Select existing IAM Role or Create new for replication. In this case, I am creating new role for replication called Test
Click Next
https://awspolicygen.s3.amazonaws.com/policygen.html
Go to this above URL and generate policy if you do not know how to write a S3 bucket policy
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 54
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 55
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
EC2 Instance
Internet Gateway
Availability Zone
VPC subnet
Architecture Explanation:
Four Subnets Two Are Public and Two Are Private subnets
Four instances Two App Servers, Two Database Servers
One Internet Gateway to access internet
One Virtual Private Gateway to Connect Corporate Office
Two routers one is connected to private subnets, another is connected to public subnets
We would like to host web application with two web app servers and two Database servers. Two Tier architecture. Web
app servers will serve to public, from public facing subnets. Database servers are in private network and only have
access to app servers and corporate network (VPG).
When Database servers want to download any kind of files/patches from internet it routes through NAT Gateway and
get the internet data from web app servers.
AWS Console Services Networking & Content Delivery VPC Your VPCs
Click Create
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 57
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 58
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 59
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
One route for Internet gateway, another for Virtual private gateway (R1-IGW and R2-VGW)
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 60
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Attach routing tables to subnets. R1-IGW to S3-Public and S4-Public, public network required to have internet access.
Attach R2-VGW to S1-Private and S2-Private (No internet become a private subnets)
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 61
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 62
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
1. AWS Cloud
2. Region
3. Availability Zone
4. VPC – Virtual Private Cloud
5. VPC Subnet
6. EC2 Instance Running Webserver
7. Elastic Load Balancer
8. Internet Gateway
Elastic Load Balancing (ELB) is a load-balancing service for Amazon Web Services (AWS) deployments. ELB automatically
distributes incoming application traffic and scales resources to meet traffic demands.
Distributes load incoming application traffic across multiple targets, such as amazon EC2 instances, containers, and
IP Addresses
Recognizes and responds to unhealthy instances
Can be public or internal-facing
Uses HTTP, HTTPS, TCP, and SSL Protocols
Each Load Balancer is given a public DNS name
o Internet-facing load balancers have DNS names which publicly resolve to the public IP Addresses of the load
balancer of the load balancers nodes
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 63
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
o Internal load balancers have DNS names, which publicly resolve to the private IP Addresses of the load
balancers nodes.
Types of ELB
ELB Practical
Follow EC2 Linux instance launch steps however in step two (configure Instance) go to down to the bottom in advanced
section add below script will create auto webserver
https://github.com/techtutorials/aws-lab-guide/blob/aws/webserver.sh
#!/bin/bash
sudo yum update -y
sudo yum install httpd* -y
sudo service httpd start
sudo chkconfig httpd on
echo '<html><h1>Hello, Welcome to Server1</h1></html>' > /var/www/html/index.html
sudo service httpd restart
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 64
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 65
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click Create
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 66
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Load Balancer DNS Name copy it and paste in web browser now fresh twice you will see response is coming from
Server1 and Server2
CloudTrail is enabled on your AWS account when you create it. When activity occurs in your AWS account, that
activity is recorded in a CloudTrail event. You can easily view recent events in the CloudTrail console by going to
Event history.
Visibility into your AWS account activity is a key aspect of security and operational best practices. You can use
CloudTrail to view, search, download, archive, analyze, and respond to account activity across your AWS
infrastructure. You can identify whom or what took which action, what resources were acted upon, when the
event occurred, and other details to help you analyze and respond to activity in your AWS account.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 67
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Note: If you want to audit all regions by default select “Yes” radio, button otherwise select “No”
Select S3 bucket where you want to store CloudTrail Logs. CloudTrail logs uses S3 bucket for storing audit logs.
If you did not have S3 bucket created, provide bucket name in storage location section by selecting “Yes” radio button, it
will create it for you. Select no if you have existing S3 bucket.
Click Create
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 68
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
accountId: STRING,
invokedBy: STRING,
accessKeyId: STRING,
userName: STRING,
sessionContext: STRUCT<
attributes: STRUCT<
mfaAuthenticated: STRING,
creationDate: STRING>,
sessionIssuer: STRUCT<
type: STRING,
principalId: STRING,
arn: STRING,
accountId: STRING,
userName: STRING>>>,
eventTime STRING,
eventSource STRING,
eventName STRING,
awsRegion STRING,
sourceIpAddress STRING,
userAgent STRING,
errorCode STRING,
errorMessage STRING,
requestParameters STRING,
responseElements STRING,
additionalEventData STRING,
requestId STRING,
eventId STRING,
resources ARRAY<STRUCT<
arn: STRING,
accountId: STRING,
type: STRING>>,
eventType STRING,
apiVersion STRING,
readOnly STRING,
recipientAccountId STRING,
serviceEventDetails STRING,
sharedEventID STRING,
vpcEndpointId STRING
)
COMMENT 'CloudTrail table for server-computer-test123 bucket'
ROW FORMAT SERDE 'com.amazon.emr.hive.serde.CloudTrailSerde'
STORED AS INPUTFORMAT 'com.amazon.emr.cloudtrail.CloudTrailInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION 's3://server-computer-test123/AWSLogs/687993403879/CloudTrail/'
TBLPROPERTIES ('classification'='cloudtrail');
Create table and query using athena interface
Analytics Athena
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 69
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Delete Athena table using above like query (replace table name).
Otherwise, for RAW log go to your S3 bucket and click on bucket name AWSLogs Account Number You can see
all the CloudTrail logs over there.
Note: In case there is no default VPC available in selected zone (In my case I deleted default VPC).
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 70
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Select existing Security group or create new security group, as you are wish, (Selecting existing would be good)
Click Review
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 71
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
If you are auto-scaling group, want load balancer you can add ELB to auto scaling group
If you do not want to create scaling policy, select first radio button otherwise select use scaling policies button
Below are the conditions you can use for auto scaling EC2 instances
Created Auto increase group IF CPU Utilization is Greater than or equal to 60 for 5minutes add new EC2 instance to auto
scaling group
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 72
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Create auto decrease group IF CPU Utilization is less than or equal to 20 for 5 minutes remove on EC2 instance from
scaling group
Click review
Now go back to instances you would see EC2 instances launched by auto scaling group configuration.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 73
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
In order to create a CPU load to test auto scaling use below scripts
while true; do true; done &
dd if=/dev/zero of=/dev/null &
Execute above scripts multiple times in your EC2 instances, to create CPU Load is more than 60 percent for 5 minutes it
will automatically launch another EC2 instance.
To scale down identify the background running jobs and kill them
jobs
fg <Job Number>
CTRL + C
OR
ps –aux |grep dd |awk ‘{print $2}’ | xargs kill -9
ps –aux |grep bash |awk ‘{print $2}’ | xargs kill -9
OR
kill -9 <PID>
Wait for 5 minutes EC2 instances will be terminated automatically which are launched using auto scale option.
20. ClodFormation
AWS CloudFormation provides a common language for you to describe and provision all the infrastructure resources in
your cloud environment. CloudFormation allows you to use a simple text file to model and provision, in an automated
and secure manner, all the resources needed for your applications across all regions and accounts. This file serves as the
single source of truth for your cloud environment.
AWS CloudFormation is available at no additional charge, and you pay only for the AWS resources needed to run your
applications.
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 74
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Create Stack
https://github.com/techtutorials/aws-lab-guide/blob/aws/LaunchEC2WebServer.template
Add Tags
Click Next
Click on Create
It will create S3 bucket for CF template store and keeps your CloufFormation templates in it
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 75
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
(HPC), machine learning, and electronic design automation (EDA). You don’t have to worry about managing file servers
and storage, as Amazon FSx automates the time-consuming administration tasks such as hardware provisioning,
software configuration, patching, and backups. Amazon FSx integrates the file systems with cloud-native AWS services,
making them even more useful for a broader set of workloads.
Note: If you’re looking for HPC High Performance computer then select FSX for Lustre
Click Next
Default throughput 8MB/s you can also select different values of throughput
VPC
AZ
Subnet
Security Group
Windows Authentication
Encryption
Maintenance preferences
Click Next
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 76
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
These alternatives require ongoing hardware maintenance and system administration resources. The complexity of
configuring and managing these systems is compounded by the need for redundant storage of messages that ensures
messages are not lost if hardware fails.
Standard Queue
At-Least-Once Delivery
Best-Effort-Ordering
FIFO Queue
Exactly-Once Processing
o Duplicates are not introduces
Limited Throughput
o Up to 300 send, receive, delete per second
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 77
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
New queue created successfully. Now send message and poll to see the message queue
Write the message in message box example is shown in below screenshot Click Send Message
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 78
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Close the popup window, select queue name Actions View/Delete messages start polling for messages
This scenario is only for testing SQS or practicing SQS. If you know use case or project, where you can integrate SQS try
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 79
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Create subscription
Subscription will sent an email for verification after verification you will see subscription ID
Go to SQS and provide permissions to SNS to send notifications using ARN value
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 80
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
arn:aws:sqs:us-east-1:585692493869:Server-ComputerSQS
Send topic
Go back to SQS and View/Delete Messages Start poling messages you can see the message from SNS
Similar to this create Lambda function, get ARN value from Lambda, and add to SQS for further triggers
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 81
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
As soon as SNS trigs SQS will send message after words lambda will execute the defined function.
You should require administrator privileges to install this package in windows machine
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 82
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 83
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Click Install
Click Finish
Login back to AWS Management console and create user with programmatic access Refer Topic 5 download ACCESS Key
and secret key
cd C:\Program Files\Amazon\AWSCLI\bin
>aws configure
Now successfully installed and configure aws cli, run few aws cli commands to manage AWS infrastructure
Create S3 Bucket
make_bucket: servercomputerbucket
List S3 buckets
Bin> aws s3 ls
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 84
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
upload: D:\Red_Hat_Enterprise_Linux-7-System_Administrators_Guide-en-US.pdf to
s3://servercomputerbucket/Red_Hat_Enterprise_Linux-7-System_Administrators_Guide-en-US.pdf
Delete S3 bucket
AMI ID
Instance Type
Key Name (If there is no Key Pair create one)
Security Group ID
Subnet ID
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 85
This document and the information it contains is for public use.
AWS – Amazon Web Services Lab Practice Guide https://www.server-computer.com
Amazon Web Services Lab Practice Guide Prepared by www.server-computer.com – AWS Sysops Associate course 86
This document and the information it contains is for public use.