0% found this document useful (0 votes)
297 views

Amazon Web Services PDF

learn AWS

Uploaded by

Venakat P V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
297 views

Amazon Web Services PDF

learn AWS

Uploaded by

Venakat P V
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

 

 
 
 
 
 
 

 
 
 
 
 

Amazon Web Services (AWS)


Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com
 

 
 
 
 
Amazon web services 
What is AWS? 
AWS is a platform which helps businesses scale and grow by offering secure 
cloud services like compute power, content delivery, database storage, and 
other functionality.                     

Introduction 
AWS full form is Amazon web services. Previously a factory would typically build 
an electricity plant and use it for their purposes. Then power experts would 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
manage electricity plants to provide reliable power supply at a very low cost to 
these factories as a whole. The electricity could be generated with greater 
efficiency and the price in this model is also low. AWS cloud follows a similar 
model where instead of building large scale infrastructures, companies can opt 
for cloud services where they can get all infrastructure they could ever need. 

AWS is a growing cloud computing platform which has a significant share 
of cloud computing with respect to its competitors. AWS is geographically 
diversified into regions to ensure system robustness and outages. In Japan, 
Eastern USA, two locations in Western USA, Brazil, Ireland, Singapore, and 
Australia regions there are central hubs in place. There are over 100+ services 
like application services, networking, storage, mobile, management, compute 
and many others which are available for the client easily. 

Requirements for Linux/Widows instance Configuration:‐ 

1.Vpc Configuration 

2.Subnets Configuration 

3.IGW Configuration 

4.RT Configuration 

5.SG Configuration 

6.Keypairs Configuration 

VPC INTRODUCTION:‐ 

Amazon Virtual Private Cloud (Amazon VPC) lets you provision a logically 
isolated section of the AWS Cloud where you can launch AWS resources in a 
virtual network that you define. You have complete control over your virtual 
networking environment, including selection of your own IP address range, 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
creation of subnets, and configuration of route tables and network gateways. 
You can use both IPv4 and IPv6 in your VPC for secure and easy access to 
resources and applications. 
You can easily customize the network configuration for your Amazon VPC. For 
example, you can create a public‐facing subnet for your web servers that has 
access to the Internet, and place your backend systems such as databases or 
application servers in a private‐facing subnet with no Internet access. You can 
leverage multiple layers of security, including security groups and network 
access control lists, to help control access to Amazon EC2 instances in each 
subnet. 
VPC CONFIGURATION:‐ 

>>Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 
>>In the navigation pane, choose VPC Dashboard in the upper‐left corner. 
>>Choose Launch VPC Wizard. 
>> Choose VPC with Public and Private Subnets and then choose Select.  
>>  For IPv4 CIDR block, enter the CIDR block for the VPC. We recommend that 
you use a CIDR block from the private (non‐publicly routable)  For 
example, 10.0.0.0/16. >> For IPv6 CIDR Block, keep No IPv6 CIDR Block. 
>> enter a name for the VPC. 
>> Hardware tenancy, keep Default 
>> Choose Create VPC.  
Creating a Subnet in Your VPC:‐ 

To add a new subnet to your VPC, you must specify an IPv4 CIDR block for the 
subnet from the range of your VPC. You can specify the Availability Zone in 
which you want the subnet to reside. You can have multiple subnets in the 
same Availability Zone. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
You can optionally specify an IPv6 CIDR block for your subnet if an IPv6 CIDR 
block is associated with your VPC. 

 
 
 
 
>> Open the  Amazon VPC console 

at https://console.aws.amazon.com/vpc/. 

 
>> In the navigation pane, choose Subnets, Create subnet. 
>> Specify the subnet details as necessary and choose Create. 
>> Name tag: Optional 
>> VPC: Choose the VPC for which you're creating the subnet. 
>> Availability Zone: Optionally choose an Availability Zone in which your subnet 
will reside, or leave the default No Preference to let AWS choose an Availability 
Zone for you. 
>> IPv4 CIDR block: Specify an IPv4 CIDR block for your subnet 
>> Choose Create Subnet 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

 
 
Internet Gateways:‐ 
An internet gateway is a horizontally scaled, redundant, and highly available 
VPC component that allows communication between instances in your VPC and 
the internet. It therefore imposes no availability risks or bandwidth constraints 
on your network traffic. 

An internet gateway serves two purposes: to provide a target in your VPC route 
tables for internet‐routable traffic, and to perform network address translation 
(NAT) for instances that have been assigned public IPv4 addresses. 

An internet gateway supports IPv4 and IPv6 traffic. 

Creating and Attaching an Internet Gateway:‐ 
>> Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 
>> In the navigation pane, choose Internet Gateways, and then choose Create 
internet gateway. 
>> Optionally name your internet gateway, and then choose Create. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

 
>> Select the internet gateway that you just created, and then choose Actions, 
Attach to VPC. 
>> Select your VPC from the list, and then choose Attach. 
 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

 
 
 

 
