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

AWS Foundation Module 9 Lambda Beanstalk OpsWorks PDF

Uploaded by

SUNIL THAKUR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
132 views

AWS Foundation Module 9 Lambda Beanstalk OpsWorks PDF

Uploaded by

SUNIL THAKUR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 82

AWS Foundation

AWS Lambda, Elastic Beanstalk & AWS OpsWorks

Copyright IntelliPaat, All rights reserved


Agenda
Distributed Application CloudFormation vs
1 9 What is Elastic Beanstalk? 17
Architecture OpsWorks

10 How does Beanstalk work? 18 AWS OpsWorks Services


2 What is AWS Lambda?

11 Elastic Beanstalk Concepts 19 AWS OpsWorks Stacks


3 How Lambda is Different?

Benefits & Limitations Demo: Launching a sample Demo: Launching a


12 20
4 of Lambda application stack

How does Lambda work? 13 Elastic Beanstalk Pricing 21 AWS OpsWorks Pricing
5
What is Configuration
Use Cases of Lambda 14 22 Quiz
6 Management?

Lambda Concepts 15 What is AWS OpsWorks?


7

Using Lambda with S3 16 AWS OpsWorks Benefits


8
& Hands-on

Copyright IntelliPaat, All rights reserved


Distributed Application
Architecture

Copyright IntelliPaat, All rights reserved


Distributed Application Architecture
A typical application has three components – Frontend, Backend, and
Database or other storage types

Frontend (Website) Backend (Logic) Database Service

Copyright IntelliPaat, All rights reserved


Distributed Application Architecture
Legacy Web Application

Backend

Frontend (Website)

Database

Copyright IntelliPaat, All rights reserved


Distributed Application Architecture

Frontend

Backend Database

Copyright IntelliPaat, All rights reserved


Distributed Application Architecture

The Frontend, Backend, and the database services use dedicated servers.

Frontend Server Backend Server Database Server


Only contains the design and All the processing and logical Database server is only
user interface operations are done here triggered when it is queried
Copyright IntelliPaat, All rights reserved
What is AWS Lambda?

Copyright IntelliPaat, All rights reserved


What is AWS Lambda?

AWS Lambda is a ‘serverless’ compute service where your code is triggered in response to a
event occurrence and it also manages the underlying compute resources for you!

Copyright IntelliPaat, All rights reserved


How Lambda is Different?

Copyright IntelliPaat, All rights reserved


How Lambda is Different?
AWS Lambda Amazon EC2

AWS Lambda is a Platform as a Service AWS EC2 is an Infrastructure as a Service


(PaaS) with a remote platform to run & (IaaS) provided with the virtualized
execute your back-end code. computing resources.

Environment restrictions, as it is No environment restrictions are there.


restricted to few languages only.
For the first time in EC2, you have to
Just choose your environment where choose the OS and Install all the
you want to run your code and push the software required and then push your
code into AWS Lambda. code in EC2.

No flexibility to log in to compute Offers the flexibility to choose the


instances, choose customized operating variety of instances, custom operating
system or language runtime. systems, network & security patches etc.

Copyright IntelliPaat, All rights reserved


How Lambda is Different?
AWS Lambda Elastic Beanstalk

AWS Lambda is used only for running Deploy and manage the apps on AWS
and executing your Back-end code Cloud without worrying about the
infrastructure that runs those
applications.
You cannot select the AWS resources,
like a type of EC2 instance, lambda Freedom to select AWS resources, like,
provides you resources based on your choose an EC2 instance type which is
workload. optimal for your application.

It is a stateless system. It is a stateful system.

Copyright IntelliPaat, All rights reserved


Benefits & Limitations of
Lambda

Copyright IntelliPaat, All rights reserved


Benefits of AWS Lambda

Serverless Architecture

Code freely

No VM needs to be created

Pay-as-you-go

Monitor you performance

Copyright IntelliPaat, All rights reserved


Limitations of AWS Lambda

The maximum disk space provided is 512 MB for


the runtime environment.

Its memory volume varies between 128 to 3008


MB to the function while execution

The function timeout is set to only 900 seconds


(15 Minutes). Default is 3 seconds.

Only available languages in the Lambda editor


can be used

Copyright IntelliPaat, All rights reserved


How does it work?

Copyright IntelliPaat, All rights reserved


How does it work?

First you upload your code to Lambda in one or more lambda functions
AWS Lambda will then execute the code in your behalf
After the code is invoked, Lambda automatically takes care of
provisioning and managing the required servers

Upload to Lambda Function

Copyright IntelliPaat, All rights reserved


How does it work?

First you upload your code to Lambda in one or more lambda functions
AWS Lambda will then execute the code in your behalf
After the code is invoked, Lambda automatically takes care of
provisioning and managing the required servers

