0% found this document useful (0 votes)
17 views8 pages

Simplifying Deployment with Elastic Beanstalk

Elastic Beanstalk is a Platform as a Service (PaaS) offered by AWS that simplifies the deployment, management, and scaling of web applications. It automates the creation of infrastructure components like instances and storage, allowing developers to focus solely on application deployment without worrying about manual configurations. By using Elastic Beanstalk, users can benefit from features like auto-scaling and seamless integration with other AWS services.

Uploaded by

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

Simplifying Deployment with Elastic Beanstalk

Elastic Beanstalk is a Platform as a Service (PaaS) offered by AWS that simplifies the deployment, management, and scaling of web applications. It automates the creation of infrastructure components like instances and storage, allowing developers to focus solely on application deployment without worrying about manual configurations. By using Elastic Beanstalk, users can benefit from features like auto-scaling and seamless integration with other AWS services.

Uploaded by

Aditya Rai
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Alright.

So, guys let us start with elastic Beanstalk, which is the next AWS
service. Fine? What is that? The next thing we are going to look at is Elastic
Beanstalk.

Okay? So what is this service all about? Elastic Beanstalk is a platform as a


service. You know, we covered that three things. What was that?

Infrastructure as a service, platform as a service, and software as a service.


Infrastructure as a service means, I will give you infrastructure like e c two, I
will give you infrastructure, I'll give you server. I'll give you hardware. I will
give you operating system. Rest required softwares, everything, you have to install
that.

But when you go with platform as a service, what is it doing? It's giving you all
the hardwares that is required, operating system, and also a predefined set of
softwares that is required to run your application. Whatever application I will
deploy to run that that environment also environment, also it is going to create
and give me. That is platform as a service. So what happens in platform as a
service?

See, in case if I want to deploy an application with instance. Am I right? Correct?


Then after what I will do, I'll create one RDS. Relational database, anyways, it
has to be created.

Whether it is elastic Beanstalk or whether it is, EC two, RDS is a different


service, we have to create that manually. Then the next thing, we will have to
create here. Okay. You know, we will have to take care of so many things like VPC.
We will have to take care of security group, security group.

Correct? So these all things we will have to manually do the setup one by one. And
then after that, install required softwares required softwares like I want Tomcat.
So you will have to firstly on your Linux, download and install what? Tomcat,
etcetera.

So to run your Java application, you might require some platform, you might require
some softwares, you'll have to all download one by one manually and do it. Correct?
So create an easy to instance, work on your VPC c things, work on the security
group, install a required software like Tomcat everything and then finally we will
deploy the application. In fact the steps might be more etcetera. But this all
needs to be done manually.

But what if I now tell you that you need not worry about creating an instance, you
need not worry about creating security groups, you need not worry about creating
all that required softwares installing that in your server, you need not worry
about that. Okay? What if all of those things are now automatically getting
configured? My job is only to deploy the application. Rest to run my application,
what if all of these things happens automatically?

Correct? That will ease my development activity. Correct? Which means instead of
doing all of these things manually one by one, if I use elastic Beanstalk, what it
will do now? It will only automatically create one, instance.

It will only automatically create one s three. Okay. Why s three is required?
Because whenever I upload any file, that file will go to s three services only. For
example, my project files.

If I further want to upload my project files, then my project files that I am


uploading will be stored in s three. Right? My project files will be stored in
which services? It will be stored in s three services. Right?

You can join USD company. There are lot of people, students of mine, already joined
Akash, no problem. Right? So understand now, you can basically now automate this
all things and make your deployment easier which means elastic Beanstalk just tells
one thing is, we will create a complete infrastructure for you, we will take care
of auto scaling, auto scaling also need not worry about here, I will take care of
auto scaling, the number of servers to be increased, decreased depending on the
load, I will take care of it. I will create an instance, I will create an s three.

Why s three is required? Because when I upload my project files to AWS, where will
you store it? Right. So even when not just files and images are stored in s three,
even my project which now I'm going to build and generate a jar file. I've written
so much of java code now.

Correct? I've written so much of java code. This java code that I've written down
here, let's say there are hundreds and hundreds of java files, dot java files.
There are hundreds of dot java file. So what I will do now?

I will compile this file and I will generate one dot jar file. I'll generate one
dot jar file. What is this dot jar file? Dot jar file is a collection of dot class
file, dot jar file is a collection of what, dot class file, okay dot class file,
fine. So whenever you do a deployment, you cannot take a direct java file and
deploy it to AWS, what is the procedure?