To  

 
 

create a custom route table:‐ 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

 
>> Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 
>> In the navigation pane, choose Route Tables, and then choose Create Route 
Table. 
>> In the Create Route Table dialog box, optionally name your route table, then 
select your VPC, and then choose Yes, Create. 
>> Select the custom route table that you just created. The details pane displays 
tabs for working with its routes, associations, and route propagation. 
>> On the Routes tab, choose Edit, Add another route, and add the following 
routes as necessary. Choose Save when you're done. 
>> For IPv4 traffic, specify 0.0.0.0/0 in the Destination box, and select the 
internet gateway ID in the Target list. 
>> On the Subnet Associations tab, choose Edit, select the Associate check box 
for the subnet, and then choose Save. 
 
Security Groups for  Instances:‐ 
A security group acts as a virtual firewall that controls the traffic for one or 
more instances. When you launch an instance, you can specify one or more 
security groups; otherwise, we use the default security group. You can add rules 
to each security group that allow traffic to or from its associated instances. You 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
can modify the rules for a security group at any time; the new rules are 
automatically applied to all instances that are associated with the security 
group. When we decide whether to allow traffic to reach an instance, we 
evaluate all the rules from all the security groups that are associated with the 
instance. When you launch an instance in a VPC, you must specify a security 
group that's created for that VPC 

 create a new security group:‐ 
>> Open the Amazon VPC console at https://console.aws.amazon.com/vpc/. 
>> In the navigation pane, choose Security Groups, and then choose Create 
Security Group. 
>> In the Create Security Group dialog box, specify a name for the security 
group and a description. Select the ID of your VPC from the VPC list, and then 
choose Yes, Create. 
>> Select the security group. The details pane displays the details for the 
security group, plus tabs for working with its inbound rules and outbound rules. 
>> On the Inbound Rules tab, choose Edit. Choose Add Rule, and complete the 
required information. For example, select HTTP or HTTPS from the Type list, and 
enter the Source as 0.0.0.0/0 for IPv4 traffic, or ::/0 for IPv6 traffic. 
Choose Save when you're done. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Choose Create Security group. 
 
Amazon EC2 Key Pairs:‐ 
Amazon EC2 uses public–key cryptography to encrypt and decrypt login 
information. Public–key cryptography uses a public key to encrypt a piece of 
data, and then the recipient uses the private key to decrypt the data. The public 
and private keys are known as a key pair. Public‐key cryptography enables you 
to securely access your instances using a private key instead of a password. 

 create your key pair:‐ 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 
>> In the navigation pane, under NETWORK & SECURITY, choose Key Pairs. 
>> Choose Create Key Pair. 
>> For Key pair name, enter a name for the new key pair, and then 
choose Create.    
>> The private key file is automatically downloaded by your browser. The base 
file name is the name you specified as the name of your key pair, and the file 
name extension is .pem. Save the private key file in a safe place. 

Launch an Instance (LINUX) :‐ 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 
>> From the console dashboard, choose Launch Instance. 
>> The Choose an Amazon Machine Image (AMI) page displays a list of basic 
configurations, called Amazon Machine Images (AMIs), that serve as templates 
for your instance. Select an HVM version of Amazon Linux 2. Notice that these 
AMIs are marked "Free tier eligible." 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> On the Choose an Instance Type page, you can select the hardware 
configuration of your instance. Select the t2.micro type, which is selected by 
default. Notice that this instance type is eligible for the free tier. 
>> Choose Review and Launch to let the wizard complete the other 
configuration settings for you. 
>> Select your security group from the list of existing security groups, and then 
choose Review and Launch. 

 
>> On the Review Instance Launch page, choose Launch. 
>> When prompted for a key pair, select Choose an existing key pair, then select 
the key pair that you created when getting set up. 
>> Choose View Instances to close the confirmation page and return to the 
console. 
>> On the Instances screen, you can view the status of the launch. It takes a 
short time for an instance to launch. When you launch an instance, its initial 
state is pending. After the instance starts, its state changes to running and it 
receives a public DNS name. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Connecting to your linux from windows using  putty:‐ 
>> Download and install PuTTY from the PuTTY download page. 
>> Convert your private key using PuTTYgen 
>> Start PuTTY (from the Start menu, choose All Programs, PuTTY, PuTTY). 

 
>> In the Host Name box, enter user_name@public_dns_name 
>> Under Connection type, select SSH. 
>> In the Category pane, expand Connection, expand SSH, and then 
choose Auth. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

 
>> Choose Browse. 
>> Select the .ppk file that you generated for your key pair and choose Open. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Choose Open.  
>> Choose Yes. A window opens and you are connected to your instance. 

Transferring Files to Your Linux Instance Using WinSCP:‐ 
>> Download and install WinSCP from http://winscp.net/eng/download.php. 
For most users, the default installation options are OK. 
>> At the WinSCP login screen, for Host name, enter the public DNS hostname 
or public IPv4 address for your instance. 
>> Specify the private key for your instance. For Private key, enter the path to 
your private key, or choose the "..." button to browse for the file 
>> Choose Login. To add the host fingerprint to the host cache, choose Yes. 
 