Copyright IntelliPaat, All rights reserved


How does it work?

First you upload your code to Lambda in one or more lambda functions
AWS Lambda will then execute the code in your behalf
After the code is invoked, Lambda automatically takes care of
provisioning and managing the required servers

Provisioning servers Monitor and manage servers


Copyright IntelliPaat, All rights reserved
Use Cases of Lambda

Copyright IntelliPaat, All rights reserved


Use Cases of Lambda

Building a serverless website allows you to focus on your website code.


Serverless Websites
You don’t have to manage and operate its infrastructure.

Hosting your static website over S3 and then making it available using
AWS Lambda makes it easier for the users to keep track of their
resources being used.
Automated Backups

Filter and
Transform data

Copyright IntelliPaat, All rights reserved


Use Cases of Lambda

One can easily schedule the Lambda events and create back-ups in their
Serverless Websites AWS Accounts.

Create the back-ups, check if there are any idle resources or not,
generate reports using Lambda in no time.

Automated Backups

Filter and
Transform data

Copyright IntelliPaat, All rights reserved


Use Cases of Lambda

One can easily use it for transferring the data between Lambda and
Serverless Websites other Amazon Services like S3, Kinesis, Redshift and database services

Also, you can filter the data before sending

One can easily transform and load data between Lambda and these
services.
Automated Backups

Filter and
Transform data

Copyright IntelliPaat, All rights reserved


Lambda Concepts

Copyright IntelliPaat, All rights reserved


Lambda Concepts
A script or program that runs in AWS Lambda. Lambda passes invocation
events to your function.
Functions The function processes an event and returns a response.

Runtimes

Layers

Log Streams

Copyright IntelliPaat, All rights reserved


Lambda Concepts

Function Settings
Functions

Code – the logic you use in the lambda function

Runtimes Runtime – lambda runtime executes your function

Handler – the method your runtime executes when your


function is invoked
Layers
Tags – Key-value pairs your function is attached with

Description – describing the function


Log Streams
Timeout – maximum time a function is allowed to execute

Copyright IntelliPaat, All rights reserved


Lambda Concepts

Lambda runtimes allow functions in different languages to run in the


Functions same base execution environment.

The runtime sits in-between the Lambda service and your function code,
relaying invocation events, context information, and responses between
Runtimes the two.

You can use runtimes provided by Lambda, or build your own.

Layers

Log Streams

Copyright IntelliPaat, All rights reserved


Lambda Concepts

Lambda layers are a distribution mechanism for libraries, custom


Functions runtimes, and other function dependencies.

Layers let you manage your in-development function code


independently from the unchanging code and resources that it uses.
Runtimes
You can configure your function to use layers that you create, layers
provided by AWS, or layers from other AWS customers.

Layers

Log Streams

Copyright IntelliPaat, All rights reserved


Lambda Concepts

Lambda automatically monitors your function invocations and reports


Functions metrics to CloudWatch.

You can annotate your function code with custom logging statements
that allow you to analyze the execution flow and performance of your
Runtimes Lambda function to ensure it's working properly.

Layers

Log Streams

Copyright IntelliPaat, All rights reserved


Using AWS Lambda with S3

Copyright IntelliPaat, All rights reserved


Using AWS Lambda with S3

microservice

microservice

microservice
User Website Amazon S3 AWS Lambda

Copyright IntelliPaat, All rights reserved


Hands-on

Copyright IntelliPaat, All rights reserved


Hands-on

Create a function

Provide the trigger as S3 and choose the bucket

Upload an object to that bucket

This should have triggered the Lambda function. Go to the monitoring tab
under the Lambda console and check the log stream to confirm the
invocation of the function

Copyright IntelliPaat, All rights reserved


Lambda pricing

Copyright IntelliPaat, All rights reserved


Lambda Pricing

Copyright IntelliPaat, All rights reserved


What is Elastic Beanstalk?

Copyright IntelliPaat, All rights reserved


What is Elastic Beanstalk?

Beanstalk is a service where you can create, run and manage application without
worrying about the underlying infrastructure. It is a PaaS.

You can directly upload your website code to Beanstalk, and it will automatically host
the application for you with a URL. You can concentrate on the code of your application
rather than the architecture which it is hosted on.

Copyright IntelliPaat, All rights reserved


What is Elastic Beanstalk?
Beanstalk supported programming languages

Copyright IntelliPaat, All rights reserved


How does Beanstalk work?

Copyright IntelliPaat, All rights reserved


How does Beanstalk work?

You can simply upload your code and Elastic Beanstalk automatically handles the deployment, from capacity
provisioning, load balancing, auto-scaling to application health monitoring. We will look at the details of it.

