AWS CLOUD SERVICE
• ACCOUNT CREATION
• DEPLOYING A WEBPAGE USING EC2 INSTANCE ON CLOUD
Create an AWS Account
Search for aws.amazon.com in Google
Click on the first website as shown
On the Home page of AWS Click on Create an AWS Account
Enter a valid email address and name
After entering the details, click on Verify email address
Check your email for the verification code and enter the same-> click on verify
Create a password with the shown conditions
Confirm the password and click on continue
Select Personal option and fill the details
After filling the details, scroll down and click on continue
Enter Credit or debit card details 2 will be debited from
₹
your account.
Enter the details as asked  Primary purpose is personal use  Ownership type is
Individual  Enter PAN number if you have  Click on the consent check box
and click continue
Select text or Voice call option select India  enter your mobile
number and type the security check code and click continue
Enter the verify code that you get to your entered
mobile number and click continue
Select the basic support – FREE option and complete
the Sign up.
Once the Signup is successfully completed  click
on Go to the AWS Management Console
You will be redirected to the main page
Click on Sign In to the Console
Enter the Root user email address used
while Signup and click Next
Enter the Password and Click Sign In
Enter to the AWS Dashboard
Exercise – To deploy a webpage
Click on Services on top left corner then click on All services
then click on View all services
These are the various services provided by AWS
AWS-Services
 Amazon Web Services (AWS) offers a vast and diverse range of cloud services, totaling
over 200.
 These services cover computing power, storage, databases, machine learning, analytics,
networking, security, and more.
 AWS enables users to deploy and manage applications without the need for physical
hardware, providing scalable and flexible solutions for businesses and individuals.
 With a variety of tools and services, AWS caters to different needs, allowing users to build,
deploy, and scale applications efficiently in the cloud.
 The services are designed to meet a wide array of requirements, making AWS a
comprehensive and popular cloud computing platform.
AWS-Service- EC2 Instance
 An Amazon EC2 (Elastic Compute Cloud) instance is like a virtual computer that you can
rent from Amazon Web Services (AWS).
 It provides scalable computing capacity in the cloud and allows you to run applications
and services without investing in or maintaining physical hardware.
 EC2 instances come in various sizes, allowing you to choose the amount of CPU, memory,
storage, and networking capacity that best fits your needs.
 You can easily launch, manage, and terminate instances based on your requirements,
