Boost your productivity with AWS Toolkits and Amazon CodeWhisperer

Ok, Iron, how are you doing today? I hope you, you've been energized by um Peters and Adams knot yesterday evening and this morning, a lot of good stuff and trust me, stay tuned because uh there will be more to come in, Swami and Vernon knot for sure.

So I would like to start with a question so that we can know each other. How many of you I've already experienced this feeling that we are always asked to do more with no more resources no more time. How many of you? Yeah, I'm not wrong and you're not wrong. That's why we keep hearing about uh productivity and developer productivity.

So in this session, you will learn how to be more productive as a .NET developer with the AWS Toolkit and uh Amazon Code Whisperer and I'm joined today by my Amazon colleague, Christopher Chris too, who is software development engineer in the AWS tool kit team. His team is responsible for all the goodness you have in with the L BS toolkit in Visual Studio and Ryder, his team is also responsible for all the bugs and issue you could experience with the tool kit in Visor and Ryder, I'm teasing him.

Um I do my job seriously. I use extensively the toolkit to ensure that uh you will have a great experience with it. And it leads me to my next topic. I'm a developer. I caught it on a daily basis and I don't know about you. I don't optimize my life only for productivity. I optimize for joy.

Joy comes not just from watching our work grow into accomplishments. Joy comes uh also from everyday small task of solving problems, fixing issue, sharing with colleagues. Do you remember the first time or a time where you solve a really challenging issue? I do. I was working in a court lending company in Europe and I was the tech leader for the financial back office.

Um we had a monthly job uh running and get processing all the financial data and this job was business uh critical for the start up because it was um defining how much mortgage we could grant the next month and one day we've experienced a american issues act. So the attackers change slightly the job, not enough to be obvious but enough to be critical for the company.

Hopefully someone from the finance team got there, there was an issue in the data and wellness and we've started to investigate and i spent 24 hours with two of my colleagues. Yes, it was a rough night. Focus on just this finding the issue and fixing the issue to allow the company to move forward. And we did it methodically using our backup to travel back in time and see what's happened. And we find the issue, we find when it had had when it has happened and how to fix it.

And when we did it, we were so happy, it was kind of amazing experience. We were so happy in a way, we save this start up because uh it could have been really critical for, for the company. And i think it's really what we are working. Uh why we are working in this kind of world to, to feel this feeling, to, to experience this feeling of, of joy.

Um and there is a hungarian american psychologist, Mihalis Mihai, sorry if i didn't pronounce pandemic correctly. Uh we developed a concept called flow. This is a set of being when you're just doing something and you are so into it, you just is like a non growth state, the world around you just doesn't exist anymore, the time has stopped. And in a way you, you are experiencing Einstein's relativity theory for real, the time fly.

So this psychologist has developed this diagram to illustrate uh the concept of law and to show us the emotion, the emotions you feel as you go through a task. So on the horizontal axis, you have the skill required by the task you're working on and on the vertical axis, you have the difficulty of the task and of course, when you are working on a highly difficult task, but you have low skill for this task, you experience anxiety and you don't want to feel this.

But on the other way, when you have high skill for a task and you are uh it's a really difficult task to, to solve, you can reach this state of flow where you really enjoy what, what you're doing because it requires the best of you and you deliver and you succeed to deliver. And this is where your experience is flow set and, and the joy that comes with.

But in my opinion, this is missing something important. Something that hair all the time friction, all this insidious interruption in your creative work. The introduce things that gets into our way that slow us down. It's so common. We, we can of some time we we don't have a notice anymore. It might be a tap on your shoulder, it might be a slack message. It can be yet another late minute meeting and it takes an average of about 25 minutes to return to the original task after an interruption.

Um according to Gloria Mark, who is studying uh digital distraction at the University of California Irvine and multiple studies confirm this. So in my opinion, more than often, i think the this is also the endless paper cut of frustration in our tools and our processes that prevent any possibility of flow bu i isn't intuitive. The documentation is complex to understand. And all of this impacts what i like to call the meantime to success.

How long does it take to you from the moment you start in a project to your first win? And this metric isn't about productivity, it is about uh it measures the level of friction you are experiencing and it's that friction that at s we want to eliminate.

Um uh inspired by this Adam Clingman, our VP Generative Builders uh last year at r invent, develop um a vision for where we want to take uh developer experience for aws. And he came up with three things. Uh and some oil turned it into a haiku, a delightful, delightful flow for all the developer and every dev team though.