>> After the connection is established, in the connection window your Linux 
instance is on the right and your local machine is on the left. You can drag and 
drop files directly into the remote file system from your local machine. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Launch an Instance (Windows) :‐ 
>> open the Amazon EC2 Console 
>> Click Launch Instance  
>> Microsoft Windows Server 2012 R2 Base and click Select 
>> select the default option of t2.micro ‐ this instance type is covered within the 
free tier. Then click Review and Launch at the bottom of the page. 
>> click Launch from the bottom of the page. 
>> select Create a new key pair and name it MyFirstKey. Then click Download 
Key Pair. MyFirstKey.pem will be downloaded to your computer ‐‐ make sure to 
save this key pair in a safe location on your computer.  
>> After you have downloaded and saved your key pair, click Launch Instance to 
start your Windows Server instance. 
>>  On the next screen, click View Instances to view the instance you have just 
created and see its status. 
>> Select the Windows Server instance you just created and click Connect 
>> The User name defaults to Administrator 
>> To receive your password, click Get Password 
>> Click Choose File and browse to the directory you stored MyFirstKey.pem. 
 Your Key Pair will surface in the text box. Click Decrypt Password. 
>> You now have a decrypted password for your Windows Server instance. 
Make sure to save this information in a secure location. It is your Windows 
Server admin login credentials. 
>> Click Download Remote Desktop File and open the file. 
>> When prompted log in to the instance, use the User Name and Password you 
generated in to connect to your virtual machine. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Terminate Your Windows VM:‐ 
 
 >> click the Actions button, navigate to Instante State, and click Terminate 
>> You will be asked to confirm your termination ‐ select Yes, Terminate. 
  Note: This process can take several seconds to complete.  Once your 
instnaces has been terminated, the Instance State will change to terminated on 
your EC2 Console. 
 
Amazon Elastic Block Store (Amazon EBS):‐ 
Amazon Elastic Block Store (Amazon EBS) provides block level storage volumes 
for use with EC2 instances. EBS volumes behave like raw, unformatted block 
devices. You can mount these volumes as devices on your instances. You can 
mount multiple volumes on the same instance, but each volume can be 
attached to only one instance at a time. 

EBS volumes are highly available and reliable storage volumes that can be 
attached to any running instance that is in the same Availability Zone. EBS 
volumes that are attached to an EC2 instance are exposed as storage volumes 
that persist independently from the life of the instance. With Amazon EBS, you 
pay only for what you use. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Creating an Amazon EBS Volume:‐ 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 
>> From the navigation bar, select the Region in which you would like to create 
your volume. 
>> In the navigation pane, choose ELASTIC BLOCK STORE, Volumes. 
>> Choose Create Volume. 
>> For Volume Type, choose a volume type. 
>> For Size (GiB), type the size of the volume. 
>> For Availability Zone, choose the Availability Zone in which to create the 
volume. EBS volumes can only be attached to EC2 instances within the same 
Availability Zone. 
>> Choose Create Volume. After the volume status is Available, you can attach 
the volume to an instance. 
Attaching an Amazon EBS Volume to an Instance:‐ 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ 
>> In the navigation pane, choose Elastic Block Store, Volumes 
>> Select an available volume and choose Actions, Attach Volume 
>> Select the instance from the list of options 
>> Choose Attach 
>> Connect to your instance and mount the volume 
 
Amazon EFS File System:‐ 
Amazon Elastic File System (Amazon EFS) provides simple, scalable file storage 
for use with Amazon EC2. With Amazon EFS, storage capacity is elastic, growing 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
and shrinking automatically as you add and remove files, so your applications 
have the storage they need, when they need it. Amazon EFS has a simple web 
services interface that allows you to create and configure file systems quickly 
and easily.  

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. 

To create Amazon EFS file system:‐ 
>> Open the Amazon EFS Management Console 
at https://console.aws.amazon.com/efs/. 
>> Choose Create File System. 
>> Choose your default VPC from the VPC list. It has the same VPC ID that you 
noted at the end of Step 1: Create Your EC2 Resources and Launch Your EC2 
Instance. 
>> Select the check boxes for all of the Availability Zones. 

 
>> Choose Next Step. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Name your file system, and add any other tags to help describe and manage 
your file system. 
>>  Keep General Purpose and Bursting selected as your default performance 
and throughput modes. 
>> Review the file system configuration, and then choose Create File System. 
 
Elastic IP Addresses:‐ 
An Elastic IP address is a static IPv4 address designed for dynamic cloud 
computing. An Elastic IP address is associated with your AWS account. With an 
Elastic IP address, you can mask the failure of an instance or software by rapidly 
remapping the address to another instance in your account. 