making it a flexible and cost-effective solution for hosting applications, websites, and
other computing workloads in the cloud.
Click on EC2
This is the EC2 Dashboard
On the top right corner, change the region to Asia Pacific (Mumbai) changing the location in
AWS helps you enhance the speed of your applications, save costs, and comply with rules about
where your data should be stored, ensuring a better overall experience for your users.
Once your region is changed, the dashboard reloads and
now on top right corner, we can see Mumbai
Under Resources  click on Instances (running)
Currently, there are no instances running, on
top right corner  click Launch instances
This is the Launch an instance dashboard
Give a name of your choice to the instance  Scroll down
Select the required OS select Ubuntu
Under Ubuntu we have many versions select any
Free tier to avoid billing better go for default
Select 64-bit (x86) which is default  x86 being a common processor architecture
for traditional servers, while Arm is known for its energy-efficient design often
used in mobile devices and newer cloud-based systems.
An AMI ID (Amazon Machine Image Identifier) is a unique identifier for a pre-configured virtual
server template in AWS, capturing the necessary information to launch an instance, including the
operating system, applications, and settings.
Next is Instance Type select default use Free tier only
An instance type in AWS defines the hardware of a virtual server, specifying its CPU, memory,
storage, and networking capacity to meet different application requirements.
t2.micro is selected
Next is Key pair Click on Create new key pair
In AWS, a key pair is a set of security credentials, consisting of a public key used to encrypt
information and a private key used to decrypt it, allowing secure access to instances and ensuring
data protection.
Give any Keypair name and click Create key pair in the
bottom
Save the key pair at a known location
After the keypair  next is Network settings
Under network settings we will use default values
Network settings in AWS refer to the configuration and management of how virtual machines
and services communicate with each other and the internet within the AWS cloud
environment.
Check the two boxes: Allow HTTPS and Allow HTTP traffic
Allowing HTTPS and HTTP traffic from the internet in AWS network settings enables secure and regular web
communication, allowing users to access your web-based applications or websites while ensuring data
confidentiality and accessibility.
Next is the Configuration Storage: Default is 8GB, for Ubuntu we can extend up to 10GB
Configuration storage in AWS refers to the secure and centralized management of settings, preferences,
and parameters for various services and applications, ensuring consistent and organized control of your
resources.
On the right side, we can see the summary of the instance created 
now click on Launch instance in the bottom
In few seconds the instance will be launched from the
region selected
The instance is successfully launched we can either click
on instances or scroll down
Click on View All instances on the bottom right corner
The instance will start running in few seconds check the instance state
Click the instance checkbox to see the instance summary
in the bottom
Click on Connect button on the top
We will connect using SSH client:
"Connecting to an instance in AWS means establishing a secure and remote access to your virtual
server, allowing you to manage and interact with it from your local computer."
An SSH client is a tool that allows you to securely connect to and manage your AWS instance by
providing a secure command-line interface for communication.
Copy the example command below
The command is copied as shown
Now open PowerShell in Administrator mode
Copy the path where you have saved the keypair
In the PowerShell, go to the path where
the key pair is saved as shown
Paste the example command
copied from the AWS instance
Type Yes to establish the
connection
Now the Ubuntu is successfully launched into
our local system
The highlighted is the private IP address to access the instance.
To check the same click on instances
Click on the instance check box
Below we can see the private IP address
GO back to the PowerShell and Update Ubuntu using the highlighted
command: sudo apt update
After updating Ubuntu install Docker using the command:
sudo apt-get install docker.io
Click Y to continue
Docker is successfully installed
Install git using the following command:
sudo apt install git
Check the versions of git and docker as shown
Now install nano editor using the command:
sudo apt install nano
Open any editor like notepad and write a simple
web-application using html and save the file as
index.html only
Open the folder where your index.html file is located  right click
and open GitBash here
Type the following Git commands:
git init
git add .
git commit
Create a repository in GitHub
Give any name of your choice and click on create
Copy the HTTPS link of your GitHub repository as shown
Add the remote repository as shown:
git remote add origin <paste the HTTPS link of GitHub>
Switch the branch from master to
main as shown
Now push the index.html file into
the GitHub as shown
Refresh the GitHub page to see the pushed
file
Now copy the HTTPS URL as shown
Go back to PowerShell and paste
the URL as shown
Once cloning is completed Move into the folder as shown
Inside this folder create a Dockerfile as shown
This line of code is like making a special box using NGINX (a type of web server)
and Alpine Linux (a lightweight system). The "COPY . /usr/share/nginx/html" part is
putting our website files (whatever is in the current folder) into the box, so when it
runs, NGINX shows our custom content from that folder. It's a way of saying, "Hey,
NGINX, use these files for the website!"
To come out of nano editor type
CTRL+O and CTRL+X
Build a Docker image as shown:
The command "sudo docker build -t html-webapplication ." creates a Docker package for a
web application called "html-webapplication" using the instructions in the current directory. This
package contains everything the application needs to run, making it easy to share and deploy.
Next Run the Docker container as shown:
The command "sudo docker run -d -p 80:80 html-webapplication:latest" launches a background Docker
container for a web application. It connects your local machine's port 80 to the container's port 80, letting
you access the web app. The "html-webapplication:latest" specifies the image to use for the application.
Now, we can access the web-application using the Public IP address as
shown Copy the address and paste in any browser
We can now see the deployed web application
Now stop the running container:
use the command: “sudo docker ps” which list the running containers
 copy the container ID
Use the command:
sudo docker stop <Container ID> to stop the running container
Exit to stop the instance connection
Successfully logged out
Go back to the AWS  click on the instance checkbox
Go to Instance State and click on Terminate Instance
Click on terminate to delete the instance
The instance is successfully terminated
Reload the page to see that no instances are running
Steps to delete the AWS account
click on Account
Scroll down and click on Close Account
Click on Close account
The account will take 90 days to get permanently deleted
This message appears, if we try to
login
THANK YOU

