AWS Lambda Tutorial | AWS Tutorial for Beginners | AWS Cloud | AWS Lambda | AWS Training | Edureka

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this is a month from Adia rekha today's session is going to be all about AWS lambda so without making any further ado let's move on to today's agenda to understand what all will be covered today so we'll start up today's session by discussing the main services in the AWS compute domain after that we're going to see why AWS lambda is as a separate service we're going to discuss what AWS lambda actually is and then we'll move on to the part where we'll see how you can use a double s lambda using the AWS as the case once we're done with that I'll teach you guys how you can integrate your SDK with the Eclipse IDE and in the end we'll be doing a demo so let me quickly show you guys how we will be using AWS lambda in today's demonstration so again this is a website that I created which is hosted on the localhost now what does Deb site does is it uploads a file on the dh3 file system now once the file is uploaded it sends me a mail regarding that now that mean is generated by aw saga now let me quickly show you how that mail actually looks like so let me upload a file over here so let file be this I click on open and the for uploading image I will show you my Inbox so as us now I don't have any emails as you can see right so what I'll do is I click on upload image now it says s3 upload complete now what this website does is it will upload my file it will rename the file according to the system time so that there is no conflict in the name of the object right so whatever file that I've uploaded right now will be uploaded on in this bucket so if i refresh this you can see that this file over here right so this file has now been renamed right and I also have an email over here it says EWS ACS test right so if I click on this email I can see that I have called a mail from this address saying that an object has been uploaded the name of the object is this the size of the object is this the bucket name is this and it will flash modified on 12/31 UPC right so let me quickly compare whether this file name is the same so it's 7 for 8 and it's a send for it here as well awesome now the next cool thing that you can do over here is you can move this file to some other folder so all you have to do is you will reply to this mail by saying move you click on send now when I send move to this email address that I've configured in my code what it does is it will basically move this file from this bucket to some other bucket so let me quickly refresh it and see whether my file has been moved so as you can see my bucket is now empty now let me go back so basically my file was there in Lu Rekha demo now it will be there in quarantine demo bucket so as you can see 748 file has now we'll move to the quarantine demo by simply writing a mail over here it says move so we'll be creating this demo today right so guys this is our agenda for today are we clear with it alright so Dustin says yes others Kevin is clear as well Michelle the big are you see alright guys so since most of you are clear let's move on to the first topic of today's discussion that is the AWS compute domain so the main services are under this domain are easy to elastic Beanstalk and AWS lambda now among these three the most important service is easy to so easy to is basically just like a raw server it is like a personal computer that you're working on remotely right so it can install any kind of operating system of your choice which is supported by the AWS infrastructure and then you can use it in any manner as you want you can configure it to become a web server you can configure it to become a workout your environment anything a next service is elastic Beanstalk which is an automated version of ec2 so with the elastic Beanstalk you don't get the excess to the operating system but you still have a control over the configuration of your system so you can choose what kind of instance you wanna launch right so elastic Beanstalk is used to deploy an application so basically you just upload your code and then application is deployed on the AWS infrastructure right so this is what a lasting Beanstalk is all about then we have the AWS lambda service so the lambda service is again an automated version of ec2 wherein you don't get the access to the operating system with the universe lambda you don't even have the choice to choose what kind of configuration you want with your server type so bowdabra lambda you just have to upload your code and it executes it's that simple but then why do we have any ws lamda service when we have elastic beam strong so let us understand that so II W is lambda like I told you guys it is an automated version of PC to just like elastic beanstalk but then with AWS lambda you can only execute background tasks that you cannot deploy an application so a SS lambda is not used to deploy an application it is used to execute background tasks other than that like I told you guys you don't have to choose the configuration in a lab lace lambda you don't have to choose what kind of service you want depending on your workload the kind of configuration the server configuration is assigned to you right so this is why we use AWS lambda but then let's go on to the definition part and see what AWS lambda actually is so according to its definition it's a surveillance compute service because you're not choosing the servers right you're not choosing what kind of configuration you want in your server it's a serverless compute service you just a product code and a code is executed it's that simple right and also like it's mentioned in the definition and I told you guys again again it is used to execute background tasks it does not use deploy in African guys this is the main difference between elastic beanstalk and AWS chakra so as an architect you should know what the use case is and this service will suit it better so moving on now if you have understood what AWS lamda actually is and why do we use it right so let's move ahead to see how you can use this service so you can use this service using the software development kits which are provided by AWS so before moving ahead and understanding how you can use the skills let us understand what these kits are all about so the software development kits are basically api's which are used by developers to connect to the desired service at the wall so it makes the life of the developer easy because he can now concentrate on the logical part of his application rather than wasting time on understanding how he can connect his code to the the service which is there on AWS right the other part is that these SDKs I'll use with IDs right so currently we have only two IDs which are supported that is Eclipse and visual studio so today in this session I'm going to teach you guys how you can connect your SDKs with the Eclipse IDE so let's do that so before that we are going to configure are we going to code our a SS and of function and Java right and that is the reason we are using Eclipse now first of all you have to install eclipse on a system once you do that this is the Eclipse screen guys this is how your Eclipse dashboard will look like so for installing AWS SDK on your Eclipse you have to click on help and then you will go to install new software once you have Reese here you'll enter the website name that is aws.amazon.com slash Eclipse once you have entered that just hit enter and it'll list you guys all the SDKs which are available all the tools which are available select all the tools and click on finish and then it will take some time to download the SDK but then it will integrate everything into your Eclipse and then you'll have a button like this over here right so with this button you can actually deploy a new server which is configured according to AWS so guys this is how you install SDKs with IDE alright guys so it's time for the demo now enough of theory so what we'll be doing is our aim is to create an application which will be uploading our files onto the s3 filesystem and what a lambda function here it will be doing is so like I told you guys lambda function basically execute your background task right so that we don't want to burden server on which the website is hosted with this task we want some other server to execute this task what is this task we basically want to get an email with all the details of the file which has just been uploaded on the s3 file system so that email will be sent by the lambda server now once you get that email if you reply to that email that file has to be moved lambda will pick up that email it will read that email and you perform the necessary operation so if we specify move what will basically do is it will pick that file move it to some other bucket and store it over there so this is the project that we'll be doing right now sounds simple right but let me show you the architecture let me explain you what the architecture tells you so basically this is our website so whatever site we'll be doing is it will be uploading a file onto the SD filesystem at the same time it will also be making an entry into the sqs which is nothing but a simple queue so switch queues your data right so as soon as your file is uploaded onto s 3 s 3 s bucket is configured in a way to invoke the lambda function now as soon as the lambda function is invoked now lambda functions are stateless they don't know anything about what file you have uploaded or what we have done you have to feed them information and that is the reason we have updated the entry in su s or the file which has recently been uploaded right so what AWS lambda will do is it will read this queue and we'll get the file name and we'll actually retrieve all the properties from that file name from s3 now once it has retrieved all the file names all the properties of that file it will actually mail me using the SES service in AWS the details of that file now once I did receive the details of that file I have an option to reply to that email right now how will I reply to this email is like this so I will open the email client on my computer and I will reply to that email that email will actually go to that address which is actually pointed to my DNS server and that DNS server will actually redirect that email to ACS now ses on receiving that email has been configured to invoke the lambda function that lambda function will be invoked again the file will read from the sqs that file will be moved to a new bucket and in the end that message will be deleted by SQL now my su s has been configured like this that in case I don't reply to that email within two or three minutes that message will automatically be deleted from the queue and in that case if you try to move that file you will not be allowed to do so because that file is no longer available in the cube hence you cannot move it right so this is what our project is going to be all about now I have already showed you how the project works so let me quickly delete the project and again show you how it can be configured from scratch right so give me a moment all right so everything is set now the first thing that I'll be doing is I'll be configuring my a3 to interact with my lambda function right so what I'm not done is I'm not deleted the lambda function because there is no point you just have to click Next and your function will be created what matters is the code so I have uploaded the code in your LMS with the proper documentation if you have any doubts you can actually email me regarding that doubt and I'll clear it for you so as an architect your job will be to architect this architecture not coding the coding part it has to be done by the AWS developer but it is a good to know knowledge right so that is the reason I have uploaded the code for the web site on AWS and out to your LMS so if you have any doubts you can always ping me and I will be happy to answer your queries ok so like I said I have to configure my s3 so that it can interact with AWS number now my website's code is like this that it will upload the file to a bucket and s3 called eddy rake our demo right so what we'll be doing is we'll be going to the le rake our demo bucket which is here I click on the ID Academy bucket I'll click on properties' I'll click on events and let me delete this event right now right so I will be adding a notification now now let me call this notification as AWS - lambda' right now what I want it to do is whenever the event is a put event that is an app load event I want it to send a notification to my lambda function so I have to select the lambda function so my function should be this one and I'll click on save let me check if everything has been filled it has so let's click on save alright so I have one active notifications now now you might get an error over here saying that you don't have sufficient permissions so if you get that error on the right hand side we will have a button called add permission just click on that button and everything will open happen automatically basically those permissions are for your lambda function your lambda function may not have permissions to get notification from se but once you click on that button you will get the proper notifications automatically right so this is how you will configure your s3 bucket now let's go back to a slide to see what other things we have to do so we have configured our s3 to invoke a lambda function once a file is uploaded to a3 now our lambda has already been configured to interact with ACS through the code which is - so through the code we'll be calling the ACS service and we'll be living in a meal now the next function or the next thing is to configure SES or before that let's configure our sqs right so our sqs is basically a simple queue service so we have to create a queue in sqs in which our website will be uploading of files right so let's do that let us go back to our dashboard so this is our dashboard guys and we will go to the sqs service we'll click on create new Q C for Q and that Q has to be named as hello - lambda it's a FIFO queue you have to give the extension as dot FIFO all is done let's click on quick create queue okay so my cue has now been created and now I have to configure this cue so that whenever the message comes in it gets automatically deleted after two minutes right so let us configure it so we'll click on configure cue and we set this to two minutes all right all it's done let's click on Save Changes all right so my cue has also been configured let me go back to my slide all right so my SQS has been configured now so let me configure my SES now now this might be a little tricky so hang on with me we'll go back to the dashboard we'll go to the ACS service now first of all in the ACS so is you actually have to add the email addresses now how will you are the email addresses you will actually have to verify a new an email address now you have to verify the GCP end as well so since I want to receive the email from the SES service I will have to type in my email address which is Haman at the rate of the rate derecho and we will have to verify this email address now I'll receive a verification email on him and after a daily recorder cause let me quickly go back click on inbox now I've got a very recreation request right so I'll click on this verification link okay so my email address has now been configured has now been verified so this is congratulations awesome so let me go back to my SES say spending verification let me quickly refresh it all right so it says verified now now let's go back to a slide alright so guys we have configured the recipient of SES but what about the sender right so we have to configure the sender as well because and why do we have to configure the sender and the sender has to be a domain name that you own right because you have to own that domain name so that you can send emails via that domain name now what I mean by that is you may say that okay why not use the recipient address on the why not use him another 8080 record or go for sending the email but our application also receives emails if you would have noticed right so for receiving the emails through SES you have to actually own the domain name now since I'm an employee I don't own any record code right so what I've done is I have actually created a domain name I can get a free domain name from this website which is my dot dot dot TK you can go on this website and create a domain for yourself for free so basically you will be getting this domain name free for three months all right I am almost from the expanded so I might have to renew it okay but since this is a lemon let me quickly show you alright so I have actually created this domain name and I can use this domain name to send or receive emails now what I'll have to do how we will configure this in my CSS like this so you will go to your SES you see this tab which says email even right so I'll click on rule sets and you'll have to create a new rule set before that you have to actually verify a domain you basically have to verify that the domain is actually owned by you now how you will do that you'll click on verify a new domain and you will give your domain name here which is any record or TK click on verify this domain and you will get these two records over here now where will you enter these two records is actually in the DNS server so the domain name Eddie record or TK has to point to a DNS server right and in that DNS server you will be putting in these two records now how will you point any record or TK to a DNS server so DNS server is basically route 53 right so we'll be configuring loud 53 with a delay karate yell that means for you quickly how you can do that let me open my router PC service so this is my router 50 service I don't have any hosted drone that is mom so let's click on get started now click on create hosted zone so my domain name is any record or decayed right click on create all right so I have created a hosted zone now in my route 53 now what I'll have to do is I'll have to connect this domain to my route 53 now how would you do that you will click on manage domain and you will click on management tools and you click on name servers right so these name servers have to be updated with the name servers provided you over here right so let me quickly show you so you will copy this paste it here remember guys don't include the dot in the end otherwise it will give you an error so without the dot copy the name server right so I'll first save too and see if it's working click on change name server all right phase changes saved successfully all right so it's saving the server's now so let me copy the last two as well all right so I've copied my name Phyllis I click on change name servers and fingers crossed ok so it says changes saved successfully all right so my domain name is now pointing to route 53 awesome so now in route 53 I have to include these records now how will I do that let me quickly show you so you go to the out 53 and you will click on create record set now you don't have to type anything here just in the type click on MX and in the value so as you can see there's a value for M X over here just copy this value and paste it here alright this is it guys nothing has to be done here click on create awesome so I have a MX record now now lets you have to create one more record set and that name has to be like this right so I'll copy this part paste it here as you can see now the name is underscore Amazon ACS dot Eddie record or TK and as you can see the name over here is to sing right so this name has to be the same and the type of value is txt we'll select ext from here and then you have to enter the value so the value is this enter this value over here and click on create awesome so my route 53 is now configured to act least two actors receive the emails from the ad Erica Tek doum good so we'll go back to an SES now close it it says pending verification refresh it alright so as you can see my domain name is now verified alright so let us go to the rule sets now so email receiving we have to configure so I click on View active rule set there is no rule set so I create a rule now I have to specify a recipient so let me specify hello at the rate Eddy record or TK right I'll click on add recipient so my verification status is verified because my domain name is verified now we'll click on next step now what action do you want it to do right so if you receive email on this email ID what do you want to do so what we want to do is we want to invoke a lambda function now what lambda function do you want to invoke I want to invoke my function - and we'll click on next step so everything seems fine we'll click on next step again so it is ask me the rule name let me give the rule name as lambda - demo click on next step and click on create rule okay so my rule set has now been enabled awesome so I have configured my SES as well so let me go back to my slide all right so I've configured my ICS I have configured Matt out 53 I've configured my AWS lambda I have configured my sqs I have configured my s3 and my website is also configured right so weekly utilize qsq so we may have to change the URL in our code let's quickly do that I will go back here go to the dashboard click on SQS all right so this is our queue and this is our URL so basically I have named the queue same so if you do that sometimes the URL don't change so let me see if I have to upload the code or not so I go to my lambda function handler go to the part where my queue is saved all right let me anyways basic you were here I think it is the same yes it is the same and it is let us save it this is my function 1 so let me upload the call now so it's my function and click on finish right so it is uploading the function right now so meanwhile let me go to my function - and configure in the queue address which is this paste it here controllers save it and once this process is complete I will upload this code as well so while this is uploading let me change the address in my index file as well this is my website index file so I'll go to the queue URL which is this I will change it save it and close it all right so my website address has also been done all right so my code is uploaded for this function let me upload the code for function two as well because they may change upload function to AWS so it is my function - that is my function - in lambda click on next and click on finish alright so my code is being uploaded let's wait a while so that my code gets uploaded and then we can proceed with our demonstration all right so my code has now been uploaded to both my lambda functions now what I do is I will go to my local host website click on refresh I will upload a file so let me go back and see what is there in my bucket right now so that it becomes easier for us to verify there our file has an uploader so as of now my bucket is empty I there's nothing in my head or a car demo bucket and my other bucket is quarantine demo this is a place where my other file will go it let me empty this as well so that we are clear that some object has been added all right so this bucket has also been clear so we'll go to our localhost we'll choose a file so let's upload some image so let it be this match right I click on open and click on Apple image all right so it says s3 upload complete all right so let me check if a file has been added in my lyric a demo bucket I seek only fresh awesome so one file has been added and it's called one four nine two five four six zero nine seven let me check in my email so let me check if I got an email so yes I've got an email let me click on it alright so this is the name of the file that I got which is the same right so let me see if there is something in my quarantine demo bucket so there's nothing there I'll come back now I'll reply to this email as move so this basically means move my files or some other bucket and I'm replying it to hello at the rate add your a card or TK right so now we've hit on send so my message has been sent to route 53 which will be sent to ACS which will invoke the lambda function this will move my file to the other bucket so let us check if that is done so first let us check if I ready rekha demo bucket has been emptied so we'll click on refresh alright so my idea rekha bucket has now been emptied let's go back and check us anything has been add in my quarantine demo bucket alright guys so my file has successfully moved to this bucket let us verify the name so this is one four nine two five four six zero nine seven let us check that in the email so the email that we applied to have the object name as one four nine two five four six zero nine seven so this is the same file guys alright so we have completed our demonstration successfully any doubts guys in any other part that you executed today any doubt and I will create it again so please go ahead of the question all right so Mariana is saying thank you you're welcome Mariana Dare is saying great demonstration awesome David you found it useful okay yes the code is there any LMS you can go to it oncee and the webinar alright guys since all of you are giving me a go let me conclude today's session so thank you guys for attending today's session I hope you learned something new today we did a very elaborate demo so I would suggest you to go back listen to this recording which you'll have any LMS and do that project once on your own alright if you have any doubts you can always contact our support team which is always at your disposal and in case they can't all get out I am always there to help you so you can email me and whenever I have time I will email you back with the solution all right so guys thank you for attending today's session have a good day ahead thank you I hope you enjoyed listening to this video please be kind enough to like it and you can comment any of your doubts and queries and we will reply to them at the earliest do look out for more videos in our playlist and subscribe to our at Eureka challenge learn more happy learning
Info
Channel: edureka!
Views: 215,849
Rating: 4.5813332 out of 5
Keywords: yt:cc=on, aws lambda, aws lambda tutorial, aws lambda tutorial for beginners, aws tutorial for beginners, aws lambda java tutorial, aws lambda java example, aws lambda tutorial java, aws lambda tutorial video, aws certification, aws lambda java project, aws lambda function java, aws lambda java 8, aws lambda with java, aws certified solutions architect training, aws training, aws edureka, edureka, lambda aws, lambda function aws, aws lambda java, lambda in aws, amazon lambda
Id: XZggsCITQdY
Channel Id: undefined
Length: 32min 52sec (1972 seconds)
Published: Mon Apr 24 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.