Now there are sort of three thing, three parts here that they are all important. The first is about the delightful flow, removing the friction, providing a great developer experience and a developer experience that works for you and not every developer is the same. And that's the second point. We serve many different kinds of developers and we'd like to serve many more developers in the world.

They have different preferences, skills, they work in different domains, different kind of project, different kind of user. They are not all cloud developers and they do other things and we would like to support all of them. And finally developers all work in teams. We are all part of teams and everyone should feel included.

So there are a lot of things there. But today, we want to focus on the delight, full flow and to focus on what developer needs to their flow while they are working in their favorite idea. And what you've told us is that you want rich id support. You don't want to, when you are coding, you don't want to uh go into the ws console.

So leave your id and go into the ws console to get a piece of information like the rn or the name of the dynamo tb table. You want to use you, you just want this right into your id. You told us that you, you want to write code faster and yet securely because you have to do more to do always more.

And finally, you told us that you want to be able to easily debug your application locally and especially when you are developing service application. You don't want to have too much back and forth uh with your si content to deploy for testing small changes.

So that's what exactly uh the kits are aiming for. And we don't want to tell you that it can help you with. Um we want to show you. So today, we are tasked to build a mortgage service together. And as usual, we need to deliver the first a p for yesterday. So we have to be very productive and this api will calculate monthly loan payments given the loan amount, the annual interest rate and the loan duration.

But before jumping into the demo, um i'm always ask, i'm often asked about the commitment to the net committee and the story and the history of the ws toolkit is for me, an evidence of this long term commitment of ls to the.net committee.

So chris, i would like you to, to share more about this history. Absolutely. Um yeah, so the aws toolkit for visual studio is a plug in that uh offers you uh productivity enhancing features as you're developing your systems to work with aws. Um the a we still get for video studio also makes extensive use of the aws sdk for.net and that's where our story begins.

Um now, does anyone know how long the aws sdk for.net has been around? Uh let's do a show of hands. If you think that the, this sdk was first released in the last two years, let's uh raise your hand. Ok. It's been around a little longer, uh raise your hand if you believe the sdk for.net was released fir first released in the last 10 years.

Um a couple of people. Well, it turns out it was uh 14 years ago in 2009, but the green button, green button. Ok. And while the uh while the team was developing the sdk, they had a number of tasks they had to do uh that were very repetitive. They had to log into the aws console. Uh they had to change state update a bunch of resources and they realized that they could be more productive if they could automate these tasks and make them easier to perform.

And so that led to their first question. Um well, if we can make these productivity features, where would be a good place to gather those and share those out. Meanwhile, they were, they were faced with another question and that was um what's a good way to start raising awareness of.net on aws with.net developers?

Like you now the realization that you spend a lot of your development time in visual studio meant the visual studio was an ideal candidate or a good fit for both of these questions. This led to the creation of a visual studio extension known as the aws toolkit for visual studio. So this was released two years later in 2011 and some of its initial feature set allowed you to create and manage gc two instances.

It also has one of my favorite features in it. Um with just a couple of clicks, you can make an ssh connection into your two instance. And the first time i tried that feature out that was um that's some of that developer joy that francois was talking about. I didn't have to look up, look up ip addresses or anything, you know, a couple of clicks and i was in at the terminal. It was great.

Since then, we've continued to maintain support for the latest versions of visual studio today. That's visual studio 2022. And recently we added support for the even newer arm 64 version of visual studio. And so the longevity of the aws sdk for.net and the aws toolkit for visual studio are just two examples of aws s long term commitment to the.net community.

So now that we've um that we talked a little bit about how the toolkit came to be. We're going to use it to create this mortgage service. So uh can you tell us a little bit more about the mortgage service while it gets set up? Yeah, sure.

So this mortgage service will be uh a several less application we want to believe as a several less application. So uh at the front end, there will be an api getaway. So this api getaway will receive get request uh in this get request, we will retrieve uh the um parameters.

So the loan amount, uh the annual interest rate and uh the duration in years as query string parameters. And so for each get regret, the um api getaway will trigger an ed ws lamda function written in.net. And this uh edible lada function will uh process the parameter, calculate the monthly loan payment store, uh those uh data into an amazon uh dynamo db table and return the result.

