Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Amazon Web Services: LightSail, Elastic BeanStalk, Lambda and Virtual Private Cloud, Study notes of Artificial Intelligence

An introduction to Amazon Web Services (AWS) and its various services such as Amazon LightSail, Amazon Lambda, VPC, and Elastic Beanstalk. It explains the features, use cases, advantages, and limitations of each service. It also provides information on AWS Lambda concepts, event sources, runtimes, and best practices. useful for those who are new to or have less expertise with the cloud and want to learn about AWS services.

Typology: Study notes

2022/2023

Available from 03/23/2023

CosmicAlgo
CosmicAlgo 🇮🇳

4 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AMAZON WEB SERVICES (AWS)
NOTES
TOPICS:
LIGHTSAIL
LAMBDA
VPC
ELASTIC BEANSTALK
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Amazon Web Services: LightSail, Elastic BeanStalk, Lambda and Virtual Private Cloud and more Study notes Artificial Intelligence in PDF only on Docsity!

AMAZON WEB SERVICES (AWS)

NOTES

TOPICS :

● LIGHTSAIL

● LAMBDA

● VPC

● ELASTIC BEANSTALK

Amazon LightSail: Introduction Amazon Lightsail is a new service in the AWS Compute product family. For those who are new to or have less expertise with the cloud, It is a cloud service that provides bundles of computational power and memory. Amazon Lightsail is a new kind of VPS (Virtual Private Service). It was made on the concept of easing up some businesses. Consider an instance where you might know that every business runs behind an idea and that idea grows exponentially if it is driven smoothly. The factors that might be affecting businesses these days have a lot to do with technology. The quicker the technology, the more is the business and more profit. The quicker the implementation of the idea of business with technology, the more successful the business may become with time. To ease up such business-oriented services in the world, we need to look at the resources that the current market has been using for a while. It might also be the case where this resource can cover more business with less expense so that profit can be marginally increased. This is where AWS comes in. It is the leader in the world of cloud computing and the driver of most businesses today. Specifically, let's learn more about AWS Lightsail, which is another tycoon in the cloud computing market these days. This would cost him quite more than what he would earn from the blog. This is where AWS Lightsail comes to the rescue. It needs no database, no physical access to the server, and no scaling when the traffic occurs. Before exploring AWS Lightsail, we need to understand more about Virtual Private Server. Amazon Lightsail Features Amazon Lightsail offers simple cloud resources for getting your web application or website up and operating in a matter of minutes. Lightsail features can be used to host static content, link your content to a global audience, or set up your Windows Business server. In many situations, the configuration process is guided by the Lightsail console, which also often comes with components that are fully set up. ● Instances

managed databases, improve application availability, or host standalone databases in the cloud. You may also develop multi-tiered applications within Lightsail by deploying numerous instances connected to a centrally managed database and a load balancer that routes traffic to the instances. Benefits of Amazon Lightsail The most obvious advantage of using Lightsail is that you are always in command. You have complete control over how things are arranged, how your website and applications operate, and how much you will pay at the end of the month. The billing cycle is as straightforward as the Lightsail service itself. The benefits of using Lightsail to configure your apps, websites, or workloads are as follows: ● Simplified UI: When you join up for Lightsail, the first thing you notice is the significantly simplified user interface. The goal was to have a server up and running with software already installed as soon as possible, therefore it was developed from the bottom up. There are fewer options, fewer prompts, less uncertainty, and more assistance. ● Speed: Users can set up a VPS in seconds by selecting one of Amazon’s pre-configured plans. Even if you’ve never used the cloud before, utilizing Lightsail is simple. These plans provide SSD-based storage, plenty of bandwidth, automatic DNS administration, and a static IP address, so you can get your project up and running quickly. ● Scaling: Despite its simplicity, Lightsail may develop and scale alongside your applications with time. When your apps require advanced capabilities such as managed databases, a content delivery network, or links to other AWS features and services, you have many options. ● Affordable: The low cost of Lightsail service is one of its distinguishing features. Plans begin at $5 per month for the most basic tier, with the first month free. Additionally, there are straightforward costs for the more robust plans that provide sufficient capacity to operate demanding programs and busy websites. The most economical plan is suitable for those just starting, whereas the strong package is perfect for small organizations.