AWS-Exercise.pptxn bjbjbjbjbjbjbjbjbbjjbbjbj

  • 1.
    AWS CLOUD SERVICE •ACCOUNT CREATION • DEPLOYING A WEBPAGE USING EC2 INSTANCE ON CLOUD
  • 2.
  • 3.
  • 4.
    Click on thefirst website as shown
  • 5.
    On the Homepage of AWS Click on Create an AWS Account
  • 6.
    Enter a validemail address and name
  • 7.
    After entering thedetails, click on Verify email address
  • 8.
    Check your emailfor the verification code and enter the same-> click on verify
  • 9.
    Create a passwordwith the shown conditions
  • 10.
    Confirm the passwordand click on continue
  • 11.
    Select Personal optionand fill the details
  • 12.
    After filling thedetails, scroll down and click on continue
  • 13.
    Enter Credit ordebit card details 2 will be debited from ₹ your account.
  • 14.
    Enter the detailsas asked  Primary purpose is personal use  Ownership type is Individual  Enter PAN number if you have  Click on the consent check box and click continue
  • 15.
    Select text orVoice call option select India  enter your mobile number and type the security check code and click continue
  • 16.
    Enter the verifycode that you get to your entered mobile number and click continue
  • 17.
    Select the basicsupport – FREE option and complete the Sign up.
  • 18.
    Once the Signupis successfully completed  click on Go to the AWS Management Console
  • 19.
    You will beredirected to the main page Click on Sign In to the Console
  • 20.
    Enter the Rootuser email address used while Signup and click Next
  • 21.
    Enter the Passwordand Click Sign In
  • 22.
    Enter to theAWS Dashboard
  • 23.
    Exercise – Todeploy a webpage
  • 24.
    Click on Serviceson top left corner then click on All services then click on View all services
  • 25.
    These are thevarious services provided by AWS
  • 26.
    AWS-Services  Amazon WebServices (AWS) offers a vast and diverse range of cloud services, totaling over 200.  These services cover computing power, storage, databases, machine learning, analytics, networking, security, and more.  AWS enables users to deploy and manage applications without the need for physical hardware, providing scalable and flexible solutions for businesses and individuals.  With a variety of tools and services, AWS caters to different needs, allowing users to build, deploy, and scale applications efficiently in the cloud.  The services are designed to meet a wide array of requirements, making AWS a comprehensive and popular cloud computing platform.
  • 27.
    AWS-Service- EC2 Instance An Amazon EC2 (Elastic Compute Cloud) instance is like a virtual computer that you can rent from Amazon Web Services (AWS).  It provides scalable computing capacity in the cloud and allows you to run applications and services without investing in or maintaining physical hardware.  EC2 instances come in various sizes, allowing you to choose the amount of CPU, memory, storage, and networking capacity that best fits your needs.  You can easily launch, manage, and terminate instances based on your requirements, making it a flexible and cost-effective solution for hosting applications, websites, and other computing workloads in the cloud.
  • 28.
  • 29.
    This is theEC2 Dashboard
  • 30.
    On the topright corner, change the region to Asia Pacific (Mumbai) changing the location in AWS helps you enhance the speed of your applications, save costs, and comply with rules about where your data should be stored, ensuring a better overall experience for your users.
  • 31.
    Once your regionis changed, the dashboard reloads and now on top right corner, we can see Mumbai
  • 32.
    Under Resources click on Instances (running)
  • 33.
    Currently, there areno instances running, on top right corner  click Launch instances
  • 34.
    This is theLaunch an instance dashboard
  • 35.
    Give a nameof your choice to the instance  Scroll down
  • 36.
    Select the requiredOS select Ubuntu
  • 37.
    Under Ubuntu wehave many versions select any Free tier to avoid billing better go for default
  • 38.
    Select 64-bit (x86)which is default  x86 being a common processor architecture for traditional servers, while Arm is known for its energy-efficient design often used in mobile devices and newer cloud-based systems.
  • 39.
    An AMI ID(Amazon Machine Image Identifier) is a unique identifier for a pre-configured virtual server template in AWS, capturing the necessary information to launch an instance, including the operating system, applications, and settings.
  • 40.
    Next is InstanceType select default use Free tier only An instance type in AWS defines the hardware of a virtual server, specifying its CPU, memory, storage, and networking capacity to meet different application requirements.
  • 41.
  • 42.
    Next is Keypair Click on Create new key pair In AWS, a key pair is a set of security credentials, consisting of a public key used to encrypt information and a private key used to decrypt it, allowing secure access to instances and ensuring data protection.
  • 43.
    Give any Keypairname and click Create key pair in the bottom
  • 44.
    Save the keypair at a known location
  • 45.
    After the keypair next is Network settings
  • 46.
    Under network settingswe will use default values Network settings in AWS refer to the configuration and management of how virtual machines and services communicate with each other and the internet within the AWS cloud environment.
  • 47.
    Check the twoboxes: Allow HTTPS and Allow HTTP traffic Allowing HTTPS and HTTP traffic from the internet in AWS network settings enables secure and regular web communication, allowing users to access your web-based applications or websites while ensuring data confidentiality and accessibility.
  • 48.
    Next is theConfiguration Storage: Default is 8GB, for Ubuntu we can extend up to 10GB Configuration storage in AWS refers to the secure and centralized management of settings, preferences, and parameters for various services and applications, ensuring consistent and organized control of your resources.
  • 49.
    On the rightside, we can see the summary of the instance created  now click on Launch instance in the bottom
  • 50.
    In few secondsthe instance will be launched from the region selected
  • 51.
    The instance issuccessfully launched we can either click on instances or scroll down
  • 52.
    Click on ViewAll instances on the bottom right corner
  • 53.
    The instance willstart running in few seconds check the instance state
  • 54.
    Click the instancecheckbox to see the instance summary in the bottom
  • 55.
    Click on Connectbutton on the top
  • 56.
    We will connectusing SSH client: "Connecting to an instance in AWS means establishing a secure and remote access to your virtual server, allowing you to manage and interact with it from your local computer."
  • 57.
    An SSH clientis a tool that allows you to securely connect to and manage your AWS instance by providing a secure command-line interface for communication.
  • 58.
    Copy the examplecommand below
  • 59.
    The command iscopied as shown
  • 60.
    Now open PowerShellin Administrator mode
  • 61.
    Copy the pathwhere you have saved the keypair
  • 62.
    In the PowerShell,go to the path where the key pair is saved as shown
  • 63.
    Paste the examplecommand copied from the AWS instance
  • 64.
    Type Yes toestablish the connection
  • 65.
    Now the Ubuntuis successfully launched into our local system
  • 66.
    The highlighted isthe private IP address to access the instance.
  • 67.
    To check thesame click on instances
  • 68.
    Click on theinstance check box
  • 69.
    Below we cansee the private IP address
  • 70.
    GO back tothe PowerShell and Update Ubuntu using the highlighted command: sudo apt update
  • 71.
    After updating Ubuntuinstall Docker using the command: sudo apt-get install docker.io Click Y to continue
  • 72.
  • 73.
    Install git usingthe following command: sudo apt install git
  • 74.
    Check the versionsof git and docker as shown
  • 75.
    Now install nanoeditor using the command: sudo apt install nano
  • 76.
    Open any editorlike notepad and write a simple web-application using html and save the file as index.html only
  • 77.
    Open the folderwhere your index.html file is located  right click and open GitBash here
  • 78.
    Type the followingGit commands: git init git add . git commit
  • 79.
  • 80.
    Give any nameof your choice and click on create
  • 81.
    Copy the HTTPSlink of your GitHub repository as shown
  • 82.
    Add the remoterepository as shown: git remote add origin <paste the HTTPS link of GitHub>
  • 83.
    Switch the branchfrom master to main as shown
  • 84.
    Now push theindex.html file into the GitHub as shown
  • 85.
    Refresh the GitHubpage to see the pushed file
  • 86.
    Now copy theHTTPS URL as shown
  • 87.
    Go back toPowerShell and paste the URL as shown
  • 88.
    Once cloning iscompleted Move into the folder as shown
  • 89.
    Inside this foldercreate a Dockerfile as shown
  • 90.
    This line ofcode is like making a special box using NGINX (a type of web server) and Alpine Linux (a lightweight system). The "COPY . /usr/share/nginx/html" part is putting our website files (whatever is in the current folder) into the box, so when it runs, NGINX shows our custom content from that folder. It's a way of saying, "Hey, NGINX, use these files for the website!"
  • 91.
    To come outof nano editor type CTRL+O and CTRL+X
  • 92.
    Build a Dockerimage as shown: The command "sudo docker build -t html-webapplication ." creates a Docker package for a web application called "html-webapplication" using the instructions in the current directory. This package contains everything the application needs to run, making it easy to share and deploy.
  • 93.
    Next Run theDocker container as shown: The command "sudo docker run -d -p 80:80 html-webapplication:latest" launches a background Docker container for a web application. It connects your local machine's port 80 to the container's port 80, letting you access the web app. The "html-webapplication:latest" specifies the image to use for the application.
  • 94.
    Now, we canaccess the web-application using the Public IP address as shown Copy the address and paste in any browser
  • 95.
    We can nowsee the deployed web application
  • 96.
    Now stop therunning container: use the command: “sudo docker ps” which list the running containers  copy the container ID
  • 97.
    Use the command: sudodocker stop <Container ID> to stop the running container
  • 98.
    Exit to stopthe instance connection
  • 99.
  • 100.
    Go back tothe AWS  click on the instance checkbox
  • 101.
    Go to InstanceState and click on Terminate Instance
  • 102.
    Click on terminateto delete the instance
  • 103.
    The instance issuccessfully terminated
  • 104.
    Reload the pageto see that no instances are running
  • 105.
    Steps to deletethe AWS account click on Account
  • 106.
    Scroll down andclick on Close Account
  • 107.
  • 108.
    The account willtake 90 days to get permanently deleted
  • 109.
    This message appears,if we try to login
  • 110.