So that's what we want to build today during uh the demo. All right, let's switch over. So when you're ready to write your.net systems, you know, you start with making a new project and figuratively, you're staring at that blank piece of paper. You've got questions which project type is appropriate for you? Where's that project's main entry point? And what does it look like? Are you going to need any, any dependencies for your system? And how do you configure it so you can deploy it to the cloud?

Well, a toolkit has some project templates that can help uh mitigate or reduce that guess work from the new project dialogue. We can filter the platforms down to aws and we can see the toolkit provided offerings. Now, the um the mortgage service we're gonna create today also has some uh additional aws resources associated with it.

So we're gonna create a serverless application project. So i'm gonna give it a name and within the template, the toolkit provides a number of blueprints that support a variety of different use cases. Now, today we're going to be building our mortgage service up from scratch. So we're going to start with the empty blueprint and this isn't entirely empty.

It's um it has just enough uh just enough stuff set up in the projects so that we can start worrying about, you know, writing our own mortgage system. Um and it's also built on the lambda annotation framework which we'll talk about in a moment.

So now that project's created, i'm going to take you through a bit of a tour here. We're going to start with this servius template file and this is the serverless application model template, which is the infrastructure as code representation of your system.

So when you deploy this into an aws account, it's also going to, to create a number of resources that are defined in this file to compose your application. So a couple of lines of interest in here um here, we can see that a lambda function will get defined and created on a resource. And it makes reference to this is the code that that function will run. And this reference is code that's also in this project. We're going to see that shortly.

And this couple of lines here is responsible for creating that api gateway resource that francois was talking about over in functions dot cs. This is our, this is our system's main entry point. This is what the lambda function is going to going to run.

So we have a single function, uh a single class in here which has a single function. And right now that function is just doing a simple writing a message to the lambda logger. Now, this function has a couple of uh attributes on it. And this is the interesting part, this is part of the lambda annotation framework.

So this lambda function attribute is responsible for defining that lambda function in your account and also configuring the behavior of it. This rest api attribute is responsible for creating that http endpoint that api gateway resource. And so when you put this together, what this is saying is get get based requests coming to this location are gonna run this lambda function which will then run this code here.

Now, normally when you're, when you're tasked with implementing a lambda function, um the lambda service will provide you an event payload and you're responsible for marshaling your own data out of that uh payload and then hooking it up to your business logic which you also have to write. But here we just have the business logic. There's, there's none of that marshaling or anything.

This is some of the really cool aspect of the lambda lambda annotation framework. Um behind the scenes, it's using code generators to do a couple of things. So as you're writing and changing your uh your project, this is updating the serverless template file with those resource definitions and it's also writing that boilerplate code that marshall's details around.

So let's take a quick look at that over in our dependencies, we can see that we have a number of uh lambda related nougat packages already referenced by this project. And one of them is the lambda annotations uh package here. So what that does is gives your project a series of analyzers which we can open up. And so this is the, this is the code it's generating behind the scenes for you that uh you don't have to worry about, which is pretty cool.

So that's a quick tour through the project that gets created. We're just about ready to start writing our mortgage service. But before we do, we want to make sure that this project is working uh out of the box. So i'm going to run it locally and uh this is gonna spin up a test harness which francois will talk about a little bit more in a couple of minutes.

And what we're going to do is simulate the lambda service, sending an api gateway event um pretending to be a get based request here. So we're going to run this and we can see that our lambda function is indeed writing a message to the lambda logger. So with that, i'm going to check in this code and francois is going to start implementing from it. Ok? Don't forget to publish, don't forget to publish the right. David took a bus

"All right, we're just gonna switch laptops here. Ok? For no, I will, I will check out the call. The only thing I have to do is to uh retrieve uh the code and I will be able to start implementing the business logic. Ok? All good. So to we are using code catalyst git repository to to share our code together.

So now I want to implement the business logic. Of course, I don't want to implement my business logic inside uh the um lambda uh boilerplate code. So I will create a new uh class for this, a new fire. So let's go monthly loan payments service. And first I want to define an interface, let's call it a monthly payment service and I want to define the calculate monthly payment method. So this method will return a decimal its financial uh value. It will take uh the loan amount uh as a parameter as a decimal, the annual interest rate um the duration in years. Ok.

