Sunday, 3 July 2022

Aws Lightsail - Theory

 Amazon Lightsail


What is Amazon Lightsail?

Amazon Lightsail is a cloud service offered by Amazon Web Services (AWS) that bundles cloud compute power and memory for new or less experienced cloud users.


AWS packages memory, processing, storage and transfer into virtual machines (VMs) for customers to purchase, then releases that compute capacity as Amazon Elastic Compute Cloud (EC2) instance. Amazon Lightsail derives its compute power from an EC2 instance. Amazon EC2 is a web service that provides secure, configurable compute capacity in the cloud.


AWS designed the Lightsail service to make it simple to understand and purchase. The vendor manages the infrastructure, which shares the same uptime and global regions and availability zones as EC2.


Amazon Lightsail launches virtual private servers (VPS), which are VMs with individual operating systems but have restricted access to physical server resources. Customers can choose from multiple Lightsail plans with the following characteristics:


memory ranging from 512 MB to 32 GB;

processors with one to eight cores;

a solid-state drive with 20 GB to 640 GB of storage;

data transfer allowances of 1 TB to 7 TB; and

pricing from $3.50 to $240 per month.

All plans include a static IP address, intuitive management console, secure shell terminal access, remote desktop access, domain name server management and server monitoring. Customers also have access to AWS tools.


Lightsail offers a variety of operating systems, applications and stacks so a customer can build a template. A developer uses the Lightsail command-line interface (CLI) as an alternative to the console. Lightsail also provides a reference for application programming interfaces (API) and documentation.


Amazon load balancer delivering WordPress site media content 

Use Amazon LightSail's applications and configurations to build projects like a basic e-commerce application, website or blog -- for example, a WordPress blog.

Lightsail features

Designed for simplicity, Amazon Lightsail features the following:


Virtual servers. Lightsail virtual servers, or instances, are easy to create or delete. And, users can make advanced configurations to the server for networks and storage, for example. Via the Lightsail console users can install popular applications such as WordPress, Windows, Plesk and more.


Simplified load balancing. Load balancing is automated to enable web traffic to be routed across instances so a website and its applications can accommodate variations in traffic. And, Lightsail load balancers include integrated certificate management, and provides free SSL certificates.


Managed databases. Amazon Lightsail can launch and manage a fully configured MySQL or PostgreSQL Managed databases can be scaled separately from virtual servers, improve the availability of applications and run standalone in the cloud.


Containers. The Lightsail Container Service allows users to run containerized applications in the cloud and access them from the internet. One example is a Python web app.


Upgrade to EC2. Amazon Lightsail is scalable and can be upgraded to EC2, when and if required.


Access to AWS services. Lightsail integrates with more than 90 AWS services via Amazon Virtual Private Cloud (VPC) peering.


Amazon Lightsail use cases

Amazon Lightsail simplifies the process of hosting a website or server on a cloud platform. New users or those with minimal experience can start small and then scale. Here are common use cases for Lightsail:


Simple web applications. Users can deploy simple websites using preconfigured development stacks, such as LAMP, Nginx, MEAN and Node.js.


Websites. Businesses use Lightsail to create custom websites, including blogs, e-commerce sites and personal websites. Preconfigured applications integrate with common website building platforms, including WordPress, Magento, Plesk and Joomla.


Business software. Lightsail can run open source and commercial software such as MySQL.


Dev/test environments. Developers can create sandboxes using Lightsail to test outside of the production environment.


What is Amazon Lightsail?

Amazon Lightsail is the easiest way to get started with Amazon Web Services (AWS) for developers who need to build websites or web applications. It includes everything you need to launch your project quickly - instances (virtual private servers), container services, managed databases, content delivery network (CDN) distributions, load balancers, SSD-based block storage, static IP addresses, DNS management of registered domains, and resource snapshots (backups) - for a low, predictable monthly price.

Who is Lightsail for?

Lightsail is for developers. You can choose an image for your Lightsail instance that jumpstarts your dev project so you don't have to spend as much time installing software or frameworks.

If you're an individual developer or hobbyist working on a personal project, Lightsail can help you deploy and manage basic cloud resources. You might also be interested in learning or experimenting with cloud services, such as virtual machines or networking. Lightsail provides a quick way to get started.

Lightsail has images with base operating systems, development stacks like LAMP, LEMP (Nginx), and SQL Server Express, and applications like WordPress, Drupal, and Magento. For more detailed information about the software installed on each image, see Choose a Lightsail instance image.