Amazon Lightsail Use cases Amazon Lightsail can be used for: ● Launching simple web applications – To get online quickly and easily, use pre-configured development stacks such as LAMP, Nginx, MEAN, and Node.js. ● Building small business applications – launching business-specific applications for backups, financial and accounting, information storage, sharing, and more. ● Create custom websites – With pre-configured software such as WordPress, Magento, Prestashop, and Joomla, you can create and customize your blog, e-commerce, or website in just a few clicks. ● Spin up test environments – You can try out new ideas risk-free by creating and deleting simple development sandboxes and test environments.

manage your development function code separately from the unchanging code and resources that it uses. ● Log streams: Log stream allows you to annotate your function code with custom logging statements which helps you to analyze the execution flow and performance of your AWS Lambda functions. How does AWS Lambda work? The following AWS Lambda example with block diagram explains the working of AWS Lambda in a few easy steps: AWS Lambda Block Diagram Step 1: First upload your AWS Lambda code in any language supported by AWS Lambda. Java, Python, Go, and C# are some of the languages that are supported by AWS Lambda function. Step 2: These are some AWS services which allow you to trigger AWS Lambda. Step 3: AWS Lambda helps you to upload code and the event details on which it should be triggered.

Step 4: Executes AWS Lambda Code when it is triggered by AWS services: Step 5: AWS charges only when the AWS lambda code executes, and not otherwise. This will happen in the following scenarios:

● Upload files in an S3 bucket

● When HTTP get/post endpoint URL is hit

● For adding/modifying and deleting Dynamo DB tables

● In the process of data streams collection

● Push notification

● Hosting of website

● Email sending

Events that Trigger AWS Lambda Here are Events which will be triggered when you use AWS Lambda.

● Insert, updating and deleting data Dynamo DB table

● To include push notifications in SNS

● To search for log history in CloudTrail

● Entry into an S3 object

● DynamoDB can trigger AWS Lambda whenever there is data added, modified, and

deleted in the table.

● Helps you to schedule the event to carry out the task at a regular time pattern.

● Modifications to objects in S3 buckets

● Notifications sent from Amazon SNS.

● AWS Lambda can be used to process the CloudTrail logs

● API Gateway allows you to trigger AWS Lambda on GET/POST methods.

Use Cases of AWS Lambda AWS Lambda used for a wide range of applications like:

● Helps you for ETL process

● Allows you to perform real-time file processing and real-time stream processing

● Use for creating web applications

● Use in Amazon products like Alexa Chatbots and Amazon Echo/Alexa

● Data processing (real-time streaming analytics)

● Automated Backups of everyday tasks

● Scalable back ends (mobile apps, loT devices)

● Helps you to execute server-side backend logic

● Allows you to filter and Transform data

Best practices of Lambda function Here are some best practices of AWS Lambda functions:

● Use the right “timeout.”

● Utilize the functions of local storage which is 500MB in size in the /temp folder

● Minimizing the use of start-up code which is not directly related to processing the

current event.

● You should use built-in CloudWatch monitoring of your Lambda functions to view

and optimize request latencies. When not to use AWS Lambda Following are the situation where Lambda is surely not an ideal option:

● It is not appropriate to use AWS Lambda software packages or applications

which rely on calling underlying Windows RPCs

● It is used for custom software applications with licensing agreements like

MS-Office document processing, Oracle databases, etc.

● AWS Lambda should not be used for custom hardware processes such as GPU

acceleration, hardware affinity.

Advantages of using AWS Lambda Here, are pros/benefits of using AWS lambda:

● AWS Lambda is a highly flexible tool to use

● It helps you to grant access to resources, including VPCs

● Author directly with WYSIWYG editor in console.

● You can use it as a plugin for Eclipse and Visual Studio.

● As it is serverless architecture, you don’t need to worry about managing or

provisioning servers.

● You do not need to set up any Virtual Machine.

● Helps developers to run and execute the code’s response to events without

building any infrastructure.

● You just need to for the compute time taken, only when your code runs.

● You can monitor your code performance in real time through CloudWatch.

● It allows you to run your code without provisioning or to manage any other server

● Helps you to execute the code only when needed

● You can scale it automatically to handle a few requests per day and even support

more than thousands of requests per second.

● AWS Lambda can be configured with the help of external event timers to perform

scheduled tasks.

● Lambda function in AWS should be configured with external events and timers