Firstly, you have to extract all the dot class files from your project, package
those dot class files as a jar file and then that jar file is deployed, okay, but
this jar file that needs to be deployed, the jar file that needs to be deployed
now, when you upload it in AWS, my question is where it will be saved? It has to be
saved in your s three because s three is a storage system for me for any files,
even if it is my project jar file, I will upload that in one s three. Correct? This
is what I need to do here. Now if it is easy to, there I have to also take care of
s three.

Correct? But here in elastic Beanstalk, what happens now? You need not worry about
all these things. Whether creating an s three service, whether creating an
instance, whether doing auto scaling, taking care of security groups, everything
your Elastic Beanstalk will do on its own. Okay.

So let's see how does it work now. So I will take you through the practicals that
will give you more idea now. So notice what it says, it makes elastic pitch talk
platform as a service offering AWS web services that makes it easier to deploy,
manage and scale web application and services. You can simply upload your code and
elastic pitch talk automatically handles the deployment from provisioning marriage,
one you will stand and do everything, book a marriage hall, then do the decoration
in that, then after that go ahead and put what, Okay. One table.

Yes or no? Agreed or not? So second thing will be what? I will hire one. Let's say,
this event management company.

I'll I'll hire one event management company. What is event management company will
do? The event management company will take care of end to end setup. All we have to
do is just, okay, the people have to get ready, go to the marriage function, enjoy
the function and come back. Rest all is their headache.

Right? How they will welcome the guest? How the good menu they are going to
organize? So here, there are two ways to organize a function. One way of organizing
the function is what?
You do it by yourself. Then what will happen if you do it by yourself? You have to
book a convention hall. Correct? You have to basically, you know, order for food,
each and everything.

Why I am telling this is because recently, this is what happened with me when I
organized my birthday of my son. My son's birthday party I organized because I
literally had to stand and do everything. Right? I had to basically coordinate
with, you know, the skaters. Okay, order the food.

Then after that I have to give a call. You know, chairs has come on time or not.
Then after that covers on the chairs has been put or not. Stage has been put
properly or not. Then after that gate fellow.

Right? Whether the cake has come or not. Return gifts have been kept ready or not.
Decoration is done or not. So ultimately what happens there now?

Everybody will now basically all ultimately what happens there now, everybody will
now basically all the family members are busy now organizing these things. Correct?
But suppose this is your easy to approach, but suppose if I had gone with Elastic
Beanstalk then I would just Elastic Beanstalk is like that event management
company. If I hire an event management company, I'll give my criteria. Look first,
this is what I want.

I will just select the things that is required. Rest is your job. Right. I'll pay
your fees. Rest is your job, organizes everything in a very nice manner, and 06:00
sharp, all the guests o'clock sharp, all the guest will come, okay and the birthday
party will start.

So what he will do now, he will do all the provisioning, that's the meaning of
provisioning here, he will take care of all this provisioning here, right. The
number of chairs required, let's say 50 guests were expected, suddenly 10 guests
came extra, so I cannot make them now stand and attend the party, so what I will do
now, that provisioning automatically that extra 10 chairs which is required the
event management company is going to take care of it, Are you understanding now?
Yes. So this is what is elastic beach talk. Now let's look at here how to do this.

So firstly what I'll do now, I'll go here and I'll create one sample application,
okay, for our deployment. Firstly I'll teach you how to generate a jar file.
Anyways, we're going to look at all of these things bit later, but Let me go to
spring initializer and I will create one sample application, which we will deploy.
Now I will not add here. Okay.

Okay. So now because if I add that I will have to go with RDS services, for now we
will deploy a simple spring boot application, people who are still studying java
programming classes here you can ignore this part of coding. I'll teach you in
spring boot class. Right now I'm developing an application and I want to deploy.
Your job in need of your class right now is only to understand the deployment part.

You need not worry about, sir how is he developing it? But senior students for whom
already spring boot classes is been completed, okay and we have already seen how to
develop an API, they can put this particular coding, simple coding that I am doing
it in their mind. Rescore java people will ignore this, if you want you can sleep
for five minutes, no problem, right. So I will now select here spring web maven,
Now this is none of your job. Okay.