So no, we only have to implement this. Ok. uh I have an issue, chris, do you know how to calculate this? No. Does someone in the audience know how to calculate this? Ok. So hyman need to ask a friend to do this and this is my new friend, my new hair, eye coding companion friend right into visual studio. It is code whisper right into visual studio. So it it seems amazon code whisperer knows how to calculate this. So it suggests uh how to implement the calculate monthly method of payment. So i love this.

So isn't it amazing, amazon code whisper right into my id. So like with any pair programmer, i i always use the code. So here you made a small mistake about combating the number and because it was missing some context here is doing this uh division by uh 100 because it thinks it i it sys that i'm giving uh the annual interest rate as a percentage, but i don't want to give it as a percentage but as uh as a double, so i will just remove this.

So let's see if code whisperer can do a bit more of just coding this because there is something i had to do is to com commence my code. I'm not good at this. So let's see if it can help me. So let's remove this part. So crisper has just launched in visual studio uh in preview uh on sunday. No, i don't want to do this. Let's ask code whisperer or it knows how to write my co comment.

So here i'm triggering it. Oh, i love this. it haven't had some suppress message. Uh i can remove them. So that's really, really cool. So here i can in a few minutes have my business logic implemented.

So to get there here in the, at the bottom of the text editor of the code editor window, you have the code whisperer icon and you can click on it and you get the uh context menu. So i would say that with a i coding companion, there is two schools of thought folks who love to get uh coding companion. Uh give them um auto suggestion, suggestion have the code. I'm from the uh other uh school of thought. Uh i do prefer to trigger my a i coding companion when i want my a i companion, my hair i coding companion to provide me uh some good suggestions. So it's up to you to decide what you want. I told uh previously we are all different. So it's up to you to decide what you want.

So here, um my business logic is defined so i want to add this to my uh dependency injection mechanism. Let's just add a singleton, that's it. And let's go back now into the functions dot cs file. So what i want to do is to have a private r e monthly loan payments, attributes. And let's see if god whisperer can help me to rewrite my yes, it helped me to rewrite my constrictor uh function. So that's pretty cool.

So here i just want to add this, that's pretty cool. It helped me. So now an a i compa companion, it's it's an a i. So there is no magic. If you want it to understand what you want to do, you have to provide it some context. So now i want to use my uh monthly payment service to calculate the monthly loan payment.

So here i can say, hey, it calculates monthly loan payments, given the loan amount as the simon the annual interest rate that's double room and the duration in years as in. Ok. So here i just want to change the past to show you later how to configure it. Now, let's see if code whisperer can help me to rewrite uh this method.

So i just trigger it and here it provides a good suggestion. So let me show you. So it exists to use an api gateway proxy request and on the object to retrieve the um the required parameters from uh from the object using the crew parameter parameter attribute. I don't want to use this method.

So i want to provide a bit more context to code whisperer that it knows what i want to do and which method i want to use. And now it has understand that i want to use the from query attribute. That is a new way to write uh your uh how you, how you want to define your parameters with a.net lambda annotation frameworks. So we tried this and it's all good and here i can just complete and that's it.

So now i have my business logic implemented and plugged into my lambda function. Let's test this locally. I run the ma on that test to. So here i will uh like chris did before, i want to use the api getaway bs proxy events to simulate. And here i will want to change the path and say it's monthly payment. It's a get method and i can define my loan amount. Let's say i want to borrow $10,000 and for the annual interest rate, i don't know in the us. But in france, the 4.5 would be a good interest rate. And for the duration in years, let's say i want to borrow this amount for five years.

I don't want to retype every time i want to test, i don't want to retype all these parameters so i can save my request for later so that i can reuse it. Ok? And now i can execute. Oh, so here the the result is encoded in be 64. So what i can do here, it just change to object and return an anonymous object with my monthly payments. That's it. Let's rerun this and you will see that uh the result is calculated.

So let's reuse my request and let's execute. And now you can see the uh log here and the results of my, my anonymous subject has been serialized automatically. And so the monthly payment is 186 and that's the correct number. Trust me, i i i've told you that i don't know how to calculate this. But remember, i've, i've worked in a quote lending company. So in fact, i know how to calculate this. So we do. That's pretty cool.

But how now i want to store this uh data into an amazon dynamic. So what i want to do is to had the dynamo. No, get back. Ok. It's done. So remember we told you we want to test and debug locally. So here i want to show you uh that in my bs explorer. So this explorer, you come with the bs to kit, i can browse uh local dynamo db table so you can run amazon dynamo db table. Locally uh through uh a docker container for example. And so you can test locally.