so; it can be used for scheduling.

● Lambda functions are stateless so that they can be scaled quickly.

● AWS Lambda is fast so it will execute your code within milliseconds.

Limitations of AWS Lambda Here are the cons/disadvantages of using AWS Lambda:

● The AWS Lambda tool is not suitable for small projects.

● AWS Lambda entirely relies on AWS for the infrastructure, so you can’t install any

additional software if your code demands it.

● Concurrent execution is limited to 100

VPC:

Introduction

Amazon Virtual Private Cloud (Amazon VPC) enables you to launch AWS resources into a virtual network that you've defined. This virtual network closely resembles a traditional network that you'd operate in your own data center, with the benefits of using the scalable infrastructure of AWS. What is VPC ○ VPC stands for Virtual Private Cloud. ○ Amazon Virtual Private Cloud (Amazon VPC) provides a logically isolated area 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 a selection of your IP address range, the creation of subnets, and configuration of route tables and network gateways. ○ You can easily customize the network configuration for your Amazon Virtual Private Cloud. For example, you can create a public-facing subnet for web servers that can access to the internet and can also place your backend system such as databases or application servers to a private-facing subnet. ○ You can provide multiple layers of security, including security groups and network access control lists, to help control access to Amazon EC2 instances in each subnet. Amazon Virtual Private Cloud (Amazon VPC) helps you to run Amazon resources into a virtual network that you’ve mentioned. A virtual private cloud (VPC) is a network that closely matches the old network you would run in your own data center. By “allocating a logically isolated piece of Amazon Web Services (AWS) Cloud,” the Amazon Virtual Private Cloud (VPC) is a for-profit cloud computing business that offers consumers a virtual private cloud. VPC offers considerably more granular security management by allowing the user to choose which AWS resources are public-facing and which are not. It’s “a combination of the hybrid approach, but it’s also intended to tackle the rising popularity of private clouds,” according to Amazon.

Architecture of VPC The outer line represents the region, and the region is us-east-1. Inside the region, we have VPC, and outside the VPC, we have internet gateway and virtual private gateway. Internet Gateway and Virtual Private Gateway are the ways of connecting to the VPC. Both these connections go to the router in a VPC and then router directs the traffic to the route table. Route table will then direct the traffic to Network ACL. Network ACL is the firewall or much like security groups. Network ACL are state lists which allow as well as deny the roles. You can also block the IP address on your Network ACL. Now, move over to the security group that accesses another line against the EC2 instance. It has two subnets, i.e., Public and Private subnet. In public subnet, the internet is accessible by an EC2 instance, but in private subnet, an EC2 instance cannot access the internet on their own. We can connect the instances. To connect an instance, move over to the public subnet and then it SSH to the private subnet. This is known as jump boxes. In this way, we can connect an instance in public subnet to an instance in private subnet. Some ranges are reserved for private subnet: ○ 10.0.0.0 - 10.255.255.255 (10/8 prefix) ○ 172.16.0.0 - 172.31.255.255 (172.16/12 prefix) ○ 192.168.0.0 - 192.168.255.255 (192.108/16 prefix)

Non-Transitive Peering, i.e., both VPC C and VPC B are not directly linked so they cannot talk to each other. So, to communicate between VPC B and VPC C, we need to peer at them as shown in the below figure. VPC vs Private Cloud With the help of technology like OpenStack or HPE Helion Eucalyptus, Amazon Virtual Private Cloud intends to offer a service comparable to that offered by private clouds. Private clouds, however, frequently also employ tools like OpenShift application hosting and other database systems. Experts in cloud security cautioned that employing public resources can expose users to compliance risks not present with internal systems, such as a loss of control or service cancellation. Amazon may not even be able to legally notify the client of the security breach of their system if transaction records for a VPC are demanded from them using a national security letter. Even if the real VPC resources were located in a different nation, this would still be true. Working of AWS You have complete control over your virtual networking environment with Amazon Virtual Private Cloud (Amazon VPC), including resource placement, connectivity, and security. Setup your VPC in the AWS service panel to get going. Next, add resources to it such as Amazon Relational Database Service (RDS) instances and Amazon Elastic Compute Cloud (EC2) instances.