So I simply generate a project and I want one demo project for my deployment. Okay.
So I am just taking this particular demo project copy. I will now go to desktop and
on my desktop, I am going to create here one folder called as demo. Fine and then I
will right click, paste this here and extract the file, fine.
Now the next thing what I am going to do is I will go here to our IntelliJ, I will
close all the projects and I will now open the project which is on the desktop,
right, I selected on the desktop, okay let's do one thing, let's do one thing, okay
let's drag and drop, we can open the project like this also, is this clear everyone
now, okay so now I have created one simple project and now I'm building some code.
Okay. What this code will do? It will simply print hello on your web page. It just
print hello on your web page.

I want to deploy that application in easy to, and let's see how this provisioning
and auto configuration takes place. While this project, okay, is getting loaded
here, we will not waste our time, we will go online, okay, to, AWS console, let us
login, let us login to AWS console, let's sign in and now I'm going to here select,
select, select, select this username and then I'll enter the password, right? And
then I need to give the MFA code, so let me enter the MFA code. Fine? Let me select
this.

Let's go here. Okay. Hold on okay, fine so I'm just going ahead and now logging in.
Now the very first thing that I'm going to do is, because everything is going to
auto configure here, correct? Which means this elastic beanstalk service has to now
interact with other services internally within AWS.

I've already talked about this in I am a role, right? Identity and access
management, what did I talk about? There is, if I create a role, the purpose of the
role is now to help us interact. One service can interact with other services. If
you want to create an interaction between one service to another, then we have to
create a role.

Correct? So whenever you want to deploy an application using Elastic Beanstalk, you
can just go here. Firstly, create a role. Fine. I'm going to click here and create
one I am a role.

Right. Why a role is created? Because a role needs to be attached to Elastic


Beanstalk Services and after attaching that role, your elastic Beanstalk service
will now have the required permissions to interact with other services. It has to
create an instance which means it has to interact with your ec2 instance. It has to
now create s three.

So it has to now interact with s three services. All these interactions to be done
now, I have to create a role with the specified policies. Fine. Now, what are the
specified policies? So if I just go to role here, now there are certain roles, I've
also created some role here and this role that is been by created by me, there are
one two three services that I'm using here.

Now this service is not required, no this service is required, why docker service
is required, I'll talk about docker later, right. So your application runs, there
is something called as docker containers, for now we are not going to talk about
docker but further I will be covering docker as a separate lecture, fine. For now
just blindly keep this in mind, I have to attach these three policies, but why
these three policies are required? One, for auto scaling. I want to scale my
application, automatically the number of server should increase and decrease
depending on the load that elastic Beanstalk has to take care by itself.

Correct. Second, it has to take care of creating s three services by itself. Third,
it has to, you know, let's say, perform some other activities interacting with
other services. So for that one role has to be created and attached to elastic beam
stop. Okay.
So I'm going to create a role with these three names. I'll just copy this so that
it becomes easier for us to create a new role. Let me paste this here, all these
three roles. Now, how did I get these roles? Guys, I have already created this,
okay.

Just to ensure that I remember this stuff because that was an old memory of mine,
correct. So I just created once and you know these roles are present by default in
my case. In your case, it will not be there, you have to search these things. So
pause the video and then what you do is, go here, click on roles and then after
that click on create role. Select AWS service and select e c two instance.

You see that here now? I'm selecting e c two instance and I need to now create a
role. Okay. So I'm creating a role with this policies. The first policy that role
I'm attaching is this.

Fine. Then the second role that I'm gonna attach here is what AWS elastic
beanstalk. This is your second rule. You can see that here, when you select the
number of policies you can cross check here. It is two out of 1,033.

Next, let's go here, take the third rule. If this policy you do not attach, what
will happen? Your elastic feedstock will not be able to interact with other
services. Correct. Now when you click on next, now give a role a meaningful name.

I'll just give it as role underscore some name, right, randomly. And then click on
create role. Now I've created a role. Okay. The role has been created by me.

Can you you see that role underscore bmc. Now why did I create this role? Because
now when I create elastic beanstalk services, that services have to attach this
role. So that the services after attaching this role, that services has a
permission now to interact with other services for provisioning the infrastructure
because now elastic beanstalk is going to create an infrastructure, PC two
instance, S three all of those things. So attaching rule becomes mandatory here.

Okay. Now, once you do this, go back here and search for elastic beanstalk. Can you
see that here now? And then what are we going to do now? We'll just click on create
application.

Fine. Give your application a name. Let me give it as demo app. Okay. Let me give
it as what?

