AWS Fargate and ECS - Deploy Spring Microservices

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to this course on deploying spring micro-services to AWS with elastic container service easiest and AWS forget I am rangarao carnem have more than 20 years of application development experience with a variety of languages like Java Python JavaScript and a variety of frameworks REST API frameworks like spring boot and fronting frameworks like angular react and view I am also an ADA bliss certified solution architect at in 28 minutes we ask ourselves one question every day how do we create more amazing course experiences the success on a wide variety of platforms including udemy with more than 200,000 learners is a result of this pursuit of excellence we love programming and we believe cloud offers enormous potential to programmers and enterprises we believe cloud is among the top skills to acquire for Java developers today in this awesome course we'll help you to get started with Amazon Web Services will deploy a variety of Java spring boot applications spring boot microservices using AWS elastic container service easiest Fargate microservices is a complex world and containers makes it easy to deploy microservices whole deploying containers to the cloud is not very easy it obvious Fargate makes it very very easy to deploy and manage containers in the cloud and this course will be using a number of micro services a hello world micro service will be using a couple of micro services called currency exchange and the currency conversion micro services we will build container images out of all these micro services we would deploy them to a container registry like docker hub and would actually deploy all of these to AWS using AWS elastic container service as well as $1 forget this course you'll learn the basics of Amazon Web Services the focus of this course is on deploying daca based springboard microservices to AWS you'll learn the basics of AWS ECS that is elastic container service we will use easy as with ec2 as well as with a double use far gate you will learn how to create multiple instances of the same application and how to load balance between them creating load balancers you also learn how to auto scale instances based on the load we will talk about a couple of important micro services features service discovery and centralized configuration will implement distributed placing with a SS x-ray and we also implement a service mesh with AWS app mesh we expect you to be familiar with Java and some familiarity with spring spring boot and JPA and building REST API with them would be awesome to do is course you'd need a AWS account to create which you need a valid debit or a credit card will help you install all the tools that you need for this specific course the complete source code for this course including step-by-step details is present on the github repository of this specific course what are you waiting for let's have some fun deploying spring micro services to eight of us we had a lot of fun creating this course and be assured you'll have a lot of fun too if you want to learn more go ahead and click the enroll button or you can take a test drive using the free preview feature good luck and I'll see you in the course welcome back in this video let's get quickly started with the course first of all let me congratulate you for making a great choice now let's get started one of the first things that you need to do is to make sure that you bookmark the github repository of the course it would be awesome if you can star and folk it as well the killer of depository of this course is github.com slash in 28 minutes slash deploy spring micro-services to AWS ECS forget you can also find the link to the github repository in the resources section of this specific video this github repository contains the source code for all the projects that we'll be using in this course in this course we would assume that you have a little bit of familiarity with docker springs Ringwood JPA and hibernate however if you don't really have that experience you can quickly wash these videos docker in five step spring in ten step spring boot in ten steps JPI hibernate in ten steps and get started with those specific tools the thing is you don't really need to watch all these videos right enough what we'll do is when we get to a specific section of the course we will highlight what are the videos which might be important for you and at that time you might want to go and watch that specific video if you scroll a little bit down you would see all the container images that we would be building and using during this course all these I deployed to docker hub and we will deploy all these either to a table CCS or Olivia's forget some of the details related to the micro services are also present in here if you scroll a little down you would end up on the installation guides this playlist contains three videos which would help you to install Java and eclipse and test your embedded maven which comes up with eclipse if you don't have Java installed or Eclipse installed I would recommend you to follow these guides and install the right version of Java and eclipse any version of Java greater than eight should be fine and any of the latest versions of Eclipse should be cool each of these projects also contains a lot of details about them so you can see how to run that particular project how to build up container all the instructions which should be used all the resources which are exposed and all the details are also present on that specific projects readme page okay I understand I've already bored you enough with a lot of details the most important thing is to make sure that you have at least Java 8 and a latest version of Eclipse installed and I'll see you in the next step until then though I welcome back are you excited to get onto the cloud I am very very excited to get you on your journey to its cloud and the first step is to create an AWS account you need to go to your website aws.amazon.com to be able to create an AWS account you'd need two things what is your personal details including your address the second one is a valid debit or a credit card even though we are going to use a free account for most part of these courses Amazon needs your credit card or debit card details so go ahead have them handy and click the create an AWS account link you could also click the create a free account or if you don't see what those buttons you can click something only my account as well and you'd land up on a screen like this all here you need to enter the email address that you would want to use with your email AWS account and you'd want to give a password for your AWS account and confirm the password as well you can also give a account name for your AWS account so I've entered the email address passwords and also the account name we would want to use once you are done you can go ahead and click the continue button once you click the continue button you should see a contact information page you can either create a professional account which is associated with organization a company or a personal account which is associated with a person I'll choose a personal account and enter my personal details in here you need to enter your name your phone number choose your country and enter your address as well as your city state and your postal code make sure that you are giving you a real details and also give a valid mobile number because Amazon would use that to verify once you have entered all the details you can check this button to ensure that you are agreeing to all AWS policies you can click that and read through and make sure that you are fine with it you can now go ahead and click create account and continue the next screen you would see is a payment information screen where Amazon asks you for your credit debit card details one of the important things to understand is also the fact that Amazon will not charge you unless you exceed the free tire limits you can get more information about what is in the free tire by clicking this link you can also read the frequently asked questions so go ahead understand what you are getting into and once you are comfortable go ahead and enter your details in here you'll also need to enter your billing address once you have entered all the details go ahead and click this a key or submit button there might be additional screens you would see to make sure that your bank transaction goes perfectly and Amazon is able to do a transaction with your account once your bank transaction goes through successfully a badge on would ask you to confirm your identity it is done by verifying your phone number so enter your details and click contact me once I click contact me a screen with a pin would be shown to you Amazon would call you and you need enter whatever you see on the screen on your phone a few times a radius might send you a verification code and ask you to enter it on the screen I know it's kind of boring process the initial signup to get on to the cloud is little boring Amazon is giving you access to very powerful servers and they want to be really sure who you are and they have a way to reach you in case there's a problem that's the reason why the signup process is a little tricky once you verify it you can go ahead and click the continue we'll go with a free tire plan that's the one which we'll choose on the next screen on the next screen you can personalize your experience by selecting a role and also selecting an area you are interested in I would actually close this out and click complete sign up now I can actually sign into the console by clicking the sign in to the console in here or clicking my account and going to AWS management console so I'll say sign in to the console you would be taken to a screen where you can enter your email address and enter your password then click sign in once you do that you're logged into AWS that's cool that's great you now have an AWS account and let's play with it a lot more in the next step in this step we created our AWS account I know it was a kind of a boring process but this is just a one-time activity that we do and it should not be a problem for us going forward I'll see you in the next step until then bye welcome back in the previous step we created our AWS account in this step let's make our AWS account more secure let's learn about something called I a M and let's learn how to create a M user and have to use an IM user for all our AWS activities when we first created our AWS account the email ID and the password we use to create is what is called the root user the root user can be used both for the console axis as well as programmatic access to the application the root user has complete access to everything within your AWS account he can even close your AWS account so it is strongly recommended not to use the root user for your day-to-day activities even for the administrative activities it is better to create a different set of users called the I am users Identity and Access Management users so the only thing you should be doing with your root user is to first create an I am user and log down the credentials somewhere secure let's learn how to create a I am user next let's get started enough I am already logged in into the AWS console how do we get into the AWS console you can go to aws.amazon.com and sign into console since I am already logged in it directly takes me into the account let's go to services and type in I am when I type in I am you would see that it says I am and made age user access and encryption keys are it like this let's go to I am I am is used to create AWS users assign them to groups and also assign what permissions they have in AWS if I want to assign a permission to a specific user there are two ways I can do that one is directly assign a policy to him directly assign a permission to him is to create a group assign the permissions to a group assign the policy to a group and make the user a part of that group what we'll do now is take the second approach we'll create a group and we'll assign a user to that specific group so let's get started let's start with creating a new group I'll call this developers so I'll create a group called developers next step I'll need to give these developers access so what can these developers do how can I do that in AWS we have to attach policies there are a number of predefined policies which are present in here these are called managed policies and these are managed by AWS fair enough I'll give all developers administrator access you can also give them access to billing you can for example AWS lambda is one of these services so you can give full access to a SS lambda what I'll do is I will take a shortcut for now and I'll just give administrator access so they get access to everything now I'll say next step and now I can create the group now we have a group now I would want to actually go back so dashboard we have a group what you would need to do enough we need to create a user how do we create a user what we are doing in here is creating a user for our AWS account I'll say add user on this screen you can enter the ID you'd want for that specific user I'll say in 28 minutes underscore dev as you can see here you can create multiple users at the same time with similar kind of accesses but let's stick with one user for now next thing you can select is the AWS access type now what is access type typically whenever we talk about performing actions there are two type of users one is people who would want to actually log in use the UI and perform actions other kind of users might be programs so you want to write a program to create some resource in AWS so that's why there are two kinds of accesses which are present programmatic access and AWS management console access what we are doing enough is using the AWS management console access we use the AWS root account logged in and we are manually going through these screens and doing all the action so what I'm doing is I'm giving AWS management console access to this user so this user would be able to log in with his user ID and password and do exactly what we are doing in here so he'll be able log into console and perform all the actions I'll also provide programmatic access to this user what does programmatic access LF for example if you have a command line tool AWS CLI it of the CLI is a command line tool where you can run commands and do things with AWS and when you want to use AWS CLI you would want to use programmatic access and there this kind of access type will be really useful we talk about programmatic access a little later for now the important thing is the fact that we are giving this user both types of access so you can use this user credentials for logging into a SS management console as well as through a programmatic means and let's use custom password so I would want to assign a specific password you can also use auto-generated password but let's go with custom and what we can also do is to have the user create a new password when he tries to sign in for me that's not important so I'll uncheck that and let's click Next the next thing is to assign a group so I'll assign a group of developers for this specific user you can assign multiple groups here we have only one group so let's assign just that let's not worry about tags for enough let's go to the review screen where we can see the fact that we acquire a user called into a date in this underscore dev we are providing him programmatic and AWS management console access and we are assigning him to a group of developers and let's go ahead and create user so what you would see enough is a success screen so you would see that we have created a you successfully now I would want to login with this specific user credentials can I go to aws.amazon.com and use that URL to sign in with IM user credentials which we created just enough the answer is no the important thing you need to remember is from now on to login into your account into your AWS account as an I am user you need to use this URL so I have taken this URL copied it I'll log out so I'm signing out of my account and I am pasting the URL which we have copied so let's paste that in I would go ahead and enter my user ID and password and sign in now you would see that we are again logged in to our AWS management console in this step we created a I am user and we logged in with the I am user credentials and from now on we'll be using I am user for performing all our activities with our it appears account I'll see you in the next step welcome back before we get our hands dirty let's get a 10000 feet overview of what we would be doing in this specific course we would be deploying containers using AWS ECS to eight of us we know that AWS is a very very popular cloud provider now what is cloud what is AWS why is it popular what is a container why do we need ECS these are kind of the high-level questions in everybody's mind if you are already familiar with this feel free to skip this video and go on to the next one however if you want a quick 5 minute overview of all this stuff go ahead the most important feature of cloud is on-demand resource provisioning let's talk about the good old days where if I need a server I would need to start planning months ahead but with the cloud it's on demand I need it enough I place a request I would get the resource that's the most important feature of the cloud on-demand resource provisioning let's think of the use cases let's say I'm running an online shopping application Amazon is a very very good example you know that these applications have varying loads through the year on the Thanksgiving Day they have very very high load and on other days maybe it's not as much load if you have the data center sitting with you then you need to provision resources that would satisfy the peak load and rest of the year those resources would be sitting idle if you use the cloud then when you have peak load you provision resources and as soon as the peak load is over you would release them consider you are a start-up you hope it would be successful but you don't know how successful it would be so should you procure all the resources have them in a data center or should you make use of the cloud and provision resources as and when they are needed as and when you are successful cloud is really helpful in a variety of use cases and that takes us to AWS Amazon Web Services AWS is the leading cloud service provider the two competitors are as your Microsoft Azure and Google cloud provider or the GCP AWS is not just the first among them but continues to build the leader in terms of the variety of services provided it provides around 90 plus services with a wide variety of features during the last decade italy's established itself as reliable secure and also cost-effective we go to cloud for on-demand resource provisioning and AWS is the leading cloud service provider now the next question is why do we need containers as we all know we are heading towards microservices architectures if you're billing a large monolith we would build a number of small micro services which talk to each other and with these micro services you don't want the deployment of them to be complex you would want a simple deployment process imagine that your operations team is trying to deploy a application let's say it's a spring application which is built using what are the latest versions of springboard to deploy that application let's say you're providing a jar file what should your operations team do the first thing they would need to install is the operating system let's say you provided an instruction saying Linux operating system the next thing they would need to install is the software you'd need let's say you'd need maven you'd need Java you need to specify which versions if there is any environment configuration that is needed you need to specify that and after that you need to specify the application configuration all this stuff is manual you are providing manual instructions to your operations team saying install this specific version of OS this specific version of the software this Pacific version of the application and the chances that they make a mistake is very very high and that's where containers come in with containers all that you need to do is you will build a container the container contains all the things that are needed to run your application it contains all the software it contains all the configuration and it contains your application so all that you need to tell your environment guide to do is hey here is the container go ahead run it and thereby the chances that your operations team makes a mistake are drastically reduced the most popular tool to create container images and run them is docker if you are new to docker I will recommend you to go to the github repository and watch this video docker in five steps it will give you an excellent introduction to the world of docker and containers now you have a container for each of these micro services in the micro services world there are a lot of containers there are a lot of instances of each containers that are running managing them is really really difficult and that's where container orchestrators come into picture - the container Orchestrator you would provide the image of a container and you will provide the configuration you'd say I need five instances of this container running and each instance would need one gig of memory and one virtual CPU so that's the input that you would give to the container Orchestrator and the container Orchestrator would make sure that it deploys everything down to a cluster the cluster is nothing but a set of virtual servers in a SS terminology a virtual server is something called ec2 Elastic Compute cloud easiest is nothing but a container Orchestrator easy a stands for elastic container service earlier it was called ec2 container service but now it's renamed to elastic container service and to easy as you provide ok I need to run these containers I need X instances of container a bi instances of container B and container a needs this much amount of memory and CPU container B need this much amount of memory and CPU and ECS would make sure that these containers are deployed into a cluster cluster is nothing but a set of ec2 instances a set of virtual servers there are two variations of easiest easiest with ec2 instances and something called far gate in easiest with easy to instances you would need to manage the cluster as well so you need to say I need five ec2 instances I need 10 ec2 instances I need to increase number of ec2 instances and stuff like that ECS using forget you don't really need to worry about what's in the cluster a damages takes care of it all that you need to do is provide the container images and configuration and aw forget would take care of deploying those to your cluster you don't care what's in the cluster a double yes would take care of that to summarize we go to cloud because we would want to get resources on demand we use AWS because it's one of the leading cloud service providers as well as it's very very reliable and offers a number of services we go to containers because it makes deploying micro services very very easy and we use container orchestrators to deploy these containers to clusters ECS is AWS proprietary implementation of a container Orchestrator it is very very similar to kubernetes which is also a container Orchestrator there are two variations of easiest easiest with ec2 instances and AWS forget in easiest with ec2 instances you would manage not only the container and container configuration but also the cluster you would manage how many instances are there in the cluster and all that stuff however with Fargate you don't really care about what's in the cluster you just care about the container image and the container configuration and a double use would provision the necessary resources necessary virtual servers to deploy your containers as per your configuration the idea behind this step was to give you a ten thousand feet overview and if some terminology was not really clear that's not a problem at all over the course of next few steps we would discuss each one of these in detail I'll see you in the next step welcome back are you ready to deploy a first container to be cloud if you are let's get started enough there are two things you need to ensure number one I'm logged in to the AWS management console as an I am user I am using the user ID that we created earlier the I am user in 28 minutes underscore dev number 2 I am in a specific region called US East North Virginia make sure that you are also in this specific region those are the two things that you need to ensure before we can get started in this step we want to deploy a sample application using Fargate how do we do that let's get started services type in ecs I'll click ECS down here this would launch up the getting started wizard and you can click the get started button down here as you can see in here the URL shows first run with a capital R if you don't see the getting started wizard you can also type this URL in the first one wizard helps us to create something called a container and a task definition it helps us to define a service it helps us to define a cluster finally review it and then create and deploy our application there are a lot of things that the first run wizard does automatically in this step let's focus on running through these steps and getting them working and in the subsequent steps we would try and understand each one of these things in detail we'll talk in detail about what is the task definition what is the service what is a cluster we'll talk about all that stuff as we go on for enough let's focus on getting our application running I'll go further on the first part is defining a container I'll use the sample application which is provided by AWS so I'll leave it at sample app next thing that you would need to define is the task definition so we would want to run a container and to run a container we need to define a task with that specific container to get a proper name I will click Edit we would be running a sample app as part of this Val say sample app tasks definition it's always important to make sure that your task definition has the name of the container in there so that it's easy to understand what the task definition contains I'll leave the other stuff at defaults and say save we can click Next we would go on to be service definition screen a task definition defines what container to run a service on the other hand defines how many tasks to run do you want to use a load balancer and all that kind of stuff so if I want to run five instances of the application I would define it as part of the service so if I go further down there's a name given to this service it's a sample app service that's that looks cool it says number of desired tasks is one and four enough because there is just one task running let's not worry about the application load balancer let's just have no load balances to start off let's leave other stuff at defaults and click Next now we have defined that we would want to run a specific container as part of the task we would want one instance of that task as part of the service now where do we want to run this task you would want to run them in a cluster now over here we need to define our cluster you need to give a name to our cluster I'll give a generic name to this cluster because we can use this cluster to run any number of services or tasks so I'll call this a dubious Fargate cluster we'll leave the rest of the stuff at default and click Next the next screen we can review what we have configured we have configured a task definition saying we would want to run a container sample app which is provided by AWS we'd want to have one instance and we have named the cluster there are a few things in here that you might not understand don't worry about them we'll get to them as we progress in this specific course now let's go ahead and click the Create you'd see that the creation of everything that we have configured has started this would take a little while about five minutes I would think it says up to ten minutes in here if you want to grab a coffee go ahead and get yourself a we in the step we started deploying a first container using Fargate we saw that there are a lot of concepts there a lot of new terminology that I present as part of this configuration not really worried about them let's try and get something working and then we would focus on each of the individual concepts I'll see you in the next step until then bye welcome back in the previous step we kicked off the deployment of our first container using and it took about five minutes and the entire nine of nine steps of preparing the service is complete you can see that there are a lot of resources which are being created in here a cluster or task definition or service and there are the things created in here a log group you can see that a cloud formation stack is created and VPC subnet and security groups one of them is I have taken a screenshot of this screen so that we can actually pursue each one of them in the subsequent steps in this step let's try and run the application that we have created what I'll do is I'll say view service so that's a view service and once you do that this is the page where you can see all the details of the service that we have launched over here there are a number of tabs what I'll do is I'll go to something called the tasks tab we said we would want to run one task as part of this service and that's the reason why you can see that there is one task which is running as part of this service what I lose I'll click the task link so I'm clicking the task link over here and once I click the task link I can see the details of the running task you can see that the status of this specific thing is running over here what I would want to do is I would want to run the application which is part of that specific task how can I do that the way you can do that is you can use the public IP of the task so I'm going to use the public IP of the task and open a new tab and say control V you can see that you are able to see the application up and running it says and where's on easy a sample app congratulations your application is now running on a container in M is on easy yes isn't this wonderful now you might say hey Rhonda the application is running there's a lot of magic happening in the background I am NOT able to understand what is really happening behind the application we start to anchor the magic and look at what's happening in the background in the subsequent steps until then bye welcome back congratulations on successfully running your first container and launching it up in a browser in step let's focus on understanding a very very important concept called task definition how can you see all the task definitions the way we can do that is by saying services go to ECS and over here you can see the task definitions as the second link now what you really want to deploy using easiest we would want to deploy containers first definition is the place where you put all the information about your container so you define what are the different containers that would be part of the task you define how much resources do each of these containers need and a lot of other configuration you can see that there is a task definition which is already created in here this was created as part of our first run wizard now if you click it you can see that it takes you to a specific revision of the task definition the thing is each time you modify a task definition you are creating a new revision of that specific task definition so each task definition has a task definition name and a revision now if I click this revision you can see that there is a button to enable us to create new revisions but what we lose will focus on what is present in here you can see that there is a little bit of configuration of this task and down below if you go further down is where you have all the container definitions this is the container which we have launched as part of our sample application to understand task definition further let's try and define a new task definition I will go back to the task definitions and say create new task definition the first thing it asks is or ec2 we'll talk about easy to versus per gate a little later let's choose forget for enough and say next step when you are defining a task the first thing you need to do is to give the task a name typically you would use the task deficient name to kind of give an indication of what it's running and I think one of the best ways to represent that is by giving the container names now what container do we want to run as part of this task definition we have already created a container for you the container is for the hello world rest API application the details of the container is present down here so if you go to the container section the hello world is where the detail of the specific container is this container is actually deployed to something called docker hub which is where we would use it from as we go further in the course we will learn how to create containers for your spring boot applications and how you can deploy them to something called docker hub what I will do is to name the task I will use the name of the container so I will say AWS HelloWorld REST API you can either type it in or you can actually paste it from the github repository the next thing that we would need to configure is something called a task role once we configure all the containers what is easiest need to do it needs to download the container images from the docker registries maybe docker hub maybe the container repository which is provided by AWS itself now to be able to do that it needs certain permissions how do we give those permissions that's by using tasks role so I would need to configure easiest task execution rule this role was created by the first run result and it has permissions to be able to go and download your container images we will leave the rest of this stuff at defaults and go on to something called task size the task size is a very very important configuration a task might be having a number of containers which are running as part of it the task size defines how much memory and how much CPU you would need I'll start with configuring 0.5 GB of memory and 0.25 B CPU of CPU so I am saying to run the task you would need 1/2 GB of memory and 1/4 of a virtual CPU the reason I am choosing a lower amount of memory and lower amount of B CPU is to keep the course low we are just trying to learn in here and lower configuration will allow us to reduce our bill now we can move on to defining our container finish so I'll say add container over here I can define a name for the container which image the container image path what's the path to the container image we know it right so I will copy this from here or you can even type it in if you want to make sure that you actually type the exact one as it is from here I would pick up the container name and put it down here so the name of the container is a double use HelloWorld rest api in 28 min a to the seller will rest api and the image has the release at the end the next thing you can configure for a container is a optional configuration called memory limits earlier we said the task can have up to 1/2 GB of memory and over here you can define how much memory a container can have a task can have multiple containers and for each of the containers you can specify the limit in here there are two kinds of limits a soft limit and the hard limit a soft limit is how much should easy is reserved for this specific container so if I specify 100 in here then what easiest does is it would reserve 100 MB of memory for this specific container the hard limit on the other hand is all about what is the maximum amount of memory that this container can ask for so if I say a hard limit of 200 that's the maximum that this container can get if it tries to exceed that limit then it would be killed you can read much more about hard limit and soft limit by going over information icon if you horror it you can read this stuff which is present in here it says if you specify a hard limit your container will be killed if it attempts to exceed that limit if you specify a soft limit it's also called a memory reservation easy as reserves that amount of memory for your container now I don't really want to worry about hard limits or soft limits because we are only going to have one container as part of this specific thing I'll move on to the next important configuration which is a pole mapping a port mapping specifies what port from the container you would want to expose to the host we have created this specific hello world application to run on port 80 so I would need to configure eighty I would not want to worry about the rest of the details for enough I'll go ahead and say and we can also add more containers if you would want to run them as part of the same to ask but let's not worry about it right enough let's have just one container running let's take the defaults for the rest of the configuration and say create in this step we saw the basics about task definition we saw that the task definition allows us to define the configuration of the task one of the important configurations is how much memory and how much CPU does the task need and it also allows us to define the containers which would be part of the task now we have a task definition but we would want to run this task how do we do that that's what we would explore in the subsequent steps I'll see you in the next step until then bye welcome back in the previous step we created a task definition we created a task definition AWS HelloWorld REST API in this step you want to be able to run that how can we do that we need to understand the concepts of cluster and a service let's get started with that right now I would go to clusters and once you go to the clusters you can see that it says Amazon easiest cluster is a regional grouping of one or more container instances where you can run task requests so basically cluster is a group of virtual servers group of ec2 instances where you can run your tasks we have already created a cluster earlier the first one wizard created a cluster for us which is called a double es forget cluster if I go inside that cluster you can see the running instances of services and tasks so you can see that in here it says active service count is one far gate so we have one forget service running and one forget task running as well in the first one result we have actually created a sample app service defining the fact that would want one instance running so we said we would want one instance of this task running let me expand this a little bit so we said we would want one instance of sample app task definition running at all points in time so to be able to run your tasks and manage the running of your task you need to create something called a service so let's create a service right now I'll say create and the service type that we would want to create is Fargate make sure that you are choosing the right task definition so we would want to use AWS hello world REST API revision one let's use the latest version of forget platform make sure that you are choosing the right cluster that is the one which we created in the first run result AWS forget cluster now you can give this v's a name typically I would actually keep the name of the service and the task definition very similar so I'll say a double yes hello world REST API service this would allow us to recognize the service runs this - definition so now let's keep the number of tasks to one and rest of the stuff let's leave it at default and let's do next step on the next step we would want to configure the network the first thing that we need to select is something called a vp c vp c stands for virtual private cloud it is like your own private network in the cloud this is screenshot I have taken when the first one desired completed executing and over here you can see that a VPC was created for us and you can see the VP CID also present in here creating this VPC allows us to protect all the resources in the V PC from anybody outside the V PC make sure that it shows the V PC whoring one which you would see a SS forget cluster so when I or over V PC with the ID a a in the last two characters I can see ECS a SS forget cluster in the PIP so I'll choose that creepy C because that's the V PC we created and we would want to use it the next thing which would need to configure is something called a subnet a certain it is nothing but a segment of your V PC you can configure different rules for different segments of the V PC for different subnets for example let's say a subnet contains your web server people from outside the subnet should be able to access your web server in that kind of situation you would create rules to enable public access to that subnet let's say a subject contains your database for that subnet you not need to allow public access only your applications should be able to access your database in that kind of situations you would restrict access from outside in that kind of situation it's called a private subnet when we ran the first one result it created two subnets for us subnet 1 and subnet to you can choose either of those subnets to run this specific thing I will use us east 1a you can see there is a public subnet one which I am making use of right now the next thing that you need to convey is something called a security group a security group is a virtual firewall it configures what kind of traffic you would want to allow to your specific task you can say I would want to allow traffic on this port let us do a edit in here and over here what you can see is the fact that we are creating a new security group and we are allowing graphics we are allowing inbound traffic on port 80 we play with security groups a little later for enough I would leave the default port 80 in there and click Save the next thing you can see in here is whether your task needs a public IP so enough we want to actually be able to access the tasks so we will say enabled let's not worry about load balancing and health checks fair enough make sure that you turn off service discovery later in the course we'll use service discovery to enable communication between two micro services phone up let's not worry about it make sure that you uncheck this checkbox and click next step a service can also help you to configure auto scaling rules based on the load that your application is receiving you can increase the number of tasks decrease the number of tasks and such stuff we'll look at auto scaling a little later for now let's take the default and say next step you can review the configuration in the next screen make sure that the task definition is AWS HelloWorld rest api the service name also matches that AWS LOL rest api number of tasks is one and go ahead and click create service this would create the service this would take a little while what I'll recommend you to do is take a break take a coffee and come back in this step we started creation of a service to be able to run our tasks we had to configure a variety of things to get the service up and running I'll see you in the next step until then bye welcome back in the previous step we created this service in this step let's see what's happening behind the background if I go down in the screen I can say few service over here I can see the tasks which are running as part of that specific service so as part of AWS HelloWorld REST API service there is a one task which is running right now if I go back to the clusters you can see that this cluster now has two services and two running tasks if you don't see two running tasks yet and if you see just one running task then probably you need to wait for a little while if you go into the cluster you can see the services and you can see how many tasks are running for each of these services if you see zero down here then you need to wait a little while while the task comes up once you see that there is one running to ask for it you can go ahead and click that service and over here on the inside you'd be able to see the running tasks you can see that as soon as we created the task definition and we created a service the service ensures that the task is running when we define the service we said we want one instance of this task to be running and that's what service ensures it would make sure that one instance of this task is always running now let's try to access the REST API which is part of that specific service I'll click this task I would need the public IP of that Pacific task so this is the public IP of that specific task and I can take that and type it in you can see that there is an error which is being thrown out that's cool REST API which is exposed this slash hello world if you are typing the public IP of the task followed by slash hello world you should see this there are a couple of other PP eyes so hello world bean is JSON API so it's returning a proper JSON response if you don't see the formatted JSON response maybe you have to install a JSON your plug-in in your Chrome but you should see something of this kind you should see a message coming back so if you are able to see this then it means we are able to access the rest API exposed by the task let's try a few things right now let's go back to the cluster and over here it will be a swagat cluster and what I lose I'll go to the tasks and try and kill this task so what I would want to do is try and kill the task which is running so I'll say it obvious hello world REST API this task I would want to stop let's say due to some accident this container stopped working and let's say stop and stop so what is happening now is that container is no longer in the running tasks when I go to this top screen I can see that this task is now being deep revision and it's actually being stopped that's cool if you wait for a little while and go back to the running task you would see that a new task was provisioned so you can see that it's actually showing a status of running so you'd see that this task is a new task because if we go there if you click the task you can see that this public IP would be different from the earlier public IP which we used so earlier we use 3.90 2.60 2.96 you might have something different but you would see that whatever we used earlier is different from what we have right now and if you execute the URL you would still see that the API is working if the API does not work make sure that you wait for a couple of minutes and the API should be up and running so what we saw is that when we kill a task what's happening the service is making sure that it launches up another task what we'll is specify that I would want one instance of a task running this service ensures that one instance is running always if it sees that a task goes down then it would automatically bring up another new task now let's try and have more tasks configured for that specific service let's go back to clusters let's go back to the specific cluster which we are interested in let's go back to the hello world REST API service and let's click update so we are trying to update the service what objective want to do we want to increase the number of tasks to two so I would want two instances of this task running I'll say skip to review I don't really want to configure all the other stuff and click update service I'll go back to viewing the service you can see down here that now it says desired count is two and running count is one so basically what it's saying is you would want two tasks running but currently only one task is running and if you go to the touchscreen within a little while you would see that there are two tasks of this specific thing running in a nutshell the most important thing that you need to remember about the service is your service manages your tasks you can configure how many tasks you would want to be running and the service ensures that that many tasks are running at all points even if you killed it us even if some of the tasks fail even if some of the containers failed the service would be monitoring that and making sure that a new task is created in the step we further understood the concept of a service just to quickly review the concepts that we understood until of a task definition defines what are the containers that should be part of a specific task a task is a running instance of a task definition a service helps us to make sure that a certain number of tasks are running at all points in time I hope you are having a lot of fun and I'll see you in the next step and Allah welcome back as they say with great power comes great responsibility cloud gives you great power you can provision powerful resources at a click of the mouse however it's your responsibility to know what the cost of the power that cloud is providing you with any step let's look at five recommendations to keep your costs as low as possible number one set billing alerts if you look at the depository of the course there's a video on how you can set billing alerts for your account make sure that you set those building alerts the second thing that we recommend is for the first week that you are making use of cloud monitor the building dashboard every day whenever you are accessing the course the first thing in the day check your billing - would see if you are getting built for anything it's easy to access your billing dashboard all that you need to do I am logged in to the I am account and I am trying to access my billing dashboard it's going there and it says you don't have permission to access the billing information for this account I log out of this account and go to the root account from the root account we need to give it give a permission sign out sign in again I would sign in with root credentials click on into an 8-minute or your name there and click my account this will open up in a new window and over here you can search for I am this is where you can configure it you can see I am user and role access to billing information you can see that currently the I am user role access to billing information is deactivated but because we will be using the I am role for the most part during the course we would not enable access to billing because that could be easy what you can do is click at it and say activate I am access and update now you can see that I am role user access to billing information is activated I will go to I am I'll copy this URL and I will try to go to the I am console I'll sign in with the I am credentials and let's see if we are able to access the do billing dashboard right now congratulations so you are able to now just see the billing dashboard and you should see 0 & 0 in here because you if you have not really started creating a lot of AWS resources yet you should see something very very near to zero and zero I am recording this video at the end of the course so as I was recording the different sections of the course this is what I was finally build from AWS for this specific month as you can see in here not all resources that we would be using in this specific course are in the free tile you would be billed for a few of these resources let's look at two things right now one is what are the free tire services that we made use of and the second one is brought up to be really billed for let's start with the free tire services you can see over here the different services the frita usage limit what is the current usage and how much percentage of the free tire usage for the month have been consumed you can see that for RDS there are two matrix 20 GB of database storage and 750 ours of T 2 micro instance and you can see that I have consumed about 60% of both these metrics if I go about 100% I will be billed for these as well so make sure that you're stopping the databases when you don't need them and once you finish the course you terminate the database do not worry we'll have frequent instructions at the end of the sections on what are the resources you might easily clear out you can also see that I have used about three fifty five hours of ec2 instances when I am recording this course this is about 47% of the free tire usage we use code build to set up CI and CD and you can see that I have used about five percent of the free tire we use easy to container registry that is ECR to store our docker images our container images and we you see that I have used about two percent of it you can see that most of the other usage is almost negligible I'll go back and look at what have I really been billed for let's go to the build details you can see that the only real thing that I have really been built for is easy to container service that's easy as actually now it's called elastic container service still in the bill its shows as easy to container service and even this says easy to container registry that's interesting now let's not worry about it let's go to us East North Virginia that's the region which should be using throughout the course you can see that over here there are two important things I have been billed for one is forget and it says memory and the other one is again forget and it says V CPU you can see that I have been billed for memory about ten sets for V CPU about 46 cents will be using easy as far gate as the container Orchestrator for deploying our containers whenever we define a container we need to specify the resources that it needs and we would specify the resources in terms of how much virtual CPU it needs and how much GB of memory it needs you can see that for the jeebies of memory I have used I have been charged ten cents and for the CPU resources I have been charged 46 cents so when you're using easiest forget remember to keep the number of containers running to as minimum as possible that would ensure that they consume as less resources as possible and you will be billed less for most of the other things we are in the free tire so we are fine if you are not in the free tire then you would also be billed for the other stuff that's the second one keep monitoring it every day the third and the most important one is to stop resources when you are not using them I know we come from a background where we procure the servers and in our dev environment skew anyone when staging environments we are not used to stopping them at any point in time you just keep them running all the time but that's not how cloud works cloud is on demand and you are charged for keeping your resources running and therefore you should optimize the use of your resources so if there are any easy two instances if there are any relational databases if there are any load balancers anything which is expensive would have them running all the time if you're not using it just stop it and that applies to this course as well if you bring the course for an R at the end of the hour terminate all environments do not leave them running cloud is here to stay and this is a habit we should develop as a responsible cloud developer the next two things are little hard to do especially when you are getting started with the cloud understanding the free tire understanding the fact that there is a 12 month limit from the time you created your account to most of the things which are there in the free tire and understanding how pricing works for different resources these are little tricky things at the start these are things you'd learn as you go but make sure that you access these two resources the first one is AWS free tire just Google for aw sweet air you'd get onto this page and you can see what are all the things which are part of the free tire the important thing to understand is there are certain things which are only free for the first 12 months of your account and other thing is these rules could change any time so make sure that you look at the rules see what are free for 12 months what are free forever and make sure that your usage is monitored understanding how pricing works Rd and resources is even more complicated especially when you're getting started you can do a google for AWS pricing and you know end up on this page AWS pricing it's not easy to understand all the pricing because there's a lot of fine print to most of it but just try to get a high level overview of of how pricing works for example ec2 instances are built when you keep them running so the longer you run them the more they would cost you storage might work a little differently for example if you take s3 you'll be billed based on how much amount of storage you are making use of how many gates you are doing how many puts you are doing and all that stuff just spend some time in here to get used to the whole fact because these two things are hard to do things I would recommend you to do is the first three things make sure that you are sitting building alerts make sure that you are watering it every day and make sure that you're stopping resources when you're not using them building is one of the most difficult topics for somebody who's getting started with the cloud it's something you'd get used to or a period of time make sure that you are there to the first three rules and you would see that you do well over a period of time I'll see you in the next step welcome back in the previous step we were talking about how you can reduce building and one of the important things we said was set building alerts in this step let's look at how you can set building alerts for your AWS account I'm logged in with my I am account in 28 minutes under school dev you can actually do this changes with either the root account or the IM account but as always it's recommended to do these kind of stuff with your iam account I'll click the link in here and I'll go to my billing dashboard and over here inside the building we can set building preferences so what we want to do is we want to receive a PDF invoice by email we want to receive free tire usage alerts and you would also want to receive billing alerts so I'll do this and say save preferences once you click save preferences the billing alerts feature is enabled but how do we configure the actual billing alert to say okay if the billing goes about this amount I would want to be alerted how can I configure that earlier there was just one option for doing that that was called cloud watch which is what is redirected by this link now there is a new feature called budget as well either you can click the link here and go to cloud watch or we can directly go to cloud watch from here so I can type in cloud watch in services and pick up cloud watch from here cloud watch is basically a monitoring service so you can monitor the AWS services and trigger alarms when something unexpected happens for example if you see that the usage of a specific resource is greater than a specific thing if CPU is used beyond a certain limit all that kind of stuff you can actually configure using cloud watch for now let's restrict ourselves to billing make sure that you are selecting us east North Virginia as the region make sure that you are selecting us is North Virginia and now you can go ahead and click building you can see that you can get ten free alarms and thousand free email notifications each month as part of your AWS praetor so let's go ahead and create the a lab so when do we want to get the alarm when the estimated charges over six hours is greater than let's say zero USD and click Next what should happen when it's greater than zero USD we would want to actually create a email so what I am saying is we are s NS is something called simple notification service this can send email to us when the cloud watch alarm is triggered so the when the alarm is triggered we would want our email to be sent so I will say building cloud watch alarms topic and the email id which I would want the billing alerts to be sent to I can say create topic once you do that you might need to validate your email address if you get an email on your email box if you don't that's fine all that you need to do next is to go ahead and click Next now I can give the alarm a name I'll say billing alert I'll say next you can review everything that we have specified in here what we are saying is when estimated charges is greater than zero send a notification to this specific topic and that would send us an email nothing will create an alarm and you'd see that we have successfully created an alarm called billing alert the other option to create an alert would be used to use budgets so we can use Olivia's budget that's another service which is recently introduced into AWS which is used to monitor your budgets let's create a budget the different types of budgets that we can create let's only worry about the cost for now so cause budget and I'll say monthly cost budget and let's set a fixed amount of $1.00 I cannot use 0 in here so I'll set a fixed amount of $1.00 as the budget including everything and I'll say configure alerts what do you want to configure as an alert I'll say send alert based on actual course then we cross more than 10% of the budgeted amount so as soon as we are spending more than 0.1 $0 I want email to be sent I'll configure my email id it went admins at gmail.com and say confirm budget let's review everything and actual costs are greater than zero point one we actually get a email so let's go ahead and say create so we created a budget with an alert as well with any of the cloud providers it's very very important that you are on top of building that's basically what we are doing we created a couple of alert one using cloud watch the other one using the new budgets feature both these features when there is some amount of building that happens you will be notified immediately I'll see you in the next step welcome back one of the important things that we need to always focus on when we are running something in the cloud is the cost running applications in the cloud is not free and the same is the case when you are using forget so to help us keep the costs low what we can do is we can make sure that all these services are running the minimum instances that you would need and because we are just learning what we will try and do is as soon as we create a service and we played around with it sufficiently what we'll do is we'll make the number of instances zero so let's go back to our forget clusters and I'll open up these two services in new screens let's go to update and let's reduce the number of tasks to zero I'll just skip to give you and update service I'll do the same thing in the next tab as well I'll say update now we are working at the hello world REST API service so let's wait for rest of the things to populate makes number of tasks zeros keep to review update service what we are doing is we are saying the service needs to make sure that zero instances of the tasks are running so that will help us reduce costs associated with running those tasks I'll close these two tabs and go back to the original tab and refresh the screen cool now you can see that the desired task is zero and the running number of tasks is zero as well so if I go to the task I don't see anything running if we need anything further in the course what we'll do is we'll increase the number of tasks that are part of the service and start it up for that specific movement and after we use it let's try and set it back to zero so make sure that this is a practice you keep following I'll see you in the next step until then bye welcome back the previous steps we created a task definition and then we used a service to launch the tasks you might be wondering is using services the only way to launch tasks the actual answer to that is no if you go into your cluster you can see services and oh here you can create a new service and if you go to tasks you can see that there is a feature in here to run new task so you can directly create a new task as well what is the difference between running a new task and running a thousand service let's explore that in this specific step let's start with running a new task let's say run new task and over here I'll choose a launch type of I will use at our last definition of hello will REST API I'll leave rest of the details as they are we'll choose the same cluster VPC that we chose earlier when we were creating the service I'll choose the one which has a double use forget cluster in it that's cool and I'll choose us east to 1a that's basically public sub hypu one I'll take the defaults for the rest of the things and I'll say run tasks so what we are doing now is we are actually trying to run a task directly without using a service you can see that the task is being now provisioned and we would want a desired status of running one interesting thing that you would observe is started by for this is empty if you look at this started by for the tasks which are stopped amended things which we stopped earlier you'd see that they are all started by a specific service so they are all started by some kind of a service because the service was what was launching that specific task however this one we are not using a service to launch it and that's why started by is empty we have manually started it if you give it a couple of minutes you would see that the status of the task would change to running enough if I go to the task I can see the public IP of that specific task and I can use that and say slash hello - world - and you can see the response which is coming back so the task is running if you don't see the response coming back just wait for a couple of minutes and you should be fine now this is the way you can launch up a specific task you might be wondering what is the difference between logic the task directly versus launching the task as a service the thing about launching the task directly is the fact that when you kill the task let's say I go here and I stop the task I've stopped the task once you kill the task the task is killed there is nobody monitoring the task and launching a new instance of the task again so the main difference between running tasks as part of a service versus running tasks directly is the fact that services ensure that a specific number of tasks are always running so if you say as part of this service I would need three tasks running the service would keep monitoring the health of the task and make sure that that specific task is running whereas the tasks are kind of one-time thing you start it and once it killed nobody is looking at it at the end of this story now you might be wondering what kind of situations you would want to use a task the best situations for you to use a task is when you would want to do something in batch you want to run a batch program in this step we looked at the primary difference between running a task as part of a service versus running tasks directly we discovered the fact that running tasks directly is better off for batch programs in the next step let's check out a batch program and try and run it as part of our tasks I'll see you in the next step until then bye welcome back in the steppe would want to run a simple bash program as a task what we have done is we have already created a container image for a simple batch program and made it available on our github repository so this is the simple task which we would want to run as a batch program don't really worry about what the logic behind that specific container now I would want to run this task on a cluster how can I do what is the first step that I would need to do think about it what is the first thing that I would need to do to be able to run a task yes create a task definition so let's create a task definition so create new task definition I'll use Fargate again do next step and over here I am going to enter the name of the task definition I've copied the entire image name so I'll just remove this stuff which we don't need so aw a simple spring task that the name of the task definition I'll use the same task execution rule as earlier and I'll use as minimum memory as possible so leave it at the basics I would need to now add a container let's quickly do that I'll paste the image name that we have copied it earlier and I'll place the container name and I don't really need to worry about rest of the stuff and say add all three leave the rest of the stuff at defaults and say create enough I would go back and say you - definition so now we have the task definition ready I would want to run this task how can I do that oh two clusters go to the cluster go to the task I am run new task I know here I'll choose target and I'll need to choose a task definition it has definition which we want to use is simple spring task that's be very careful with that so we need to use a tub lists simple spring task the version 1 of that task definition the rest of this stuff I'll leave it as default we would want one tasks I'll choose the right cluster VPC which we have been choosing until of and choose public subnet 1 to run this task in configure autos and public IPS enable and say the run task once you click run task you'd see that there is a task which is in a status of provisioning what I'll do is I'll click on the task ID on the left hand side so let's click on the task ID on the left hand side and you can see the details of the task and the status of the task in here you can see what all containers are part of the task and also you can see a few more details about the tasks in here let's wait until the status of the task changes I'll pause the video in here as you can see the status has now shift changed to running so it's now trying to run that specific task after a little while you would see that this status has changed to stop and it's trying to deed provision these tasks the reason why this task completes execution quickly is because there is nothing that the task really does it just logs something or message to the console and that's it now you might be wondering how can I access the logs which are behind this so what I can do is I can go and click this arrow behind beside the container and once you click there then you would see a link in here to view logs in the out watch your watch is a very very important AWS tool it helps you to monitor here abuse resources you can use cloud watch to check whether something is running or not and how much also has this feature of cloud watch logs so all the logs from applications we can directly stream to cloud watch when we started running the first run wizard there was a log group which was created similar to this for every task definition that we have created until of we have configured an automatic log group all the logs from this specific task are streamed to this specific log group let's see the logs in there how can we see do that we can click view logs in cloud watch this would open up a new window where you can actually see the logs from that specific application when you go there you can see that all the logs are present down here so all the logs from that specific application are present in here as you can see the application does nothing it prints a few environment variables which are configured it prints all the details about the environment configuration and at the end it just does a print of blue or one time to ask in here a little later we look at the code behind this task and how you can actually generate a container and push it to the docker registry the important thing to note is the fact that this is a simple bash application it does something and it quits and that's the best kind of scenarios where you would go for a task so let's close this window and get back to our cluster and let's do a quick summary of what we have discussed daunting enough so we use services to run long-running applications you have a web application which you need to keep running for a long time let's say you would want three instances of that web application running so what you do is you would create a task definition for that and you would create a service defining that I would want three instances of that specific task definition and the service would make sure that those three instances of that web application keep running all the time so even if one of the instances crashes this service would make sure that you would start a new instance you will run new task or directly create a task using a task definition if you do want to run some application so I would want to do a sequence of steps and exit I would want to run a program which runs for typically like a few seconds or a few minutes and exit that's the kind of places where you would actually run tasks the interesting thing is that there is a feature called scheduled tasks so you can even schedule tasks the same UI as a task but the only difference would be a scheduled rule so you can either say I would want to run this task every way for hours every two hours or every five days or something of that kind or you can configure a cron expression you can say I want to run this task at 8:45 a.m. every day you can do things like that as well I'm sure you're having a lot of fun with das definition stars cluster service and all these interesting easiest concepts I'll see you in the next step until then right welcome back in the previous section we deployed a couple of simple services simple containers using AWS Fargate we learnt the basics of what is a cluster what is a task definition what is the service and we learnt what is the difference between running a task as part of a service versus running a task directly one of the things that we observed is on a number of screens we see something called easy to over here I am inside the cluster and I see 0 0 ec2 pending tasks running tasks as well the same active services there are to forget services and 0 ec2 services and when I go to create I'm trying to create a service and you can see that there is a launch type of forget and easy to want in love we have been using forget now what is easy to what happens when you launch easiest with ec2 instances what is the difference between ec2 and forget that's what we would want to explore in this specific section and as usual we'll take a hands-on route to discover the differences now what is easy too if you are familiar with Amazon Web Services then you know that ec2 refers to virtual servers you want to run applications in the cloud where do the applications run they're on on servers however these servers are in the cloud so these are called virtual servers and in AWS terminology a virtual server is nothing but ec2 easy to Stanford Elastic Compute cloud typically whenever you would want to run an application in AWS the first thing you'd need to launch is a ec2 instance how can you see the ec2 instances that are present let's cancel this and go to services and type in ec2 ec2 virtual servers in the cloud when I click this you can see that there are 0 running ec2 instances when I click that you can see that there is no ec2 instances which are running right now if you go to easiest and change the cluster configuration actually I would want to change the service so let's say sample app service I would want to change the service so this is something which we are running using forget so this one I'd want to say I want to increase the number of tasks to one I will say skip to review and update service what would this do this would start launching a task of that particular service so you can see if I go to tasks not yet not so fast if you give a minute and then go to toss you can see that now a task is being provisioned if you wait for a minute or so you'd see the running status for that specific task that's cool now I will go to services ec2 again so we have a task running where is a task running oops there is no ec2 instance that is associated with it if we go to ec2 still we don't really have a ec2 instance running that's something you would need to remember wherever we are using Fargate we don't really have access to the ec2 instances or the virtual servers where the tasks are running on now you might be wondering how is easiest with easy to different let's look at that in the subsequent steps until then welcome back starting the step let's focus on deploying our containers to ecs running with ec2 instances make sure that we are in the region North Virginia so we are in US East North Eugenia and I'm going down the usual stuff the easiest right now I have one running task in the cluster which is unnecessarily running as an exercise make sure that all your services are configured to run zero tasks now you would want to focus on creating ecs with ec2 instances and for this one we will take a manual approach earlier we created the first cluster first task definition and the first service using the first one wizard now we would create the cluster manually let's start with it so let's say create cluster and over here you have three options right the first one is powered by a double use forget this was what the first one wizard made use of so if you do select this and do next step over here you do not have any configuration of ec2 instances so all that you need to configure is the cluster name and if you have to create a newbie PC and that's it however if I do previous and I choose the second one the second one is easy to Linux plus networking in this course we will be focusing on ec2 Linux and will not be using ec2 windows you see two windows creates virtual servers on windows ec2 linux creates virtual servers on Linux boxes so we are going to use easy to Linux plus networking and once you do next step you see that along with the cluster details it would ask you for ec2 instance details as well that's a major difference between creating a cluster for compared to creating a cluster for ec2 now this cluster I will call this as ECS helps ec2 cluster and when it comes to your virtual servers ec2 instances you can actually ask for it in two different ways this is what is called the provisioning model where it says on demand instance or spot as it says in here on-demand instances you pay for compute capacity by the hour there is a fixed rate that you would pay for on-demand instances so as soon as you ask for instance you would get it and there is a fixed rate for it however with the spot instances this is more like a eBay where you bid for it if you go to spot you would see that a number of other options open up so you can see that you can specify what amount of price you would want to bid and all that stuff let us not get into those complexities right now let's use on-demand instances so as soon as you ask for it you get an instance and you pay a fixed price for it now the next thing it asks for is easy to instance type there are a wide variety of virtual server instances that AWS provides and if you do a Google for ec2 instance type then you would land up on this page so you can see that there are wide variety of images a1 t3 t3 82 t5 M Phi am 4 I mean there are if you go to these tabs you would see other instances as well each of these instance types are designed for specific kind of applications and each of these have different amount of virtual CPUs different amount of memory different types of storage and different kinds of network performance if you go to t2 there is something called t2 micro this one comes with one virtual CPU and one gig of memory if you are within the free tire then t2 micro is a great thing to use because we would get 750 hours of t2 micro free per month so let's use t2 micro wraps it was a little different making the choice but finally I was able to find t2 micro and t2 micro is now selected let's ask for three instances of t2 micro I'll leave rest of the details as they are let's go ahead and say create so what this would do is this would create a cluster with three ec2 instances so you can see that we are directly creating a cluster with ec2 instances and later when we define the tasks you would see that these tasks would be placed on these ec2 instances one of the interesting things is the fact that because we are creating virtual servers we are creating ec2 instances this would take a little bit of we are creating 3d to micro ec2 instances it would take a little bit of time and I'll see you in the next step until then bye bye
Info
Channel: in28minutes Cloud, DevOps and Microservices
Views: 21,530
Rating: 4.7706094 out of 5
Keywords: aws ecs tutorial for beginners, amazon ecs, in28minutes tutorial, aws ecs tutorial, amazon web services, in28minutes tutorials” in28minutes courses, in28minutes, in28minutes spring boot, aws fargate, aws fargate tutorial, aws ecs fargate tutorial
Id: 2oXVYxIPs88
Channel Id: undefined
Length: 90min 16sec (5416 seconds)
Published: Thu Sep 12 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.