AWS Serverless with .NET Core - Norm Johanson

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everybody my name is norm johansson I work for Amazon Web Services back in Seattle and today we're going to talk about anybody serverless with dotnet core so the talk is not going to be too much about what is service we're just going to focus mostly on the 80 bits implementation because I know there's already a lot of sessions at the conference already on server lists so we're going to go over is what are the common editing services that you will use when you're going to do a service application then show off what are the business to do tooling to get started with dotnet core and lambda and then look at the command-line tooling for users who are not doing Visual Studio or want to hook up this to their CI system and once we get an understanding of the tooling and how that works we're going to take a look at what a real lab scenario might look like so Edith has like over a hundred services right now which is pretty remarkable because I've been in a dress for seven years and when I started there was fifteen I believe there were so had that much growth in that amount of time and so we're not going to cover all those services so I'm just going to focus right now on just what are the ones that you're going to most likely work with when you start working with service apps on AWS so the first service in if you heard anything about server list computing out there you've probably heard of Oedipus lambda that is the compute part of the service architecture this is the service that's actually going to run your code it has a design of its event triggered and its event based scaling this means unlike traditional applications where you have a collection of virtual machines that are running your application and you get monitoring to see we need to add remove stuff in this world there is no compute power initially added to your service application it's when those events come in is when the land was going to decide hey you need compute power and go allocate that up and this means your scaling is more of like it's scaled by events so if you suddenly get a thousand events coming with all once then land is going to go make sure you have that compute power available to you and then when those functions are done does that compute power would go away so you would only be paying for when your functions actually run and not that idle time so Lamba supports nodejs Python Java and last November we added dotnet core support Amazon API gateway this is the front end of the ATIS service architecture so this is what's going to expose your lambda functions out to web that's like Web API and it has other features as well like managing authentication versioning monitoring and more now a to visit identity access management this isn't strictly a service service but it's one you're going to use regardless because this is the service that manages your credentials and your permissions so in lambdas world is you're going to be using API side in the nexus management or IM to basically give permissions to your code to access other other eight of your services and you do that by defining a role and you allow lamda to assume that role which will allow it to create credentials and on that role you can have a number of policies applied to it which is what gives that lamda permission to access s3 or whatever service you want to use and so with a bit confirmation you're going to be using this you will most likely use the service as your service application but gets more sophisticated because you're going to find that you're going to have other ATS resources you're connecting to you got to keep track of all those events that you're going to set up so with cloud formation you can define your whole ADA's architecture as a template file which is usually a JSON file that can be parameterised and that allows you to just say hey Confirmation go create me this 80 bit of stack and it will go and create all those resources and set up all those events for you as a unit and this could be like your test back your dev stack or whatever and then when you're done with it you can just say delete this back and it clears out all those resources so it's a good way of keeping track of all those connection points for your service application so those are the four main services we're going to talk about today and so to recap we have lambda 4 compute API gateway is our front-end a to the site of the access management's going to be managing our permissions and CloudFormation so we can automate our ad bus architecture now the easiest way to get started writing nightcore lambda functions is with visual studio and our editors toolkit for visual studio we support 2017 which you can solve in the visual studio gallery as well as visual studio 2015 for 15 you need to download that from our website it comes down as an MSI and 15 doesn't have done that core support in it by default so you'll need to be installed a duck or tooling into them now I'm going to live dangerously and do some live demos mostly to make up for my lack and PowerPoint skills so we'll just go right into that so if you've never used our ad basics of Visual Studio first thing we might notice is we have this window over here we call database Explorer which allows you to manage a lot of the common services developers use right inside the studio the ones that are managing data or messaging or in lambda in this case and you can also up at the top you can register profiles this is basically you can have a number of atreus accounts that you might want to have inside the studio you add new ones pushing the new button and you add in your ADA screwed in chills a nativist credentials are an access key ID and a secret access key and what those are used for is underneath the toolkit as well as in your own applications when you're using the eight weeks SDK Fernet it's going to use those credentials to sign the request to AWS which is how we do s education if you ever can't find this view you can just go and reviews and there's a twist Explorer right there now it gets ours landed we need to create a project we go to file new project and under the visual c-sharp node we have a twist lambda and we basically have two different project templates out there with the option of creating a test the lambda project is basically when you want to write a single function and you're going to work with the lambda services directly you're going to set up the connection endpoints all that for you and the service application is when you're going to work with CloudFormation to deploy maybe a number of lambda functions together as well as your other ATIS resources so we can get a better idea of how lime to work so we're going to do the lambda project right now we're going to call that image tagger and we'll say okay so once you do that you're going to get a choice of blueprints it's basically things to help you get started if you want to just go completely from scratch you can choose the empty function which has the minimal amount of boilerplate on there the simple ones down here have the extra boilerplate on there for dealing with events coming from those services and we have a couple that are more like tutorial ones we're going to take a look at this detect image label which is what it does is it's a blueprint that's going to be listing for pictures being uploaded to an s3 bucket s3 is our object storage and it's going to go use our image recognition service to find out what's in that picture what labels are in there and then tag our object with those labels so let's say finish and we created our test project and we've got our lambda project here now what a lambda project is is it is really just a it is a just a class library targeting netkar up one oh we do only support net collab net core 100 that is currently designated as the LCS version of.net core and lambda always has a policy with all of the runtimes to support the long-term supported version of that runtime so if we look at our code here regular C sharp code here we got a couple constructors let's look at those so the first one is just the empty constructor which is creating a couple service clients from the adrià 50k for net and you notice when we create these clients we're not passing any credentials information or what region we want to connect to and we can do that because when we deploy this lambda function we're going to assign an IM rolled through that lambda function in the sdk in its logic was looking for credentials we'll look to see am i running in an environment that has an IM role and if so grab the credentials for that role and make the request of that similar with the read it will detect that I am running in EU s1 and we'll use that there I could override all that but at the constructor if I won and but it's really best just to use the configuration coming from the environment the rest of the stuff is the way this blueprint is set up is when we detect labels we can say we only want to accept labels with a minimum confidence of that label I think the default in here is 70% but when you deploy a lambda function you can set environment variables so in the environment where we could override with that confidence level is the other constructor here is passing in the clients because this is what's used by the test project since the test projects not running in a land environment it's up to that test project to construct those clients and so here is our actual function here this is what lambda is going to give a call takes in an s3 event the lambda context is going to give you information about the running environment and this is an async method and so just like I'll see sharp code if you're doing an async method you want to be sure to always return by cat asks don't do async void what land was doing is it's going to call this message and say hey you returned by cat ask I'll wait to that test complete to know when you're done so if we just did void it would think that you were done right away so we live through our records we're going to use this is the image image recognition service we're going to go detect some labels then we're going to go construct a collection of tags s3 tags and then use the s3 client to put those tags on there so overall it's a fairly simple code but it's an easy way just to tie these two services together now the other file we have in here is called the APIs lambda tools default flow so this is a file the blueprint or the blueprint put in there to help set up a lot of those initial values when you deploy the function we're going to look at a couple of them a function handlers probably most important one because this strings will identify for lambda what is that c-sharp function I want to call in my class library so it's identifying the assembly the type name and the actual function in that class to call the other thing that I think is worth pointing out is memory size I wanted to call that out because it's it's more than just memory size the way I'll always look at this property is more of it's a slider on the amount of compute power you want to give to your lambda function because what lambda does is as you increase the memory that also scales how much CPU and network power is added to your lambda function so with those I'll set let's take a look at how we deploy it to do that we right-click on a project and we say published AWS bring up our wizard and you can see that are those values already set because it came from that file so we just need to put in a function name we'll call it image tagger and on the second screen the most important thing we got to do is this is where we're going to set the I am role this is what's going to give permissions for our function because our function has to access our s3 bucket and it's got to be able to access image recognition service so we could define a role with those policies now for me right now I've already set up an existing role that we're going to use I could create one with some of the pre Ken policies that we have out there or if you have some policies that you've already set up on your count I would be able to create those we're just going to select that one and here's where I could set an environment variable so if I wanted to override that minimum confidence level I could pass in a value there we're not just going to be upload and so this is basically doing a dotnet published that the CLI zipping that up and telling lambda go to go create a lambda function and so we bring up this view of the lambda function which is coming from natives Explorer you can see image tagger there and we can do a few things in here we can modify the configuration of it we can also just do a test invoke right from here there's some sample requests of what you might send to s3 for example here's the requests what is here's an example request would look like coming from s3 where it identified the bucket that you want to say there was a new object created and object those those don't exist so I'm gonna go ahead personal anyways this is not going to work though because those objects don't exist but you can see how right from here you could modify that file to something really does exist to test how things work in production and you can see here's the error of not being able to exit set objects what that also allows me to do is in the log view we can get a list of the logs so we can see what really happened in here so here are some of those print statements if I showed that but all of the console rights in here is will be forwarded to the cloud watch logs that are associated with that so that's I get your log messages there and you can see there's the stack trace so now we have our lambda function deployed it's got permission to access the service but now what we need to do is we need to actually hook this up to our s3 bucket so we can do that in the event sources tab this has some of the services that you can connect with s2 with lambda a lot of the other services you need to go to their web console or use their SDKs to do that connection up so here we'll say add s3 is already picked you do need to pick a bucket that's in the same region as you so I happen to have one code EU s1 pre-fit prefix and suffix you can use to sort of filter which objects you want to get events for we'll say okay and so now they are connected so when we add objects to that s3 bucket this will cause our lambda function to be invoked we can test that by if we go over to s3 and the toolkit here's that bucket here I'll open up its view I don't have any objects in there currently so let's copy some images of my family in there upload those so now as these are being uploaded this is going to then trigger those events to a from F from s3 to lambda to go do that logic we had so they're connected without actually running any service to do that so that's uploaded we should see by now and if we refresh the logs I'm betting there is it doing some of its work of getting those tags and get a better view of that if we go back over here and let's see how well this service did so here it is my daughter playing on the beach see how what did they think of that so on that we can properties and go to tag and we can see that she is a human there's water she's on the beach she's having a good time there try this one anybody would take a guess where this is a picture of anyone yes I did convince the family go to New Zealand this year and I don't think my wife appreciated doing all the Lord of the Rings things but it was fun so what did we do on the Shire there I said there was a chair we got a pumpkin up there in the garden furniture squash and vegetables it didn't pick the hobbit holes but that is kind of a custom case so right so there you go this is how you can easily write these landed functions and hook up these services to do more interesting things without even having to run servers with it so to recap get the toolkit to try things out 2017 get it from the gallery 15 you'd be get it from our website you can use the toolkit to manager ativ credentials you can also use the tilt it to get blueprints to get started you do need to have the class library Targa net core f1o and then the toolkit we can deploy functions and we have that default file to help us with a lot of the initial values for deployment so let's take a look at the command line because you know the dotnet core we can do things more than just I do visual studio so let's bring up a console here so the first thing we want to be able to do is we want to create a project and in visual studio right we had all those blueprints to get started well it turns out when they g8 the.net core tooling last winter they added support and that dotnet new command to add new templates to that and we've added things to this so if we say dotnet new - I for install I can say Amazon Landa templates : : star color poem star going to use the latest version that's going to install that new get package that we have and put all those blueprints that we had in Visual Studio right there on the dotnet new command which I already have done so I'm going to run it again so if we say dotnet new you can see there's all those lines of functions right here so we can do these anywhere we are I'm going to keep this demo simple so I'm just going to use that empty function blueprint we can get help on that if we say dotnet new when the empty function help and this is telling you that you can pass optionally in the profile that create profile if you come to the studio or the region or both and what that's going to do is it's going to inject in that default file is going to create it's going to set those up for you so when you do the later deployment from the command line you don't have to keep entering those in over and over again so let's scrape this dotnet new Landa empty function I have to spell it correctly profile use my norm J profile region is EU West one and I'll name this demo funk that's right yeah project is created so let's go into that directory we can go use video code and see what we got here so here we get we got our test project so we can see how we can write some integration or unit tests and we have our code the empty function is very basic l it is it's just trying to give you some code to get started with it's just doing a two upper on the string passed in so you could take that and go do whatever you want with it so what we need to do now is well how do we deploy this function and what we did is if you look in the CS proj file we installed a dotnet CLI tool reference to the Amazon lambda tools so this is going to add commands into the donut CLI so we can manage the deployment right from there in fact it's the same code that we do in there that we do in Visual Studio and so that menu item in Visual Studio to say whether to publisher nut how we choose to show that is do we look to see it's just a dotnet core project and does it have this dependency if it has this dependency up then we assume this must be something you want to deploy at lambda and so we'll add that menu item there okay so let's deploy it so let's go to our function and we need to restore references so it's going to pull in our tooling in there and now if we say dotnet lambda help you can see these are the commands that have now been added to the CLI this first section here is dealing with just the lambda projects like we saw we just did in Visual Studio the second set is for the server this left when you're doing deployment with CloudFormation and the bottom two are sort of utility ones for when you want to maybe hook this up to your CI system and you want to just use this to get everything packaged up right for lambda alright so then to deploy that we would do dotnet deploy function alright let's look to see what that takes if we say help do that takes a fair amount of parameters and that's where that default file comes in really handy because most of this is already set for us the only thing we really have to set at this point is what is the function name and what is the I am role that we want to use so we'll say dotnet land deploy function and I'll call it demo funk and I don't remember my role so if you don't enter the role on the command line it's going to prompt you for that as you're doing the deployment you can see here what roles I want to use and I'm going to say I'm going to do that same role I did in the previous demo and there it is it's created so we could stop see if we did that now land list functions you can see there's our two functions the one we did in the previous demo and then we just did we can also do some testing of the function right here so we know this function just does a two uppers all it does so if we say dotnet lambda invoke function demo func and we pass in a payload we'll say hello in DC say return so this will run that function just like that sort of test view in the toolkit we can run it here on the command line you can see we've got a cloud two upper function though now you might be wondering why did it take 800 milliseconds just to do a two upper on that the reason was this was the first time this function was invoked so that's when lambda had to then go and allocate the compute power needed for this function download the function from s3 and start up the dotnet runtime if I have to run it again with all that stuff already warmed up you can see from lemons point of view it was much faster there okay so that is the CLI so again to use a CLI you want to do a dotnet new to install the templates right there I give you all the blueprints of inverter studio and you've done it new to create your projects and then you do done at lambda deploy function to start pulling it right from the command line okay so my real life scenario which immediately the demo didn't get is fully completed as I had my ambitions for was an app called pollster what this app is is it's a website for customers to put up polls and everyone can vote on those polls so my requirements are is I need a website that everyone can access hit vote on those polls every poll has a start and end time so I'm going to need sort of a state machine for these polls and again I'm being serve lists I want to do no servers with this application so to do this we're going to introduce a couple more services some of these you might have heard Amazon DynamoDB this is our manage no sequel database service and for us what we need to do is we need to create two tables out of that one is a table to store our definitions for the polls and the other one is to storing the list of the current active polls and a nice feature identity has is you can enable streams on that which sends out events of your items being changed in your tables or new items being added and as you can guess with those events you can hook up lambdas and then process those events and so we can use those to start our workflow on that the other new service we're going to talk is a diva's step functions and this allows us to define a state machine that basically in our case the state machine is fairly simplistic it's just a scheduling of I want to I want to stake when I want to schedule it how long do I wait till I activate it and then I got to deactivate it after a certain amount of time and each one of those states where there's work to do a logical tasks we can say we hit the state in the in the state machine go call a lambda function to do that work so again we can keep with sub being servlet for doing all that work now one of the interesting things that we've been doing lately with our dotnet core tooling is we be doing work to be able to run a spinet core apps run on top of lambda I'm not saying this is the right solution for every duck neck or Lander project but if you happen to really like writing your web apps using a spirit core or you're not ready to learn in your programming model you can do this this way because it allows you to use the same program model we already know we can just run it locally in is and test it all there and then when we're happy we can just go deploy that to lambda there are cons are because we are bringing a larger framework there's a little bit more to be initialized during the startup so you want to be very careful about what it is in that startup yes that you're really in doing because that is going to be invoked during the initial code start a gap of this function now it's not done for every single one of executions basically what happens is when lambda starts up that first code the first time it's executing that function in that compute environment if we initialize the Holy Spirit core framework so that the next request will be fast also razor views are not supported doing this so we need an alternative framework for our client code so what I'm doing is I'm doing everything in angular for that that let's go into another demo here so here is poster again this looks like a regular exponent core application we have controllers here like we've seen many other places there's controllers for getting poles and the feeds and voting on those we have our program CS down here which starting up kestrel likely that so that way we can easily just do f5 and we can run this application locally we can do our local development test it there and see what it looks like see how we doing so here it is where should I take the kids for vacation so for I have like Norway optical might make a go to Norway I think the kids want to go to Disneyland see how that works out for them ok to get this to work and lambda what I've done is I added that nougat package I talked about earlier and I have a new class in here called lambda entry the name is arbitrary you can call whatever you want but it extends from this class api gateway proxy function which this has one method you need to override which is via knit method which looks a lot what we saw in the program cs where you need to set up the content routes today what is the startup class but instead of saying use kestrel and is we have to say use api gateway because that's going to be our web server in this case now the actual lambda function comes from the base class it is this function handler async that's actually going to be called that's the only code changes we actually did to this application to make it run on lambda everything else is the same as your own agent record and the other things we have in here is under workflow this is my state machine test so these are my series of lambda functions that I'm going to use for those the states in my state machine these are all fairly simple ones they're going to take in a pull state object and it's going to grab that pole ID find out how long till we should schedule it or set that second still active on that and then we're going to turn that back and that's what the the work state machine is going to use to figure out how long to wait and that logic sort is similar for the activate and the deactivate we have these other lambda functions in there and we also this is going to use more parts so this is why we're not just deploying straight to lambda we're going to use this as a service app deploying with a CloudFormation template which is what this service template is here and if you look in that default file we specified template is service template so now when we deploy it the wizard is going to be a little different in fact let's deploy it first because it takes a couple minutes for it to come online and then we'll talk about what's in that template you can see the wizard is simpler all we really have to do now in the wizard is specify what is the name of the cloud formation staff and what is the s3 bucket that we want to use to store our applicate our compiled application bits when we do this deployment if I had parameterize the template there would be a next button in there for me to enter those parameters but for this example I didn't parameterize them so we'll just go ahead and publish that it's going to do the similar thing it's going to compile the app zip it all up send it up to s3 and then we're going to basically tell CloudFormation go and create a this CloudFormation stack with these resources so that in a second is going to bring up the view I drink some water and here is the cloud formation stack view coming from the Explorer you can see it here and this is going to start streaming in the events of these various resources coming online for us so while that's going let's take a look at the server list template so template has you can define parameters I didn't in this case and then you have your collection of resources so let's look at that so I mentioned I needed two tables so here is my definitions table that's being created and my active polled collection and down when we download we table it since it's a no sequel there's no schema all we need to do is define what is the key and I mentioned that we can enable streams on this so that's where this is it so this is going to enable streams that we can hook up a lambda function to capture when new polls are created and start that workflow execution and there's my active poll and then we have the aether net core function so this is really the lambda function that represents the whole is going to core a part of this it's type of service function that's sort of a meta resource because what it's going to do is it's going to create more than just a lambda function with a it's going to also set up our API gateway as well that's this event section here so the events is going to say hook this up to type API which means a pack gateway and normally a lot of times what you'll see is that when people create a service application they'll use a tie gate weight and define all of their end points in their rest application but in this case what we've done is we're just saying send all requests to our lambda function because since this is an eight-minute court application we're going to rely on a spinet core to write to route to the right controllers for us and for any HTTP method the other thing is going on here is we can pass environment variables in so we're going to pass in the names of those dynami tables that just got created as part of this template so because initially I just have my two tables that I was using locally but now I suspect I probably have a couple more that just got created based off my cloud formation template here's my state machine so this is saying use this role to run the state machine I should mentioned also and that lambda function is when we specified the role it used so we have a two roles we're using here's the role the state machine has so that's giving our state machine access to invoke our lambda function because by default you never have access to things in a diversity always in a BAS you always have to tell it what you're allowing things to do nothing's going to act on your behalf unless you say you're it's okay and then there's a definition string which you might wondering why is that blank the reason that is blank is we have added a little extra tooling in our done a tooling so that in our default file we can say with this substitution replace the content of that with by this JSON path with this contents of the file the reason we did this is that I could define that state machine in its own separate file and not have to try to define it in an escape JSON document inside of a string so if we look at that state machine and say here's all those states alright we've got our schedule state which is going to call that lambda and that return back that property set of seconds tool active so that's going to wait that long let me go to activate wait again and so on again this is a fairly simple one we could do more complicated things but we didn't need to in this example so then here's our collection of defining those lambda functions for each of them of those we're going to use inside our state machine so there's that schedule to schedule tasks lambda function active tasks like wait to ask deactivate you might be wondering why are all these code blocks empty and if is empty a as well for the ethernet core function the reason is when I write this file I don't know where the code is going to be because the code was uploaded as part of our deployment you saw that was that first step in that deployment wizard what did the wizard doing is it first uploads everything to s3 then read this template file and goes and autofills and all those properties to where i just put two bits F so you're not having to manage that and then the last will resource we have here is this is that Dyna T V processor this is the function that is going to go listen for events coming off of my done and V table and so I can start those workflow executions so here I'm passing those environment variables of again those tables that I'm using and also now the state machine that just got created and then in the events section I'm saying this is hooked up to down RGB to this stream this is the stream coming from that pool definitions table so here I've defined know all a lady's resources in this file that I can just deploy as one unit the last thing that we need to talk about is permissions or because we have to give access to these database services they don't have that by default so here's that role I defined for state machine which basically says here that Atos step functions is allowed to assume this role when it's working with our state machine and it has access to to call the operation in function so it's the only thing state machine can do or state step functions can do on our behalf and the other role here is the one we're going to use for all of our lambda functions so that's why we're saying that this can be assumed by lambda so these are all the permissions our lambda function can do and there are a couple ways you can do set up policies you can use manage policies which are there's either you can create your own policies that you can share in your account or there's policies that database services provide so here is a manage policy that the lambda team provides which basically is going to be giving me access to right to cloud watch logs but now I also want access to dendy B as well so this first means open this little wider here first rule here saying I don't expend want all the crud operations for Dyna TV for only those two tables so there's no way that my land of function can affect anything going in any other tables and I need to give access to the stream be able to access the stream so you can get those events and the last thing we need to do is we have to give permissions to start the execution of our workflow and that's it now I'm betting our stack is complete it really took about I think it takes about a little less than 2 minutes let's see my computers on Seattle time here but so it started at 9:00 11:00 a.m. in Seattle and finish at 913 so to create that all that second all those resources took about 2 minutes to do now I created brand-new tables for this application so I don't currently have any poles in my application so to help this out I did create one of my web controllers is one just for adding sample data which is going to go read in this JSON file sample poles so let's just go ahead and run that I'll use postman for that I'm not going to do an update in the middle of a demo and so we'll say API sample data as a post send that so this is going to go and add those tables to my definitions table which is then going to trigger off events coming off the stream which that Danity stream processor is going to find and kick off the executions of the local executions which then step functions is then going to say well let's start the flow of that and start scheduling those pass our pulse so if I go into the web console your step functions the first one was from a different practice that it earlier today but so this is the one I just created you can see here's the executions for the three poles I just created and they're all currently and that sort of wait to deactivate because the way I set up the sample data is I wanted them scheduled for now if you see if it took in is it's got that pole ID which it was 0 seconds would activate and now it's going to stay there for that many seconds 12,000 seconds or so so there's all that hooked up so now if we go to the website you can see we have now deployed our service application using all those moving pieces together as one CloudFormation template and we can start using it so I can say I am currently using Windows Chewbacca is the unsung hero of Star Wars movie where should I go in Norway I am NOT going to try to pronounce any of these names but I thought I would go to this valley to do some hiking I don't know how to say that name though there we go so there is our service application all deployed together to CloudFormation template without using any servers for this ok how am i doing on time I have a little extra time here so the one thing that I was think about this last night while going through this again that's bothering me about this is we are using lambda functions to deliver the static content right because this site has CSS it has JavaScript it's bringing those anchors and using lambda functions to bring down static content is probably not the best use of Latin functions that's what we have as 3/4 for using bringing down static content so like I said this guy's API gateway definition is fairly simplistic right it is look at the Gateway this is the service it's just a proxy to send everything in there so alternative I've explained was last night which is something I've been wanting to add more pooling with and say we make this easier to set up is what if we use s3 to handle all of the JavaScript and CSS so and I like this is from my other account here this guy's implementation you see what I did here is I still have that proxy to send everything to my ISO core but I have for the CSS and the disks folder I have a proxy that says send everything to my s3 bucket same with this one and so I have copied all those static content to that one so in this case to show what I am talking about if we look at this is poster Shh here is the a spinet core application basin at the lambda function exponet core and the demo that we've already been doing today we look at let's just clear these logs started scratch here and if i refresh this now we refresh this get the latest logs you can see we got quite a few of the vlogs coming in through the reason I got multiple is because there's multiple compute environments currently going on so we got parallel requests and so if we look at this so you can see see this lambda function is being split up just to return back to the site CSS file and these other ones are there right so in this other let's take a look at my other implementation here again it's the same code in the other one I just re-engineered the API gateway layout so let's go there [Music] and so here is this guy's lambda function delete its logs we can see what just happens for that get the URL from the stack completely left to pull veneer so this guy now if we looked at its lambda function at its logs see in this case we just had two requests we had one for the main page that's basically controlling the base pass for angular and then just the Web API to get the whole feeds so there's a way you can use API gateway to basically reduce some of it so station record to take static content and push that back into s3 okay so that we can see how we can run a set of core apps on lambda you do that with the Amazon lend a phonetic or server nougat package obviously poster you might not be the easy way to just get started but you can actually just get started in the blueprints there is a blueprint under project service there's an ace in our core blueprint that has that already set up for you and I didn't have a blog post I put out there that walks through how you could take an existing eight-minute core application and deploy it this way if you want to try that out we also learned how we can use confirmation to manage our whole architecture out there for us and we used a two step functions to define our state machine so we can control when our function are when our poles became active and deactivated that some final links for everybody the toolkit out there again 2017 you can get it from the gallery 15 from our website all of the Dinoco lambda tooling the CLI stuff the libraries I do all that work and a gallon github on Eddy is lambda net so if you ever have any questions or issues on how to deal with dotnet core and lambda feel free to open up an issue a question there and I'm happy to help people out I took a snapshot of my poster code last night and I snuck up on this repository if you go to that repository there is folder that has it in there and I put the slides in there as well so if anyone is trying to take pictures you can just give it from there and I contribute a lot to the ATP stat net blog so I write a lot about net and AWS lately been writing about a lot of lambda and dotnet together and with that thank you so much for coming I don't know if you want any questions feel free to ask no usually a sorry the question was was when was a region constraints when working with AWS usually with services that have events connecting up to each other so if it's like a lamb to connecting up to another event those need to be in the same region but I can definitely have my lambda function that's I'm going to go access buckets and other region but you're not going to be able to I don't think there's any service that has events that you can send cross region so there is I mean Esther you do have to pay for the getting objects out especially for small little files though it takes a lot for that to be significant you have to on the question I'm sorry of what is the cost for going to putting the cassette account in s3 it would be the cheaper option than having it being delivered by lambda so step functions the way I've always done it and really I've only additionally been starting to look at step functions lately myself mostly for this demo is your religious can be writing X unit integration test like there's not a way to really just run step functions like in a local environment so the question is about metrics and so there are metrics the metrics are shipped off to cloud watch I know we have lots of names to figure things out well actually so cloud watch is the main place to get logs if you look at the lambda console then actually more detailed information that we have and I took it right now so here is the function that we just did has monitoring tabs and you can see some of the metrics there and then you can go to the cloud watch console to drive deeper into that you know questions all right let's call it a day all right thank you everybody
Info
Channel: NDC Conferences
Views: 17,709
Rating: undefined out of 5
Keywords: NDC, NDC Oslo, Norm Johanson, Cloud, .NET
Id: LaLUQFFvtDY
Channel Id: undefined
Length: 49min 44sec (2984 seconds)
Published: Wed Jul 05 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.