As your project grows, you can add block storage disks and attach them to your Lightsail instance. You can take snapshots of these instances and disks and easily create new instances from those snapshots. You can also peer your VPC so that your Lightsail instances can use other AWS resources outside of Lightsail.

You can also create a Lightsail load balancer and attach target instances to create a highly available application. You can also configure your load balancer to handle encrypted (HTTPS) traffic, session persistence, health checking, and more.

Operating systems in Lightsail

    Linux

  • Amazon Linux (2018)

  • Amazon Linux 2

  • CentOS 7 and 8

  • Ubuntu 16, 18, and 20

  • Free BSD 10

  • Debian 8, 9, and 10

  • openSUSE Leap

    Windows

  • Windows Server 2019

  • Windows Server 2016

  • Windows Server 2012 R2

CMS applications in Lightsail

    Linux

  • WordPress 

  • WordPress Multisite 

  • cPanel & WHM

  • PrestaShop

  • Drupal 

  • Ghost

  • Joomla 

  • Plesk Hosting Stack on Ubuntu

E-commerce and project management applications in Lightsail

    Linux

  • Magento 

  • Redmine 

Development stacks in Lightsail

    Linux

  • LAMP stack (PHP 7) 

  • Node.js 

  • MEAN Stack 

  • Nginx (LEMP Stack) 

  • Django 

    Windows

  • SQL Server 2016 Express

Aws App Runner Lab Practical

 

AWS App Runner

Introduction:

Amazon Web Services, Inc. (AWS) announced its new service, i.e., AWS App Runner, on May 18, 2021. It is a fully managed container application service. With App Runner, it will be very convenient and quick for customers to build, deploy, and run containerized web applications and APIs with just a few clicks. Customers need to provide a container image or source code, and App Runner can automatically build and deploy the web application. It loads, balances traffic, and can scale and monitor application health when there is a demand. This service handles the configuration and operations of their container environments. With the help of this service, a customer can point their existing code or container repository and make an application run and scale in the cloud without having to configure infrastructure services, and, of course, there will be no burden for maintenance.


How it works:






Deployment methods:


App runner deploys in two ways:


1. Deploy from the source


2. Deploy from a container image


Deploy from the source:

With the help of App Runner, the application can be deployed by connecting to your source code. To run my web application, I will be using a python code already existing in my GitHub repository. App Runner connects to this project, and code will compile and deployed. The python code in my repository will create a test web page.


Go to AWS Console and search for App Runner service and click on Create an APP Runner Service.


Source & Deployment:


Choose Source Code Repository

Connect to your GitHub account by authenticating your GitHub login credentials.

In the repository, select the suitable repository which contains the application to deploy.

In Branch, select the appropriate Branch from the dropdown.

In Deployment Trigger, we can choose Manual or Automatic. In this example, we will choose Automatic, which indicates that App Runner automatically discovers the change made to the source code and then automatically builds and deploys the updated version. Otherwise, Manual can select if you want to manage things manually.




Configure Build:

In Build Setting, there are two ways to select the configuration file

Configure All Setting Here: This will specify all settings for your service here in the App Runner console

Use A Configuration File: Let App Runner read your configuration from the app runner.yaml file in your source repository.

In Runtime, currently, there are two options – Python 3 and Nodejs 12. To use other languages, container registry workflow needs to use.

In Build Command, enter the command to install dependencies or compile the code.

In Start Command, enter the command used to start a web server for your service.

In Port, enter the IP port your service uses.



Configure Service:

In Service Name, provide the name of your service.

In Virtual CPU & Memory, choose the CPU and memory size you want your container to have.

In Environment Variable, a key-value pair uses to store custom configuration values. This is optional.




Various other settings customize the service:


Auto Scaling uses to configure automatic scaling behavior. The Default configuration hasone instance of my container image with 80 concurrent requests, but if requests increases, it will scale to multiple instances by setting up the configuration through Custom Configuration.



Health Check performs a TCP health check at the Port that your application is listening to; various parameters can set up in this option.



Security uses to choose an IAM role that an instance can use, and this role permits the container to correspond with other AWS services. App Runner can encrypt all copies of the application source image. I have not used the IAM role here as my demo doesn’t require it.