An Elastic IP address is a public IPv4 address, which is reachable from the 
internet. If your instance does not have a public IPv4 address, you can associate 
an Elastic IP address with your instance to enable communication with the 
internet. 

 
Allocating an Elastic IP Address:‐ 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 
>> In the navigation pane, choose Elastic IPs. 
>> Choose Allocate new address. 
>> For IPv4 address pool, choose Amazon pool. 
>> Choose Allocate, and close the confirmation screen. 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 
>> In the navigation pane, choose Elastic IPs. 
>> Select an Elastic IP address and choose Actions, Associate address. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Select the instance from Instance and then choose Associate. 
 
What Is IAM Users:‐ 
AWS Identity and Access Management (IAM) is a web service that helps you 
securely control access to AWS resources. You use IAM to control who is 
authenticated (signed in) and authorized (has permissions) to use resources. 

When you first create an AWS account, you begin with a single sign‐in identity 
that has complete access to all AWS services and resources in the account. This 
identity is called the AWS account root user and is accessed by signing in with 
the email address and password that you used to create the account. We 
strongly recommend that you do not use the root user for your everyday tasks, 
even the administrative ones. Instead, adhere to the best practice of using the 
root user only to create your first IAM user. Then securely lock away the root 
user credentials and use them to perform only a few account and service 
management tasks. 

 
Creating IAM Users:‐ 
>> Sign in to the AWS Management Console and open the IAM console 
at https://console.aws.amazon.com/iam/. 
>> In the navigation pane, choose Users and then choose Add user. 
>> Type the user name for the new user. This is the sign‐in name for AWS. If you 
want to add more than one user at the same time, choose Add another user for 
each additional user and type their user names. You can add up to 10 users at 
one time. 
>> Select the type of access this set of users will have. You can select 
programmatic access, access to the AWS Management Console, or both. 
>> Choose Next: Permissions. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> On the Set permissions page, specify how you want to assign permissions to 
this set of new users. Choose one of the following three options: 

 Add user to group. Choose this option if you want to assign the users 
to one or more groups that already have permissions policies. IAM 
displays a list of the groups in your account, along with their 
attached policies. You can select one or more existing groups, or 
choose Create group to create a new group. 
 Copy permissions from existing user. Choose this option to copy all 
of the group memberships, attached managed policies, embedded 
inline policies, and any existing permissions boundaries from an 
existing user to the new users. IAM displays a list of the users in your 
account. Select the one whose permissions most closely match the 
needs of your new users. 
 Attach existing policies to user directly. Choose this option to see a 
list of the AWS managed and customer managed policies in your 
account. Select the policies that you want to attach to the new users 
or choose Create policy to open a new browser tab and create a new 
policy from scratch. 
>> Choose Next: Tags. 
>> Choose Next: Review to see all of the choices you made up to this point. 
When you are ready to proceed, choose Create user. 

Amazon S3:‐ 
Amazon Simple Storage Service (Amazon S3) is an object storage service that 
offers industry‐leading scalability, data availability, security, and performance. 
This means customers of all sizes and industries can use it to store and protect 
any amount of data for a range of use cases, such as websites, mobile 
applications, backup and restore, archive, enterprise applications, IoT devices, 
and big data analytics. Amazon S3 provides easy‐to‐use management features 
so you can organize your data and configure finely‐tuned access controls to 
meet your specific business, organizational, and compliance requirements. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Create an Amazon S3 Bucket:‐ 
>> Sign in to the AWS Management Console. 

>> Under Storage & Content Delivery, choose S3 to open the Amazon S3 
console. 

>> From the Amazon S3 console dashboard, choose Create Bucket. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> In Create a Bucket, type a bucket name in Bucket Name. 

>> In Region, choose Region 

>> Choose Create.

Upload a File to Your Amazon S3 Bucket:‐ 

 
>> In the Amazon S3 console, choose the bucket where you want to upload an 
object, choose Upload, and then choose Add Files. 

>> In the file selection dialog box, find the file that you want to upload, choose 
it, choose Open, and then choose Start Upload. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> In the Amazon S3 console, choose your S3 bucket, choose the file that you 
want to open or download, choose Actions, and then 
choose Open or Download. 

>>  If you are downloading an object, specify where you want to save it. 

>> Within your S3 bucket, select the file that you want to delete, 
choose Actions, and then choose Delete. 

>> In the confirmation message, choose OK. 