Demo app. And then, here you can give the domain name, if it is available. For
example, you may give it PSA, four characters. So let's give it as, check the
availability that's available. Now if you don't give this, what will happen?

Automatically it will give some right name on its own. Is it clear everyone now,
let's scroll down, now see this is what I'm talking about, select the platform
which application you're deploying Java, so what it will do now, it is
automatically going to get us Linux operating system, how we were doing in easy to
instance, I was selecting easy to instance, I was selecting an operating system,
After that, I have to then use Linux commands. I have to install Java in that.
Correct? Which we did earlier.

Then after that, we people have to install Tomcat all that. But here, what you do
is just select the platform Java and whatever softwares are required to run my Java
application, Elastic Beanstalk will take care of it. That's the meaning of
automatically doing the required provisioning for running your application, is this
clear everyone, next, now I have sample application and upload your code, now what
is the sample application, just to test, don't upload the code, is all this created
properly or not. Let's begin with that. Single instance, we are going with that and
click on next.

Okay. Now once I click on next, it's asking for existing service role. So this is
where we have created a service role. Did you see that here now? Now this role I'm
attaching it now, to which service elastic beanstalk, beanstalk service.

When I attach this to elastic beanstalk service, it means elastic beanstalk service
can now, because of the policies in this rule, can interact with this x y z
services and create the infrastructure for me. Okay. Now, the next thing, I'll
select the keypad. I'm using a devops session. Is this clear everyone or what am I
using here?

Devops session and then after that, easy to instance profile. So choose an I'm an
instance profile with managed policies that allow easy to instance to perform
required operations. Okay. So here is where I'm now selecting this. So this is what
it says very clearly, look at that, it can perform required operations, the easy to
instances to perform required operations.

Now click on next, okay. And then after there is nothing you need to change, okay.
Launch your environment instead, launch your environment it's from default VPC. You
can create a VPC and submit. We don't know what is VPC.

That is precisely our next concept. Right. Scroll down. I'm not using database in
my project right now. I will take that exercise as well.

How to deploy an application with some cloud operation and how database integration
can be done here. Okay. So now the next thing, I am simply clicking on next. Okay.
And here, we are selecting the security group, security group I will go with the
default one, let it create the security group by itself and the number of instances
required auto scaling, you see that it is asking that what all things have to do
with it, now you can do minimum and maximum, minimum one maximum if you give 100,
at any cost minimum one server will be there, 100 servers auto scaling will happen.

Okay. And, we see for now we are using security we will learn further what is VPC,
how to create your own, okay you know private cloud infrastructure, a segregated
cloud infrastructure for your own, how we will work there, we will discuss about
that, what is subnets and all these things we will discuss about that later. Okay.
So we will take that concept as a separate concept, I have to select an
availability zone, basic, let us scroll down, let us scroll down, okay now I will
click on next and then after that you will click on finish. Okay, let's click on
finish.

Let's see what happens now. So what is now going to happen, see elastic beanstalk
is launching your environment, read that very carefully. Elastic beanstalk is
launching your environment. So this complete provisioning is happening like an
event manager, correct that event manager is taking care of what needs to be done
now in order to run the sample application, what infrastructure is required, okay
that it is going to take care of it, is this clear everyone. So this will take few
minutes because there are lot of things it has to do in the backend and meanwhile
you can keep seeing the logs here.

Fine. So create a security group, see it is creating a security group by itself,


then what it is doing, using elastic peatstock ap south one, it has selected the
region, okay as s3 storage bucket. See it has created an storage bucket. So how is
this elastic beanstalk able to do all these things? Because the policies are
attached.

Because of that policy, this elastic beanstalk is getting those rights to interact
with the other services on my behalf and create an infrastructure. See, it has now
also given me EIP, correct, what is that, elastic IP address, correct, so using
elastic beanstalk, see that created security group name, okay so what security
group it has created, now it is creating an environment, okay so as Amazon S3
storage bucket, one environment it will create now, environment means that required
java application, the required JDK, XYZ, everything it is going to install that for
me, okay. And finally we should now see here the application is ready, is this
clear everyone now? Okay. But now what happens in elastic beanstalk, one thing from
the billing point of view, okay the billing point of view is, see many times let's
say you take a car on rent, okay you take a car on rent when you want to go, you
know you go to different city, Let's say I go to Mumbai, and I want to have my own
self driven car.