Define the channels of communication between your VPCs across accounts, Availability Zones, and AWS Regions. Network traffic in the example below is split between two VPCs in each Region. Installing it on a virtual server that is safe and scalable, such as Amazon Elastic Compute Cloud (Amazon EC2), is an option you have. Up until the hypervisor, AWS maintains the infrastructure. You are in charge of everything above that, including taking care of the MySQL engine, the guest operating system, and the data it contains. Scaling, backups, failovers, upgrades, and security patches, among other things, are all your ecommerce startup’s responsibilities. Usually, your principal business has little to do with those chores. The adoption of Amazon Relational Database Service would be a more practical choice (Amazon RDS). You may quickly set up a running relational database of your choice in the AWS Management Console with only a few clicks. A managed service is RDS. Provisioning, patching, backup, recovery, failure detection, and repair are just a few of the time-consuming database administration duties it does for you. You may now concentrate on your application, data, and company as a result.

Type of Amazon VPC

AWS VPC Peering: Through the use of quick and dependable connections, AWS VPC Peering allows two private networks to communicate with one another. To transport traffic between VPC networks or to grant access to resources on one network to another, Amazon VPC peering connections can be used. Every single AWS account includes a default VPC in every supported region. Peering really permits communication between two VPCs based on the network address of a particular resource. AWS VPC Peering does not, however, provide transitive peering. Simply said, transitive peering means that because VPC-B is connected to VPC-C, VPC-A can communicate with resources in VPC-C via VPC-B. This VPC Peering does not support this kind of networking and communication setup. ● The VPC Architecture: a) Subnets: A network’s division is known as a subnet. Subnetting is the process of dividing a network into smaller subnets or subnetworks. We’ll now discuss public and private subnets.

Amazon Elastic Beanstalk:

Introduction

Elastic Beanstalk is a platform within AWS that is used for deploying and scaling web applications. In simple terms this platform as a service (PaaS) takes your application code and deploys it while provisioning the supporting architecture and compute resources required for your code to run. Elastic Beanstalk also fully manages the patching and security updates for those provisioned resources. There are many PaaS solutions in the cloud computing space including Redhat Open, OpenShift, Google App Engine, Scalingo, Python Anywhere, Azure App Service, however AWS Elastic Beanstalk remains one of the leading PaaS choices among app developers. There is no charge to use Elastic Beanstalk to deploy your applications, you are only charged for the resources that are created to support your application.AWS Elastic Beanstalk allows you to quickly deploy applications and services without having to worry about configuring underlying resources, services, operating systems or web servers. Elastic Beanstalk takes care of the hosting infrastructure, coding language interpreter, operating system, security, https service and application layer. All you need to worry about is writing your code. You can develop code in a number of languages which is then zipped up and the zip file is used when instantiating a new elastic beanstalk instance. Supported language platforms include: ● Ruby ● Python ● PHP ● Go ● Node.js ● Java ● .NET on Windows Server IIS ● .NET Core on Linux ● Packer Builder ● Glassfish

● Docker ● Tomcat The web servers provisioned will be familiar to most web developers and include Apache, Tomcat, Nginx and IIS. You can still maintain control over the compute instance type used by elastic beanstalk when deploying your application to the cloud and you can also keep control over the database type and level of auto scaling required for your application. You can access server log files of your deployed web application, update your application whenever required and enable HTTPS on the load balancer when required. Using the Elastic Beanstalk platform delivers the opportunity to spend more time developing and less time managing your network, storage, o/s and compute runtimes as this is all handled by Elastic Beanstalk. This leads to quicker deployment since all you need to do is package up your code, feed it to Elastic Beanstalk and the platform takes it from there. You don't need to spend time selecting compute instances, database and storage requirements, security, monitoring services, load balancing resources and so on which leads to much faster deployment. You take care of the code and elastic beanstalk does the rest. After deployment, the operations of your Elastic Beanstalk hosted applications is also easier. You no longer have to take on the role of monitoring servers, monitoring storage, managing network loads, keeping operating systems up to date since this is all taken care of by the platform. Elastic Beanstalk Features ● Elastic Beanstalk is possibly the simplest and fastest way to deploy web applications on AWS. ● It allows you to focus on writing code instead of provisioning and configuring AWS resources. ● Elastic beanstalk handles the auto scaling of resources needed to support your deployed application as demand grows or shrinks. When Elastic Beanstalk analyzes your application and selects the resources that will be required, it also allows you to step in and select alternative resources that may be better