Monitoring Step Functions Using CloudWatch:‐ 
Amazon CloudWatch is a monitoring and management service that provides 
data and actionable insights for AWS, hybrid, and on‐premises applications and 
infrastructure resources. With CloudWatch, you can collect and access all your 
performance and operational data in form of logs and metrics from a single 
platform. This allows you to overcome the challenge of monitoring individual 
systems and applications in silos (server, network, database, etc.). CloudWatch 
enables you to monitor your complete stack (applications, infrastructure, and 
services) and leverage alarms, logs, and events data to take automated actions 
and reduce Mean Time to Resolution (MTTR). This frees up important resources 
and allows you to focus on building applications and business value. 
To configure Coudwatch to monitor cpu utilization:‐ 
>> Lanuch A Amazon linux instance 
>> open AWS Console 
>> click on services 
>> In the management tool Section select Cloudwatch 
>> Select Alarams 
>> Click on Create alaram 
>> Select EC2 metrics 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Click on per instance metrics 
>> Select Metric 
>> provide instance id or name 
>> under mertic name select cpuutilization checkbox 
>> click on next button 
>> Define Alaram >> name ‐> >> Desctription ‐> >> cpuutilization is>=30 
>> state is alaram >> click on newlist >> send notifaction >> email id>> 
>> create Alaram  
>> go to your email account and check the mail 
>> verify the link from your email  
>> Now login to instance using putty 
>> yum install stress >> stress ‐‐cpu 40 ‐‐timeout 1000 
>>go to cloudwatch service >> go to email and check mail 
Amazon Relational Database Service (Amazon RDS):‐ 
Amazon Relational Database Service (Amazon RDS) is a web service that makes 
it easier to set up, operate, and scale a relational database in the AWS Cloud. It 
provides cost‐efficient, resizeable capacity for an industry‐standard relational 
database and manages common database administration tasks. 

Why do you want a managed relational database service? Because Amazon RDS 
takes over many of the difficult or tedious management tasks of a relational 
database: 

 When you buy a server, you get CPU, memory, storage, and IOPS, all 
bundled together. With Amazon RDS, these are split apart so that you can 
scale them independently. If you need more CPU, less IOPS, or more 
storage, you can easily allocate them. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
 Amazon RDS manages backups, software patching, automatic failure 
detection, and recovery. 
 To deliver a managed service experience, Amazon RDS doesn't provide 
shell access to DB instances. It also restricts access to certain system 
procedures and tables that require advanced privileges. 
 You can have automated backups performed when you need them, or 
manually create your own backup snapshot. You can use these backups to 
restore a database. The Amazon RDS restore process works reliably and 
efficiently. 
 You can get high availability with a primary instance and a synchronous 
secondary instance that you can fail over to when problems occur. You 
can also use MySQL, MariaDB, or PostgreSQL Read Replicas to increase 
read scaling. 
 You can use the database products you are already familiar with: MySQL, 
MariaDB, PostgreSQL, Oracle, Microsoft SQL Server. 
 In addition to the security in your database package, you can help control 
who can access your RDS databases by using AWS Identity and Access 
Management (IAM) to define users and permissions. You can also help 
protect your databases by putting them in a virtual private cloud. 
Create an RDS DB Instance 
>> Sign in to the AWS Management Console and open the Amazon RDS console 
at https://console.aws.amazon.com/rds/. 

>> In the upper‐right corner of the AWS Management Console, choose the AWS 
Region in which you want to create the DB instance. This example uses the US 
West (Oregon) Region. 

>> In the navigation pane, choose Databases. 

>> Choose Create database. 

>> On the Create database page, shown following, make sure that the Standard 
Create option is chosen, and then choose MySQL. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

>> In the Templates section, choose Dev/Test. 

>> In the Settings section, set these values: 

 DB instance identifier – tutorial‐db‐instance 

 Master username – tutorial_user 
 Auto generate a password – Disable the option 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
 Master password – Choose a password. 
 Confirm password – Retype the password.

>> In the DB instance size section, set these values: 

 DB instance performance type – Burstable 
 DB instance class – db.t2.small 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

>> In the Storage and Availability & durability sections, use the default values. 
>> In the Connectivity section, open Additional connectivity configuration and 
set these values: 

 Virtual Private Cloud (VPC) – Choose an existing VPC with both public and 
private subnets 
 Subnet group – The DB subnet group for the VPC, such as the tutorial‐db‐
subnet‐group 
 Publicly accessible – Yes 
 VPC security groups – Choose an existing VPC security group that is 
configured for private access 
 Availability zone – No Preference 
 Database port – 3306 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

 
 
 
 
 
 
 

 
 

 
 

 
 
>> Open the Additional configuration section, and enter sample for Initial 
database name. Keep the default settings for the other options.

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> To create your Amazon RDS MySQL DB instance, choose Create database. 

>> Wait for the Status of your new DB instance to show as Available. Then 
choose the DB instance name to show its details. 

>> In the Connectivity & security section, view the Endpoint and Port of the DB 
instance. 

 
 

 
 

 
 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> To make sure your RDS MySQL DB instance is as secure as possible, verify 

that sources outside of the VPC cannot connect to your RDS MySQL DB 
instance. 

AWS Elastic Beanstalk:‐ 
With Elastic Beanstalk, you can quickly deploy and manage applications in the 
AWS Cloud without having to learn about the infrastructure that runs those 
applications. Elastic Beanstalk reduces management complexity without 
restricting choice or control. You simply upload your application, and Elastic 
Beanstalk automatically handles the details of capacity provisioning, load 
balancing, scaling, and application health monitoring. 