Update Version

Upload App
Manage
Environment

Create Application
Launch Environment

Deploy New Version

Copyright IntelliPaat, All rights reserved


Elastic Beanstalk Concepts

Copyright IntelliPaat, All rights reserved


Elastic Beanstalk Concepts
Application In Beanstalk, an application is the folder you upload which is a logical
collection of the app version, environment and configurations

Application Version

Environment

Environment Tier

Environment Configuration

Saved Configuration

Platform
Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
Application It is a specific iteration of the code which is uploaded to Beanstalk. For
example, if first version is 1 then the next would be 1.1 and so on.

Application Version

Environment

Environment Tier

Environment Configuration
Version 1 Version 1.1
Saved Configuration

Platform
Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
Application
An environment is a collection of AWS resources on which your
application runs on. In an environment, at a time period, only one
version of an application can be running. If you want to run multiple
Application Version application versions at the same time, then you will have to create
more environments and run an other application version on it

Environment
Version 1 Version 1.1
Environment Tier

Environment Configuration

Saved Configuration

Platform
Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
When you launch an environment in beanstalk, you will have to choose one of the
Application tiers given below. The tier decides the AWS resources which should be assigned for
that environment and the type of application which it can run.

Application Version Web Server Environment Worker Environment

Environment

Environment Tier
• Using this environment you can • If you have operations in your
directly upload your web server which might take a
Environment Configuration application’s code and get it long time to complete, you can
hosted offload them to the worker

Saved Configuration • You will be provided with a URL • For example, a task which
like this myapp.us-west- processes videos or one which
2.elasticbeanstalk.com generates a ZIP archive
Platform
Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
Application Web Server Environment Architecture

Application Version

Environment

Environment Tier

Environment Configuration

Saved Configuration

Platform Source: docs.aws.amazon.com


Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
Application Worker Environment Architecture

Application Version

Environment

Environment Tier

Environment Configuration

Saved Configuration

Web Server Environment Worker Environment


Platform Source: docs.aws.amazon.com
Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
Application These are the parameters which you enter while creating an
environment. Let’s say you have selected Node.js as your runtime, then
it will be completely installed on the servers which it spins up.
Application Version

Environment

Environment Tier

Environment Configuration • You can also update your configuration whenever


you need

• Beanstalk will either apply the changes to existing


Saved Configuration
resources or deletes and deploys new resources

Platform
Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
Application It is a template which you can create. These templates contain the
configuration details and you can directly use them to create your own
unique environment. Even if you delete the environment which is
Application Version running, you can create the exact same environment with this template.

Environment

Environment Tier

Environment Configuration

Saved Configuration

Platform
Copyright IntelliPaat, All rights reserved
Elastic Beanstalk Concepts
Application Combination of an operating system, programming language runtime,
web server, application server, and Elastic Beanstalk components

Application Version

Environment

Environment Tier

Environment Configuration

Saved Configuration

Platform
Copyright IntelliPaat, All rights reserved
Demo: Launching a sample
application

Copyright IntelliPaat, All rights reserved


Demo: Launching a sample application

Create a web app

Give the application’s name and choose the platform you want (such as
PHP)

Click on Configure more options

Go ahead and explore the options; then proceed with the Single instance
(Free Tier eligible) because you will not be billed

Once it completes, click on the DNS name provided and view the sample
PHP application which is running

Copyright IntelliPaat, All rights reserved


Demo: Launching a sample application
Output of the sample application

Copyright IntelliPaat, All rights reserved


Elastic Beanstalk Pricing

There is no additional charge for using Elastic Beanstalk

You pay for the underlying resources which the Beanstalk uses
like EC2 servers, RDS databases and S3 storage.

Copyright IntelliPaat, All rights reserved


What is Configuration
Management?

Copyright IntelliPaat, All rights reserved


What is Configuration Management?

The main purpose of Configuration Management is to automate server management

How do we manage? Let’s assume you have 10 similar web servers running and you want
to run a configuration update on all of them. To open each server and install that
software is a time-consuming process. Instead, you can use create a script and run it on
each server automatically to roll updates on all servers at the same time.

Copyright IntelliPaat, All rights reserved


What is AWS OpsWorks?

Copyright IntelliPaat, All rights reserved


What is AWS OpsWorks?
OpsWorks is a configuration management service which lets you configure and operate applications on the cloud.
OpsWorks gives you the benefit of choosing between Chef or Puppet.

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Benefits

Support any application Automation to run at scale

Configuration as Code Resource Organization

Copyright IntelliPaat, All rights reserved


CloudFormation vs OpsWorks

Copyright IntelliPaat, All rights reserved


CloudFormation vs OpsWorks