Tags use to search and filter the resources. It also controls access permissions and tracks the AWS costs. Tags can add by clicking Add New Tag, and not using it for my demo here.




Review & Create:

A page displays all the configurations we have made in previous steps and then clicks on “create & deploy.”

After the deployment, a URL will generate for your application. And the application will be live on that custom URL. My test application is up and running now





2. Deploy from a Container Image:

Another deployment method uses a container image to push the container image to the Amazon ECR Public.

In the Source & Deployment tab, in the Repository type, select Container Registry

In the Provider, choose Amazon ECR public

In Container Image URI, enter the URI to the image.

After clicking next, follow the similar steps mentioned in Deploy from Source.




Region Availability:


Currently, App Runner is available in the following regions:

US East (N. Virginia)

US West (Oregon)

US East (Ohio)

Asia Pacific (Tokyo)

Europe (Ireland)

App Runner can use the AWS Management Console and AWS Copilot CLI.


Pricing:

App Runner costs for the compute and memory resources used by the application. App Runner billed when it is running. The application can be paused if not in use and can be resumed when required. In development and test environments, the strategy of pause and resume can be an excellent cost-saving option. To meet the application’s processing requirements, App Runner automatically scales the number of active containers up and down. The maximum limit can be set on the number of containers so that you can take control of the budget.

AWS App Runner

Introduction:


Amazon Web Services, Inc. (AWS) announced its new service, i.e., AWS App Runner, on May 18, 2021. It is a fully managed container application service. With App Runner, it will be very convenient and quick for customers to build, deploy, and run containerized web applications and APIs with just a few clicks. Customers need to provide a container image or source code, and App Runner can automatically build and deploy the web application. It loads, balances traffic, and can scale and monitor application health when there is a demand. This service handles the configuration and operations of their container environments. With the help of this service, a customer can point their existing code or container repository and make an application run and scale in the cloud without having to configure infrastructure services, and, of course, there will be no burden for maintenance.


How it works:






Deployment methods:


App runner deploys in two ways:


1. Deploy from the source


2. Deploy from a container image


Deploy from the source:

With the help of App Runner, the application can be deployed by connecting to your source code. To run my web application, I will be using a python code already existing in my GitHub repository. App Runner connects to this project, and code will compile and deployed. The python code in my repository will create a test web page.


Go to AWS Console and search for App Runner service and click on Create an APP Runner Service.


Source & Deployment:


Choose Source Code Repository

Connect to your GitHub account by authenticating your GitHub login credentials.

In the repository, select the suitable repository which contains the application to deploy.

In Branch, select the appropriate Branch from the dropdown.

In Deployment Trigger, we can choose Manual or Automatic. In this example, we will choose Automatic, which indicates that App Runner automatically discovers the change made to the source code and then automatically builds and deploys the updated version. Otherwise, Manual can select if you want to manage things manually.


Configure Build:

In Build Setting, there are two ways to select the configuration file

Configure All Setting Here: This will specify all settings for your service here in the App Runner console

Use A Configuration File: Let App Runner read your configuration from the app runner.yaml file in your source repository.

In Runtime, currently, there are two options – Python 3 and Nodejs 12. To use other languages, container registry workflow needs to use.

In Build Command, enter the command to install dependencies or compile the code.

In Start Command, enter the command used to start a web server for your service.

In Port, enter the IP port your service uses.


Configure Service:


In Service Name, provide the name of your service.

In Virtual CPU & Memory, choose the CPU and memory size you want your container to have.

In Environment Variable, a key-value pair uses to store custom configuration values. This is optional.



Various other settings customize the service:


Auto Scaling uses to configure automatic scaling behavior. The Default configuration hasone instance of my container image with 80 concurrent requests, but if requests increases, it will scale to multiple instances by setting up the configuration through Custom Configuration.

Health Check performs a TCP health check at the Port that your application is listening to; various parameters can set up in this option.

Security uses to choose an IAM role that an instance can use, and this role permits the container to correspond with other AWS services. App Runner can encrypt all copies of the application source image. I have not used the IAM role here as my demo doesn’t require it.

Tags use to search and filter the resources. It also controls access permissions and tracks the AWS costs. Tags can add by clicking Add New Tag, and not using it for my demo here.



Review & Create:

A page displays all the configurations we have made in previous steps and then clicks on “create & deploy.”

After the deployment, a URL will generate for your application. And the application will be live on that custom URL. My test application is up and running now