Elastic Beanstalk supports applications developed in Go, Java, .NET, Node.js, 
PHP, Python, and Ruby. When you deploy your application, Elastic Beanstalk 
builds the selected supported platform version and provisions one or more AWS 
resources, such as Amazon EC2 instances, to run your application. 

You can interact with Elastic Beanstalk by using the AWS Management Console, 
the AWS Command Line Interface (AWS CLI), or eb, a high‐level CLI designed 
specifically for Elastic Beanstalk. 

Create an Application and an Environment:‐ 
>> Open the Elastic Beanstalk console. 
>> for Platform, choose a platform, and then choose Create application. 
>> Creates an Elastic Beanstalk application named getting‐started‐app. 

>> Launches an environment named GettingStartedApp‐env with these AWS 
resources: 

 An Amazon Elastic Compute Cloud (Amazon EC2) instance (virtual 
machine) 
 An Amazon EC2 security group 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
 An Amazon Simple Storage Service (Amazon S3) bucket 
 Amazon CloudWatch alarms 
 An AWS Cloud Formation stack 
 A domain name 
>> Creates a new application version named Sample Application. This is the 
default Elastic Beanstalk example application file. 
>> Deploys the code for the example application to the GettingStartedApp‐
env environment. 

Elastic Load Balancer:‐ 
A load balancer distributes incoming application traffic across multiple EC2 
instances in multiple Availability Zones. This increases the fault tolerance of 
your applications. Elastic Load Balancing detects unhealthy instances and routes 
traffic only to healthy instances. 

Your load balancer serves as a single point of contact for clients. This increases 
the availability of your application. You can add and remove instances from 
your load balancer as your needs change, without disrupting the overall flow of 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
requests to your application. Elastic Load Balancing scales your load balancer as 
traffic to your application changes over time. Elastic Load Balancing can scale to 
the vast majority of workloads automatically. 

A listener checks for connection requests from clients, using the protocol and 
port that you configure, and forwards requests to one or more registered 
instances using the protocol and port number that you configure. You add one 
or more listeners to your load balancer. 

You can configure health checks, which are used to monitor the health of the 
registered instances so that the load balancer only sends requests to the 
healthy instances. 

 
 

 
           
           
           
           
                             

To ensure that your registered instances are able to handle the request load in 
each Availability Zone, it is important to keep approximately the same number 
of instances in each Availability Zone registered with the load balancer. For 
example, if you have ten instances in Availability Zone us‐west‐2a and two 
instances in us‐west‐2b, the requests are distributed evenly between the two 
Availability Zones. As a result, the two instances in us‐west‐2b serve the same 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
amount of traffic as the ten instances in us‐west‐2a. Instead, you should have 
six instances in each Availability Zone. 

By default, the load balancer distributes traffic evenly across the Availability 
Zones that you enable for your load balancer. To distribute traffic evenly across 
all registered instances in all enabled Availability Zones, enable cross‐zone load 
balancing on your load balancer. However, we still recommend that you 
maintain approximately equivalent numbers of instances in each Availability 
Zone for better fault tolerance. 

To create a Classic Load Balancer:‐ 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 

>> On the navigation bar, choose a region for your load balancer. Be sure to 
select the same region that you selected for your EC2 instances. 

>> On the navigation pane, under LOAD BALANCING, choose Load Balancers. 

>> Choose Create Load Balancer. 

>> For Load Balancer, choose Create. 

Step 2: Define Your Load Balancer 
You must provide a basic configuration for your load balancer, such as a name, 
a network, and a listener. 

A listener is a process that checks for connection requests. It is configured with 
a protocol and a port for front‐end (client to load balancer) connections and a 
protocol and a port for back‐end (load balancer to instance) connections. In this 
tutorial, you configure a listener that accepts HTTP requests on port 80 and 
sends them to your instances on port 80 using HTTP. 

To define your load balancer and listener:‐ 
>> For Load Balancer name, type a name for your load balancer. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
 The name of your Classic Load Balancer must be unique within your set of 
Classic Load Balancers for the region, can have a maximum of 32 characters, can 
contain only alphanumeric characters and hyphens, and must not begin or end 
with a hyphen. 

>> For Create LB inside, select the same network that you selected for your 
instances: EC2‐Classic or a specific VPC. 

>> [Default VPC] If you selected a default VPC and would like to choose the 
subnets for your load balancer, select Enable advanced VPC configuration. 

>> Leave the default listener configuration. 

>> [EC2‐VPC] For Available subnets, select at least one available public subnet 
using its add icon. The subnet is moved under Selected subnets. To improve the 
availability of your load balancer, select more than one public subnet. 

You can add at most one subnet per Availability Zone. If you select a subnet 
from an Availability Zone where there is already an selected subnet, this subnet 
replaces the currently selected subnet for the Availability Zone. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

>> Choose Next: Assign Security Groups. 