I'm taking a car on rent. But now what happened, I took the car, I parked it in my
friend's house, and then after that I never used it at all. Now I cannot go and
give a call to that car renting company and tell that look, I just took the car and
I have used it only for one hour, so I will pay the money only for one hour. I will
not pay the money for twenty four hours. You take only one hour money from me.

Will you agree? What he will tell? He will tell that look, you took the car. So how
much driving you do it, where you go, where you don't go, I don't know. I'm giving
you car on hourly basis, right, per day basis.

Okay. I'm giving you a per day basis, one day billing is minimum. Now next day you
use it for half day and if you return, I will still bill for one day, whether you
use the car or not secondary. You notice the whole trip, okay the car driving
driving you have done it only for 50 kilometres, right. You have used the car for
five days, you will not charge for 50 kilometres, you will charge for five days,
whatever the pricing per day it is.

So here the problem is this, the problem is now, you can see this here, if I now
just click on it, the app launches, right. Congratulations, your app is running. So
complete infrastructure is being created by your elastic beanstalk. Now what is the
problem with elastic beanstalk is, once I create this infrastructure, whether I use
this infrastructure or not, imagine only hundred users are accessing in a month but
still I'm not built based on the hundred users accessing it, I'm still built e c
two on hourly basis, s three services. So it is it is basically, I I am being built
for the services that I'm using it regardless of the load on it.

Okay. If I've now taken these services, I have to pay the rent for it, whether I am
using it or not. So when I go to this elastic beanstalk, one thing you notice here
is you are going to pay the rent based on the duration you are using their
infrastructure, just like that car. Right, the duration of the car is what? So
there is something you will observe here, okay pay as you go.

So you will be notice that this tagline is written down. Okay. Various places. So
look at that, cloud computing AWS. Customers pay for the cloud services based on
their number usage, such as number of server hours used.

Okay, amount of data stored, right for instance if you run a virtual machine for
three hours, you are built for those three hours, correct? But what was the number
of users accessing that? Problem is only one user was accessing it, which means
server Did you understand? Did you understand what I meant? Okay because if people
are not accessing the application at all in the server, okay the proper utilization
of server has not happened like that, but still I'll end up paying what?

The fixed hourly billing, whatever calculation they're doing it, that billing will
happen. Okay. Is this clear all of you online people? So your elastic beanstalk
will work based on pay as you go. We can check here.
Elastic beanstalk, pay as you go. See you. Okay. Pay as you go, the elastic
beanstalk. See, elastic beanstalk itself does not have a pricing model, which means
elastic beanstalk is free.

It's selling, if you're using elastic beanstalk, okay, it does not have a pricing
model. What do you mean by that? I will not basically charge you, okay, for using
my elastic beanstalk services, for that there is no charges, then what charges are
for what? Instead you build based on AWS resources that your elastic beanstalk
environment uses, easy to instance, virtual servers to run your application,
elastic load balancer, RDS, S3 for all that it is billing. Now, okay.

Elastic Beanstalk platform cost. See Elastic Beanstalk itself does not charge any
additional fee. So for Elastic Beanstalk is no fees, but Elastic Beanstalk is using
these services to build an infrastructure like RDS and all. For that you are
paying, If your application is running on easy to instance which is most common,
you'll be charged based on the type and size of instance that you're using as well
as the duration that you run. So application is running, nobody is accessing it but
still you will be built.

So this is kind of a drawback with elastic Beanstalk that we have it. That's where
AWS Lambda comes in picture. Did you understand everyone? Yes. Okay.

Now let's go back here and now we will deploy our application. Correct? Let's
deploy our application but let me take that particular part in tomorrow's series of
lecture. What do you say? Yes?

Yes? Sample application create sample application delete Otherwise what will
happen? You will? Delete the application, is this clear, select this now and let us
give the application name, what is that demo app, do not forget deleting it because
you know that you will be billed for all that infrastructure it has created then
after few days you will notice that there is a build that has been generated, be
careful about it. So tomorrow we will deploy one application here, okay.

Application development part is not a part of DevOps class because Java people here
they don't know rest API. Fine? But I will still develop that in front of you so
that you can recall this information when I teach you rest API development in your
spring boot classes. Fine? So demo application is being deleted and here we would
stop our lecture.

Today's class clear? Yes? Clear? Online students? What happens is now all of these
things definitely will have to do research, correct?

Without research these things will not happen.

You might also like