So i have a dynamo divi instance running locally and i can test locally. So to use this, there is a small trick to do here. I want to let my amazon dynamo db client that it needs to connect locally and not in every second how to do this, i just type it if i'm in debug man. Ok?

So let's go this. So if i'm in debug mode in my dependency injection mechanism, what i want to do is to add uh an amazon dynamo db client. But this amazon dynamo t client will have a specific configuration there. And i want to define the service you were on and say, hey, you, you will connect to my local instance, oops all good. And if i'm not in development, it means that i'm deployed in a second. We just use an amazon dy, you be cool.

And one more more step i want to do is say a in fact, what i will use is an he amazon dynam b interface. So here for this interface, you will use the one i've already configured. So that's a bit of a trick, but that's the way you can do it. So who is this? My dependency injection mechanism is set up to use amazon dynamodb client locally when i'm in the mode. And my second when i'm deployed.

So let's go back to my function, the cs file. And let's see how amazon code whisper can help to uh use and to learn how to use amazon dyn o db. So i need to provide amazon dynamo db with a bit of context here. No, no out. And i want to use those names space i will have and another private rhythm attribute my amazon dynamo db. Let's see if god whisperer can help me to rewrite my. Oops k.

So it helped me to rewrite my, my um constrictor and no, i want to provide it with some context. So put the monthly payments, the ornaments b annual interest rates and the duration in year, the duration in years in an amazon dynamo db table called monthly payment with a unique identifier id, catch exception and log exception message. And let's see what code whisper will suggest.

So it it starts with a trial. That's pretty cool. So it seems to know how to use the api. That's pretty cool and it has under understand, understood that i want to log uh the exception message. So here it knows how to uh use the low level api from amazon dynamo db table to uh store uh the data.

So i just want to show you very quickly that it works. Yeah, so it works all. Ok. So the data is in my dynamo db table. I was a bit afraid because i miss to check something and it does it for me because here, i'm using a put it a sin. Uh me and my get method is not an awa uh method. So it was smart enough to, sorry, it was smart enough to uh use the weight method here to ensure that there is no issue. But so james isam, a colleague of her when i've prepared decisions and told me, oh, that's not a good example. You are using the low level api and i was ok.

Let's see if cod whisperer already knows that the aws has dk four.net because there is two other way to store data in amazon dynamo db table with the.net sdk. So here we are using a low level api and there are, there is, there are two other models, the document model and the object persistence model.

So let's see if god whisperer know the document madam. So i just change the name space to give it a bit of content on what i want to do. And let's go there and let's trigger and let's see what it suggests. It seems it knows. Yep, worry about this. Yeah.

So he made a small mistake. He didn't want to use the put heighten, i think because it was kind of ok. But this method is not, is not nable method and the method on the object is put item, i think. So it was a kind of conflict. So it it wrote put item, not put item, i think. So sometimes you the programmer is a bit and you have to review it for here. What i want to do is to transform this into a weight me and just say, hey, just um i think so, let's try and see if it works.

So the result is there and let's, you know, if we have the result uh in the table, let's count the table. Ok? And now let's see if it knows the object resistance model. I really want to challenge it. So let's move it. And here, let's change again the name space and let's do it once again"

"So here what it suggests is to create a DynamoDB context object passing my uh Amazon DynamoDB client and to use the async method. And in the third async method, it using a monthly payment object that that doesn't exist yet. So let's see if it's smart enough to complete the job.

So here, so it, it knows that ok, the monthly payment object must have both attributes and I must tag the ID property with the DynamoDB hash key attribute to let the system know that this is my hash key and here it has for the time to put the dynamic table attribute. But if I re trigger got whisperer, it's it a spot that oh I've missed something.

So now let's see if it works. Oh we made a mistake somewhere. Oh yes, of course. So let's do it again. Ok? Let's execute still the same result. And let's count. I admire that. So what we just saw is that could whisperer know the three ways to store data in DynamoDBi table using the LBS SDK for .NET. So that's really, really good.

So that's exactly the, the pro ma we do with Amazon code with, it's the best a I coding companion when it comes to using LES, if you want to uh use LES from your code, from your C# code from your Java code, Amazon code wiper is your best coding companion because it knows the LBS you get by heart. So that's what we've just seen.