2. Deploy from a Container Image:

Another deployment method uses a container image to push the container image to the Amazon ECR Public.

In the Source & Deployment tab, in the Repository type, select Container Registry

In the Provider, choose Amazon ECR public

In Container Image URI, enter the URI to the image.

After clicking next, follow the similar steps mentioned in Deploy from Source.

Region Availability:


Currently, App Runner is available in the following regions:

US East (N. Virginia)

US West (Oregon)

US East (Ohio)

Asia Pacific (Tokyo)

Europe (Ireland)

App Runner can use the AWS Management Console and AWS Copilot CLI.


Pricing:

App Runner costs for the compute and memory resources used by the application. App Runner billed when it is running. The application can be paused if not in use and can be resumed when required. In development and test environments, the strategy of pause and resume can be an excellent cost-saving option. To meet the application’s processing requirements, App Runner automatically scales the number of active containers up and down. The maximum limit can be set on the number of containers so that you can take control of the budget.

Thursday, 30 June 2022

Linux Basic Commands

 Linux Basic Commands


ls --> to list files in folder 

pwd --> to see present working directory

cd --> change directory cd /

date --> to view system date

        date -s 10/20/2021

date -s 10:30 

                MM/DD/YY

arch --> to view architure 32 bit or 64bit

uname -a --> to view kernel version

cat /etc/redhat-release --> to view os version

cat /proc/cpuinfo --> to view processor info

free -h --> to view ram memory info

df -h   --> to view partation info 

cal    -->  to view calander

mkdir songs -->to create empty folder

touch file4  -->to create empty file

rm -rvf movies -->to delete file/folder

 rm - remove  

r-recursive

  v-verbose

  f-force

reboot --> to reboot a server

Wednesday, 22 June 2022

Attaching EBS volume on linux-ec2

  1. view  your existing instance.                                                                                                                        
          
  2. Attach an EBS Volume to your Linux EC2 Instance.



AWS Cloud Training ELASTIC BLOCK STORE

 What is Elastic Block Store (EBS)?


 EBS storage is allocated in volumes

  • A volume is a 'virtual disk' (size: 1GB - 1TB)
  • Basically, a raw block device
  • Can be attached to an instance (but only one at a time)
  • A single instance can access multiple volumes


 Placed in specific availability zones

  • Why is this useful?
  • Be sure to place it near instances (otherwise can't attach)


 Replicated across multiple servers

  • Data is not lost if a single server fails
  •  Amazon: Annual failure rate is 0.1-0.2%


 EC2 instances can have an EBS volume as their root device ("EBS

boot")

  • Result: Instance data persists independently from the lifetime of the instance
  •  You can stop and restart the instance, like suspending and resuming a laptop


 You won't be charged for the instance while it is stopped (only

for EBS)

  •  You can enable termination protection for the instance
  •  Blocks attempts to terminate the instance (e.g., by accident) until termination protection is disabled again


CREATE EBS VOLUMES


Once you are in the EC2 page, click Volumes under ELASTIC BLOCK STORE

on the left pane.


Once you are in the Volumes page, click on Create Volume to create a new

volume.

  

  Select Volume Type from the drop down list.



Specify Snapshot ID if you want your new volume to be copied data from the

snapshot, otherwise leave blank.

And select encrypt option if you want to encrypt your newly creating volume,

otherwise leave un selected.




Then click on create after specifying the values required.



Your volume will start creating.




DELETE EBS VOLUME

Once you logged in to AWS, go to EC2 section then go to Volumes section.
Click the volume which you want to delete and click on actions.








Friday, 10 June 2022

AWS Cloud Training IDENTITY AND ACCESS MANAGEMENT

 IDENTITY AND ACCESS MANAGEMENT


AWS Identity and Access Management (IAM) is a web service that helps you

securely control access to AWS resources for your users. You use IAM to control

who can use your AWS resources (authentication) and what resources they can use

and in what ways (authorization).


Choose Identity & Access management under Security & Identity from the AWS

console page.



CREATING USERS:

Once you are on IAM page, Click Users from left pane, then choose Add User to

create a user.


On the next page, click on Show User Security Credentials to see access keys or

choose Download Credentials to download them then click on close.


Under Users tab, select a user and click on User Actions, then select manage

Password to create a new password.


Once you are on IAM page, Click Users from left pane, then choose Add User to

create a user.