Step 3: Assign Security Groups to Your Load Balancer in a VPC 
If you selected a VPC as your network, you must assign your load balancer a 
security group that allows inbound traffic to the ports that you specified for 
your load balancer and the health checks for your load balancer. 

To assign security group to your load balancer:‐ 
>> On the Assign Security Groups page, select Create a new security group. 

>> Type a name and description for your security group, or leave the default 
name and description. This new security group contains a rule that allows traffic 
to the port that you configured your load balancer to use. 

>> Choose Next: Configure Security Settings. 

>> Choose Next: Configure Health Check to continue to the next step. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Step 4: Configure Health Checks for Your EC2 Instances 
Elastic Load Balancing automatically checks the health of the EC2 instances for 
your load balancer. If Elastic Load Balancing finds an unhealthy instance, it stops 
sending traffic to the instance and reroutes traffic to healthy instances. In this 
step, you customize the health checks for your load balancer. 

To configure health checks for your instances:‐ 
>> On the Configure Health Check page, leave Ping Protocol set to HTTP 
and Ping Port set to 80. 

>> For Ping Path, replace the default value with a single forward slash ("/"). This 
tells Elastic Load Balancing to send health check queries to the default home 
page for your web server, such as index.html. 

>> For Advanced Details, leave the default values. 

>> Choose Next: Add EC2 Instances. 

Step 5: Register EC2 Instances with Your Load Balancer
Your load balancer distributes traffic between the instances that are registered 
to it. 

To register EC2 instances with your load balancer 
>> On the Add EC2 Instances page, select the instances to register with your 
load balancer. 

>> Leave cross‐zone load balancing and connection draining enabled. 
>> Choose Next: Add Tags. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Step 7: Create and Verify Your Load Balancer 
Before you create the load balancer, review the settings that you selected. After 
creating the load balancer, you can verify that it's sending traffic to your EC2 
instances. 

To create and test your load balancer 
>> On the Review page, choose Create. 

>> After you are notified that your load balancer was created, choose Close. 

>> Select your new load balancer. 

>> On the Description tab, check the Status row. If it indicates that some of your 
instances are not in service, its probably because they are still in the registration 
process 

>> After at least one of your EC2 instances is in service, you can test your load 
balancer. Copy the string from DNS name (for example, my‐load‐balancer‐
1234567890.us‐west‐2.elb.amazonaws.com) and paste it into the address field 
of an Internet‐connected web browser. If your load balancer is working, you see 
the default page of your server. 

Step 8: Delete Your Load Balancer (Optional) 
As soon as your load balancer becomes available, you are billed for each hour or 
partial hour that you keep it running. When you no longer need a load balancer, 
you can delete it. As soon as the load balancer is deleted, you stop incurring 
charges for it. 

To delete your load balancer 
>> If you have a CNAME record for your domain that points to your load 
balancer, point it to a new location and wait for the DNS change to take effect 
before deleting your load balancer. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 

>> On the navigation pane, under LOAD BALANCING, choose Load Balancers. 

>> Select the load balancer. 

>> Choose Actions, Delete. 

>> When prompted for confirmation, choose Yes, Delete. 

AWS CloudFormation:‐ 
AWS CloudFormation is a service that helps you model and set up your Amazon 
Web Services resources so that you can spend less time managing those 
resources and more time focusing on your applications that run in AWS. You 
create a template that describes all the AWS resources that you want (like 
Amazon EC2 instances or Amazon RDS DB instances), and AWS CloudFormation 
takes care of provisioning and configuring those resources for you. 

If your application requires additional availability, you might replicate it in 
multiple regions so that if one region becomes unavailable, your users can still 
use your application in other regions. The challenge in replicating your 
application is that it also requires you to replicate your resources. Not only do 
you need to record all the resources that your application requires, but you 
must also provision and configure those resources in each region. 

When you use AWS CloudFormation, you can reuse your template to set up 
your resources consistently and repeatedly. Just describe your resources once 
and then provision the same resources over and over in multiple regions. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Create the stack:‐ 
>> Sign in to the AWS Management Console and open the AWS CloudFormation 
console at https://console.aws.amazon.com/cloudformation. 

>> If this is a new AWS CloudFormation account, click Create New Stack. 
Otherwise, click Create Stack. 

>> In the Template section, select Specify an Amazon S3 Template URL to type 
or paste the URL for the sample WordPress template, and then click Next: 

>>  the Specify Details section, enter a stack name in the Name field. For this 
example, use MyWPTestStack. The stack name cannot contain spaces. 

>> In the KeyName field, enter the name of a valid Amazon EC2 key pair in the 
same region you are creating the stack. 

>> Click Next. 

>> In this scenario, we won't add any tags. Click Next. 

>> Review the information for the stack. When you're satisfied with the 
settings, click Create. 

>> On the AWS CloudFormation console, select the stack MyWPTestStack in the 
list. 

>> In the stack details pane, click the Events tab. 

>> The console automatically refreshes the event list with the most recent 
events every 60 seconds. 