CloudFormation OpsWorks
Provides business a way of creating a collection of AWS Provides businesses managed instances of Chef &
resources in a chronological order Puppet to automate server management on your EC2
instances or on-premises instances
CloudFormation concentrates mainly on what and how OpsWorks mainly works on the orchestration of Servers
AWS resources are created and managing the software configuration rather than
looking into the architecture
Use CloudFormation when you must create multiple Use OpsWorks when you must manage the
architectures of the same design configuration of multiple servers which server a similar
purpose
Example: Replication of an available architecture Example: Installing a web server in 100 instances and
running a web page inside them

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Services

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Services

OpsWorks for Puppet Enterprise lets you create AWS-managed Puppet


master servers. A Puppet master server manages nodes in your
infrastructure, stores facts about those nodes, and serves as a central
AWS OpsWorks for Puppet repository for your Puppet modules.
Enterprise

AWS OpsWorks for Chef


Automate

AWS OpsWorks Stacks

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Services

AWS OpsWorks for Chef Automate lets you create AWS-managed Chef
server. A Chef server manages nodes in your environment, stores
information about those nodes, and serves as a central repository for
AWS OpsWorks for Puppet your Chef cookbooks.
Enterprise

AWS OpsWorks for Chef


Automate

AWS OpsWorks Stacks

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Services

AWS OpsWorks Stacks, the original service, provides a simple and


flexible way to create and manage stacks and applications. For example,
a web application requires servers, RDS instances, load balancers and
AWS OpsWorks for Puppet storage. A combo of all these resources can be called as a stack.
Enterprise

AWS OpsWorks for Chef


Automate

AWS OpsWorks Stacks

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Stacks

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Stacks

Top-level entity of in AWS OpsWorks stacks. It represents a collection of


Stacks instances which are used for the same purpose, such as nginx or
apache2 on them.

Layers

Instances

Apps

Customizing your Stack

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Stacks

Each stack will have a layer. Each layer describes a component. Like the
Stacks load balancer layer or database layer.

Layers

Instances
Load balancer Layer

Apps Web Server Layer

Database Layer
Customizing your Stack

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Stacks

Instance is a computing resource like an EC2 instance. It helps in hosting


Stacks applications, serving a database or load balancing. You can use Linux
distributions or Windows Server 2012 R2.

Layers

Instances

Apps

Customizing your Stack

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Stacks

OpsWorks app option represents the code that you want to run on the
Stacks server. The code can reside in S3 or a repository like GitHub. App has the
information required to deploy the code to app servers.

Layers

Instances

Apps

Customizing your Stack

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Stacks

Stacks

Layers

Instances

Apps

Customizing your Stack

Copyright IntelliPaat, All rights reserved


Demo: Launching a sample
stack

Copyright IntelliPaat, All rights reserved


Demo: Launching a sample stack

Create a stack by clicking on the sample stack option

Go to instances and before clicking on start, edit the instance’s


configuration by changing instance type from t2.medium to t2.micro so
that you don’t get charged for it.

Then click Start and explore the other options in the stack. Such as apps.

Once the instance is running, go to the public IP and find the website
successfully hosted

Delete the stack after deleting the instances

Copyright IntelliPaat, All rights reserved


Demo: Launching a sample stack
Output of the sample application

Copyright IntelliPaat, All rights reserved


AWS OpsWorks Pricing

There is no additional charge for using OpsWorks Stacks

You pay for the underlying resources which the OpsWorks uses
like EC2 servers, RDS databases.

The pricing for each on-premises server on which you install the
OpsWorks Stacks agent is $0.02 per hour

Copyright IntelliPaat, All rights reserved


Quiz

Copyright IntelliPaat, All rights reserved


Quiz
1. What is the maximum time out period of a Lambda function?

A. 10 seconds

B. 10 minutes

C. 15 minutes

D. 200 seconds

Copyright IntelliPaat, All rights reserved


Quiz
2. What cloud service model does Elastic Beanstalk come under?

A. IaaS

B. PaaS

C. SaaS

D. FaaS

Copyright IntelliPaat, All rights reserved


Quiz
3. Elastic Beanstalk uses EC2 for hosting the application.

A. Yes

B. No

Copyright IntelliPaat, All rights reserved


Quiz
4. OpsWorks runs both Chef and Puppet on the same server.

A. Yes

B. No

Copyright IntelliPaat, All rights reserved


Quiz
5. What type of a computing platform is Lambda?

A. Serverfull

B. Serverless

C. Code as an Infrastructure

D. Database

Copyright IntelliPaat, All rights reserved


India : +91-7847955955

US : 1-800-216-8930 (TOLL FREE)

[email protected]

24X7 Chat with our Course Advisor

Copyright IntelliPaat, All rights reserved

You might also like