So one last thing I want to do um because it for real deployment, what I want to do here is to change this and put HTTP no. Ok. And here I want to return uh HTTP results, internal server error message. So it's HTTP results uh class. Here is an airport class class to manage your message. And I want to and the exception messa message here and here what I want to return is a HTTP results and it's uh okay results. And here I have my object. So I'm good to go.

So now I will uh commit all those changes and leave it to uh increase all good. It is push, pushing. Ok. It's pushed. So, ok, please. The station is yours.

No. So remember what we've just seen. It's, it's really about code whisper. Know imagine it knows the three way to use the LBS SDK for the DynamoDB. So it, it can really, he helps you to speed up the way you use the LBS SDK. It's, it's for uh code. Yeah, it's for DynamoDB, but also for other uh SDK, other LBS services and the message I want you to keep in mind is it's all about context.

So you have to think about what the context you are providing to code whisperer and to your AI coding companion in general. It's up to you, Chris.

All right. So once you've developed your system and you and your team are happy with your implementation, you're gonna be in that. It works on my computer stage and you wanna get confidence that it's gonna work the way you expect when to deploy it into production and a good way to do that is to first deploy it into a development environment. And you might be wondering, well, how do I get it into any environment? Do I have to zip my program up and upload it somewhere?

Um now we're gonna use a tool kit to bring our mortgage service into a development environment and show you how that can uh how that can be made pretty simple. Now, I've just finished sinking down uh Francoise's changes. We'll just make sure I have them all here with the long beam. Yep. Good.

Um yeah, so the toolkit has deployment support for a number of different project types. You can typically find this in the solution explorer in the context menu of the project you want to deploy. Now, in our case, we have a function, we have a project that has a lambda function and a serverless template file. And so the toolkit knows how to deploy this into cloud formation.

So we're gonna give it its uh give it some details here and start deployment. So what the toolkit is going to do for you is what have we got here? Published field do we build? Oops, I'll try that once more.

No. Ok. No matter, we'll fall back to the demo video. Then sometimes things don't go the way you expect, but we can have a, we can be prepared. Um so the toolkit will compile your system. Yeah, we'll get this part here. There we go, buy our system package it up, upload that package into your development environment and then pass that package along with your cloud formation template over to the cloud formation service.

Meanwhile, cloud formation will then proceed to create this cloud formation stack which will then continue to create all the resources that are associated in the serverless template file. So now that that's applied, I do have an alternate stack here. So we can take a look and um we can view that from the same aws explorer from here. We have a number of different uh service types where you can interact with resources in your account and the car confirmation stacks are one of them.

So, in this case here, we have our mortgage service up and running in our development environment. And so we want to try it out. We wanna find out, ok, can i get my mortgage payments? So we're gonna take this uh url and we're going to try running it through a an http file which is um built in support by visual studio. And this lets you make rest based request right from a file here.

So I'm gonna paste in our url and we're just gonna make sure we have uh the query parameters all set up here. Now, in my case, i was looking at real estate listings earlier today, i found a one story house for $400,000 and i could get a 25 year mortgage at 6%. So let's see if we can find out what our mortgage payment would be.

And here we have a 500 service error. So we didn't see that on franoise system. It was working on my machine. So when things don't go the way you're expecting uh when they're running in the cloud, you're gonna want to look at your application logs and look at your application state.

So i'm gonna show you how you can look into your lambda function logs and see if you can troubleshoot a little bit. So in our case, we're gonna go back to the aws explorer here and we're going to look up the lambda function corresponding to our uh deployment stack.

Now, uh this panel is pretty cool. You can, you can see a couple of details. You can actually change the behavior of your function here. You can make one off runs of your lambda function by providing a payload. But today we're looking to troubleshoot. So we're gonna go down to the logs, this is gonna bring up the cloudwatch log group that's corresponding to your lambda function.

Now, i just ran this one today. So we're going to load up this cloud watch log stream and we can see there's a failure message in there. So let's see if we can dig down a little bit as this is saying, our lambda function doesn't have permission to interact with our dynamo db table. It's always about permission, but we didn't have to leave the IDE, right.