To delete the stack and its resources:‐ 
>> From the AWS CloudFormation console, select the MyWPTestStack stack. 

>> Click Delete Stack. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> In the confirmation message that appears, click Yes, Delete. 

Amazon EC2 instance Migration Service :‐ 
Migrating involves capturing settings, configurations, and data and porting 
these to a newer operating system on separate hardware. After validation, the 
migrated system can be promoted to production. You can migrate instances by 
launching a new instance from an AMI of the new operating system. You can 
streamline the process further by using AWS CloudFormation and AWS Systems 
Manager to automatically apply settings and configurations to the new system 
with little manual work.

To migrate your server 
>> Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/. 
>>  In the navigation pane, choose AMIs, Owned by me, and Public images. 
>> Launch a new instance from an AMI. 
>> Log on to the new instance and install all updates. 
>> Perform an application installation and configuration changes. 
>> Test the server. 
>> When validated, promote the server to production. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> copy the AMI  
>> From the target region, find the AMI using the EC2 console or the AWS CLI.  
>> Launch a new instance from the shared AMI on the target account. 

>> Create a custom AMI from the target account instance. 
>> If you don't need to run any instances of this Amazon EBS‐backed AMI on the 
source account, clean up your AMI. 
AWS Route53 :‐  
Amazon Route 53 is a highly available and scalable Domain Name System (DNS) 
web service. You can use Route 53 to perform three main functions in any 
combination: domain registration, DNS routing, and health checking. If you 
choose to use Route 53 for all three functions, perform the steps in this order: 
1. Register domain names 
Your website needs a name, such as example.com. Route 53 lets you 
register a name for your website or web application, known as a domain 
name. 

2. Route internet traffic to the resources for your domain 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
When a user opens a web browser and enters your domain name 
(example.com) or subdomain name (acme.example.com) in the address 
bar, Route 53 helps connect the browser with your website or web 
application. 

3. Check the health of your resources 
Route 53 sends automated requests over the internet to a resource, such 
as a web server, to verify that it's reachable, available, and functional. You 
also can choose to receive notifications when a resource becomes 
unavailable and choose to route internet traffic away from unhealthy 
resources. 

Create S3 buckets 
>> We first need to log in into the AWS management console and look for the S3 
service. 

>> Once found, we have to create two S3 buckets with our domain name. 

>> In my case, I’ll be using the following bucket names: 

Bucket 1 — www.testingsite.com

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
Bucket 2 — testingsite.com

>> You have to make sure that both bucket names are exactly the same as your domain name. 

>> You should now be able to see both your S3 buckets. 

Upload files to S3 Bucket:-


>> We now need to upload all the static files & assets and choose our main 
bucket for our site, the non‐www version or the www version. 

>> I’ll choose the www version, hence Bucket 1 will be the main bucket for our 
site. 

>> This means that after we complete all the steps, any user 
accessing testingsite.com would be automatically redirected 
to www.testingsite.com 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Also, the main bucket will contain all our statics files and assets. 

Configure Bucket settings


>> It’s time to set up the main bucket for static site hosting. 

>> Hit the Properties tab, and you should be able to see Static website hosting. 

>> Open it, select “Use this bucket to host a website” and then you need to type 

the index document of your website i.e. index.html in our case. 

>> Don’t forget to click the Save button.

Make bucket public


>> In order to make it public, we will add a Bucket Policy, but before adding it, 
we need to enable our bucket to accept new bucket policies. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> Go to the Permissions tab of your bucket and then open the Public access 
settings tab. 

>>  By default, you should see all settings set to true. 

>> Hit the edit button, and then un tick the following settings as shown below.

>> click the save button. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

 
>> add new Bucket Policies for our S3 bucket. 

>> go to the Permissions tab of the bucket again and then open the Bucket 
Policy tab. 

>> Paste into the editor the following policy. Don’t forget to 
replace www.testingsite.com with your domain name! 

{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::www.testingsite.com/*"
}
]
}

>> go back to the Properties tab and then to the Static website hosting option. 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 
>> find the “endpoint” of your bucket. Try accessing it and you should be able to 
see your website 

Redirect non-www. to www.:-


>>  go to Bucket 2 now, testingsite.com and make it redirect 
to www.testingsite.com . 

>> go to the second bucket, go to the Properties tab and then open Static 
website hosting again. 

>> Select Redirect requests and then type in your target domain 
( www.testingsite.com in my case) and specify the protocol ( http for now). 

 
 

 
 
 

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com


 

Create new A records:-


>> Go to the Route53 service and find your domain. 

>>    We need to create 2 DNS records with the following characteristics which 
will point to our S3 bucket: 

 Type: A — IPV4 address 

 Alias: Yes 

 Alias Target: Our main bucket 

>>   Once you’ve done the above steps and waited a little bit, you should be 
able to see your website if you try accessing your domain. 
i.e. www.testingsite.com   

Pivotalsoft IT Services Pvt. Ltd. www.pivotalsoft.com

You might also like