We started with an infinite amount of possibilities for this failure and narrowed it right down to uh permissions policy so we can go and make that change. Uh now that we know that we're gonna come back to the um those that the lambda annotation framework and those attributes, remember how i mentioned, we can change the behavior of, of your uh lambda function. We can add a policy here.

So what i'm gonna do is uh grant this function permission to um communicate with ODB and we can see that ah code whisperer actually was ah providing a suggestion with that same policy, which is pretty cool.

Now, remember earlier, i was saying behind the scenes to lamda annotation framework will update your serverless template. And here we can see that uh my file indeed is updated and that policy is now in play. So um we're going to deploy this up into the cloud again, we're going to update our our development environment, but i will fall back to the videos for the deployment here.

No, i don't have that. Ok. Anyway, so i already have it deployed. I have a second, a secondary um a secondary stack here. And so we're going to take that one's url and copy that into our, into our http file and let's try running this one now.

No, maybe i didn't get the right one. Oh, great. Ok. One last thing. Well, i forgot. Um so you may have remembered that francois was, was prototyping with a local copy of his dynamo db table. And we're gonna also need a dynamo db table in uh in our development environment.

So if i copy this table name from here, monthly payment, so again, with the amos explorer, you can create a prototype resources for a selection of services as well. In this case, dynamo db is one of those. So i'm going to add this table into my development environment. And now once you're happy with um with your implementation, you're going to want to codify that as part of your infrastructure as code.

But while you're iterating and getting things settled, you know, it's a great way to kind of quickly stay in your uh in your iteration loop and uh and make progress. So there we go. We can see that uh my mortgage payment would be about $2500. And so we kind of made it from start to finish. We didn't leave the IDE at all. Uh we troubleshoot some things and we got to a place where we're happy with uh happy with our implementation. So i think all that's left to do is ship it.

So we did it. So we did it. Um yeah, so in 30 minutes, roughly 30 minutes we did it, we deployed. So uh this uh mortgage uh API and so let's wrap up on what, what we've seen.

So we've seen the getting started experience with all those templates you can use to uh bootstrap a project using LWBS resources. We've seen that you can, with the LBS explorer, you can access your LBS uh services right into your IDE. You can interact with them like like get your uh cloudwatch log.

You can test and um debug locally your BS lambda function. Thanks to uh the mock lamda tools you can build your infrastructure as code with. Uh for example, here, the some several S dot template file but you can also write some um cloud formation file uh with the w the help of the BS tool kit, you can deploy to your seconds and you can access your amazon watch log.

So that's pretty cool to have these uh things to the toolkit. But even more. Now with the toolkit inside uh visual studio, you have access to amazon code whisperer or AI coding companion. So it generates code suggestion in real time or when you trigger it.

Um you. So code whisperer has a feature of for scanning code to fi to uh find uh for how to find your n abilities. Sorry about this. So for now, the integration is in preview. So this feature is not yet available in visual studio. Uh but you can access uh can have access to this feature in VS code or jet brains IDS and it flag code that resembles to open source training uh data or so it means that if it suggests code that resemble to open source uh training data, it will let you know that ok. This piece of code is maybe an open source code and it is licensed under this license. So you can decide if you want to in integrate this code into your code or not.

And we run a productivity challenge. And participants who use code whisperer were 27% more likely to complete task successfully and did so on. An average of 57 persons faster than those who didn't use code whisperer. So gave you a rough idea of the productivity boost you can get with code whisper.

So maybe Chris, you can give us a, a quick look on how it works under the room. Um yeah, we'll give you a quick uh we'll we'll show you quickly about how you can get into it as well. Um i'm just gonna switch back here.

So um yeah, now that you've seen uh you've seen us use code whisper, you can give it a try as well. Um you just have to grab the latest version of the tool kit and you'll need either an IAM identity standard connection or an AWS builder ID connection. And once you have that, um the tool kit has a getting started panel which will take you through, it'll guide you through. I'm already connected right now. The first time you run it, it's gonna take you through a process. that'll let you put in your connection details and then you'll be connected and that's how you can get started trying it out.

So give it a try and uh share feedback with us about your experience. Ok? Thanks Chris.

And finally our call to action is please download, try it and provide feedback. So on the left side, you have the qr code to go uh download the, the LES ku. And on the right side, you have the qr code to provide feedback on the github uh repository.

So please go download and try it and provide feedback so that we can improve uh the experience. So that's it for, for this session. Thank you for your attention and please complete the session, sir."

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值