AWS Nordics Office Hours - What's new with AWS Step Functions

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone and welcome to the aws nordic's office hours with miguel nagios i'm a developer advocate here at amazon web services and this is our weekly show based out of the nordics where i bring on aws experts to talk about a specific topic and let you our viewers ask your questions so if you have any questions throughout the hour just post them in the chat and we'll do our best to answer it and this week i am joined by ben smith welcome to the show ben hi gina thanks very much for having me thanks for being here so tell everyone a bit about ben sure so i'm a senior developer advocate for aws specializing in serverless so i work inside the serverlessproduct.org i've been at aws about two years and i'm based over in london all right so this as i mentioned every week we have a specific topic to talk about and this week is no different we're going to talk about aws step function and what has happened with aws step function everything that's new with every aws step functions and i think we have a lot to cover this week ben yeah i mean um this is actually a a show that you and i have tried to put together for a few months isn't it but the step functions team this year have kept coming up with new releases and we kept saying okay let's push that back until they've done that one let's push that back until they release that so eventually we have to just pick a time and show what's what's been happening up till now but there's been so much great stuff from the step functions team this year so we've got a lot to kind of cover in this one hour demo yeah and if you ever watch the show before you know that i like show and tell and this is definitely going to be a show until hour so if you have any questions throughout just post them in the chat and we'll do our best to answer them where it's appropriate throughout the hour so let's have a quick look at what's happened with step functions yeah so um i've put here at the top here the kind of four highlights at least for me i think these are really significant releases this year but there's been a lot more that we could pick out so the first was the data flow simulator and this is a new feature of the aws management console which lets you model your json your json path and your json data as it flows through each state in your step functions workflow and we'll have a little bit of a look in a minute about how you can use that and how that can help you the next was workflow studio and i think this is massive so workflow studio kind of created a drag-and-drop interface for building out step functions workflows and it's a completely different new easier way of building out workflows where you don't need any code knowledge whatsoever it's really great for business users it's really great for maybe sitting next to one of your stakeholders as you build out your workflow and showing them how your application might look and then very recently they launched the sdk integration so that's a new type of uh task which lets you call any service that has an sdk api so that means you can now call i think it's 9 000 actions right using the sdk task um so it just totally uh expands the usage of step functions it what it also means is that you you need a lot less lambda functions in your step functions workflow so previously people were using a lambda function to call some kind of api um you know to run some some uh sort of compute on their data now you can just build or call that api directly within your workflow you don't need a lambda function look at how you can replace lambda functions with this sdk integration and then the last thing i want to cover is not specifically a step functions release but it's a really interesting thing that integrates into step functions uh very well it's called sam accelerate now sam is the serverless application model it's a infrastructure as code framework for building serverless applications and they recently launched a new kind of component of sam it's in preview at the moment i believe what this does is it allows you to automatically and very quickly think the local version of your serverless application with a cloud developer environment and it uses aws service apis to automatically upload code to your cloud developer environment account and i'll show you how quickly and how you can use that in just a moment so we've got quite a lot to get through we have uh and i think i mentioned for you uh when we talked about this episode previously the new sdk integrations is something that i i'm really excited about i've i've been using these couple of weeks to to remove lambda functions from my workflows uh and using integrations instead so uh looking forward to seeing more from you about that as well so is it time to jump into the console straight away yeah i think it's always easier to to see you know how things work by looking at real world examples so what i was going to do here is is look back at a previous blog post that we did about a year ago which was build an application which uh takes in a a web web page forum post and figures out if that web page form post submission if the user was happy with what they wrote or not happy so detect the sentiment by using a service called amazon comprehend then generates a reference number based on that contact form submission saves that in a dynamodb table and then if they were unhappy it will notify an administrator to let them know that there's a case they need to follow up on and if they were happy then it would just save it and move on and then it returns the reference number back to the user so this is what we're going to build out and we're going to build that out using those new features right but i've actually already started a bit of this already to get us a bit of a jump start on this okay so uh this is the workflow at the moment so uh it receives an inbound uh http post from a forum request it generates a customer reference number that's a lambda function that just generates a random id essentially it records that random id in the dynamodb table and then there's another lambda function which sends out an email using ses and here on the left you can see the asl the amazon states language which defines this particular step functions workflow and if you're you know very even if you're very fluent at asl this becomes quite difficult to read and navigate quite quickly because you know there's only three tasks here and there's a lot of code right now so this is one of the key reasons that the team created workflow studio so workflow studio is this new editing experience which you can get to by simply clicking um workflow studio here that takes me to the workflow studio console so here you can see the same workflow on the left here i'm able to search for all the different tasks and integrations and states for my step functions workflow i can simply drag them into my workflow to start building it out and then when i click on each one of those steps i have a form on the right here which allows me to configure that step so what we're going to do is we're going to build out this workflow to be a bit more rich do a few more things okay first thing we're going to do is we're going to add a lambda function which will run some code which will use amazon comprehend which is a ai service or a machine learning service which will detect the sentiment within a stream okay and that's already been deployed into this account so i'm just going to name this effect thanks so let me just ask you a question ben yeah what i've seen myself doing since the release of workflow studio is that i i tend to do everything with infrastructure as code of course so don't usually use the console that much but now with workflow studio i've i've started using the console specifically for building these workflows so then making use of of that step function um sorry the state language uh output from it and then using that with infrastructure as code is that something you see do you do the same or how do you work when you're building your workflows yeah that's exactly what we're going to do in this demo actually because i think the the workflow studio is a really good way of getting started really quickly you can you can rapidly build out a workflow with so many different tasks and different steps and different choice states you can configure it with this form and then you can switch to this uh tab over here where you have the entire asl definition which you can then copy and paste into your local ide uh you know for a more sort of future-proof way of building out your application now i know the step functions team are working hard on making that that developer experience between console and local uh more seamless and more user-friendly but at the moment the way i tend to use workflow studio is to get a real jump start on my my building experience before then switching back to local where i do most of my ongoing development okay so we've got our lambda function and we're going to choose a uh we're going to choose which lambda function this will invoke my my browser is so zoomed in now i'm almost don't remember how to use it uh so it's we're going to search for our lambda function name it's called detect sentiment there and we're going to use the payload as the input and then what i'm also going to do is i'm going to use this this um a result path to tell it where to put the result with this lambda function i'm going to put it in something and that's it we'll just save that oh actually i might as well yeah we'll just save that for now apply an exit we'll run this through and see what we get so i'm going to just run this manually for now start i need to save it again i'm going to provide my input payload so here i'm giving it a user id i'm giving it a name i'm giving it an email and here's my message that it's going to detect if it was positive or negative normally i would submit this via my form but i'm still in testing stage right find the detect sentiment lambda function in that up there we go now i can step through this right and i can see okay yep that's the payload that i provided here's the output that that created so it saved the output into something called sentiment results that's something that we set right and you can see that it decided it was negative because i wrote my package didn't arrive that sounds pretty negative so that's all correct then it recorded that transaction in dynamodb and it sent out an email via scs okay so that's fine but we can we can go further with this right so let's go back into it and build this out a bit more via workflow studio so let's say i only wanted to um email an administrator if there was a negative sentiment detected because i don't need to know about every form submission customers are not happy so then i'm able to search for a choice date here i can simply drag that in and i'm going to add something called a pass state which is just logging really data transformations but this is just makes it easier for me to read my step function so i'm going to say call my choice state uh good or bad or could call that positive or negative i'll say this is bad and add another past send out an email to a user if it's bad okay now i need to define the rules when should it take this path and when should it take this path i'm going to edit my first rule and add a condition and i'll say that when sentiment results equal to a string constant that says if i wanted to take the bad path otherwise i'm happy for it to take the good path yeah that's what i need to do so we'll apply that we'll give that another test right that double save always okay so i'm gonna go back to the previous execution the one that succeeded i don't need to copy and paste my data back in so do a new execution same data and we'll see what happens here now in an ideal world this would just run through straight away because i've remembered all the right places to for example in the choice state i put the correct field to look for the positive one negative sentiment but in fact you can see from the key here that it's been cancelled it didn't pass through that job so if i come down here i can look at why that failed see that uh this was an invalid path sentiment results.sentiment [Music] now this is where before the creation of this data flow simulator it was tricky for me to kind of figure out where in the data this uh results were stored and how i can access it probably step in per and i would try and figure out where this negative sentiment is but the best way for me to do this now is to hit this copy button here that copies all the uh payload that was input into this choice state then i can launch the data flow simulator kind of emulate what just happened in my step function so along the top here all the different uh states all the different um best word for it stages in the life cycle of my of my state right so i have the input the input path the parameters the task results so that's what the lambda function passes back the result selector and these are all json paths um stages that i can manipulate you know at different stages of my state i'm going to put the input payload in that gets sent to my choice date and i hit next now i'm i want to try and find this uh item this sentiment i can see that it's sentiment results not that payload sentiment now i know confidently that that is exactly what it evaluates to is this correct um field here that's the result of the lambda function that was trying to figure out if the message was negative or positive i think i didn't have the word payload in before because that's something i guess my lambda function is is adding to the output which i hadn't i can copy this i can go back to my step functions uh edit that here and i can go back down to the choice state down here good or bad and i can replace that with what i now know is correct because i've checked it off simulator if i were to run that again we should see a better result right a successful result i think your audio is clipping every now and then ben um my audio yeah might be move your microphone down a bit and like it's missing okay so uh that looks like it worked right and i can see that it detected the sentiment it created a reference number it saved that in dynamodb it realized it was bad and it sent out an email to the administrator and i can i can prove that that's working by putting in something right fill out contact form just to let you know that but just you should go through um the other path oh in fact it hasn't so we've probably not set something here to tell it to go down this path right so we can go into edit this look like that stop at the choice date and go to workflow studio perhaps i didn't set that we're losing your audio every now and then i can see your lips moving but can't hear you saying anything right now is that any better well we can hear you now at least so that's that's better microphone let's ditch this really expensive one okay where were we we're at the point where uh we've checked that our workflow is working we have a choice to stay in we've used workflow studio to to build that out and we've used the json path simulator to figure out why it wasn't working so uh now let's have a look at how we can improve this by using the sdk integration right so i mentioned that one of the things you can do is you can remove some of your lambda functions by using native or by using this new sdk task type so the first thing i'm going to do is show you how i would remove this detect sentiment lambda function and just use an sdk task type right so let's yeah let's just first talk a bit about what this actually means because previously we had direct integrations in step functions so you could easily add specific services into your workflow but if a service didn't have a direct integration as you mentioned we used lambda functions that was the usual way of doing it right and and it's worth saying actually that all of those 40 or so services that have direct integrations they're still there and if what you can do can be if you what you want to do can be achieved using one of them then that's the still the preferred sort of optimized way of doing it so the first place you should look is is it with this optimized integration type so you can see actually this lambda function here there's two ways i can use it i can use the sdk task type or the optimized task type and you can drill into uh you know the differences between them but if there's an optimized one available then it is preferable to use that normally but there there doesn't happen to be a native or optimized integration for amazon comprehend so i'm going to use the sdk type for that right and so i just drag that in i'm going to call it the same thing detect sentiment and this is the big difference so here in the api parameters section is the the fields that this at this particular sdk action requires in order to perform its function right and you can see this maps directly to what i'm doing in my lambda function if i open up my lambda function in a new window and have a look at the code i think this is written in node.js you can see the parameters here i've got the language code and the text and the text is provided by something called event.message so the event is what's invoked my lambda function we know that that's the payload that it receives from the step function the very first step in my step functions so if i go back to my step functions and edit that i can just use the same thing the language code will be en the text is uh dot was it message let me just check that uh yeah message and i need to put a little dollar sign here so that my asl definition knows it's going to grab this from from the workflow payload it's not a constant and then again i'm going to save this to a results object called sentiment results and that's really all i need to do or so we would think right but actually there is another step which we'll get to in just a second i'm also going to delete this step because we don't need that one anymore uh i'm going to apply and exit so what do you think will happen when i run this gunner it's going to fail it is going to fail i'll tell you why it's gonna fail um because let me just run it first i'm gonna put a negative one it's gonna fail because although i've um i've created the sdk integration and i've configured it correctly my step functions workflow does not yet have permissions to run comprehend so it's we've not told it that it's allowed to use amazon comprehend so what we have to do is update this i am role here to allow it to use that it's important to know that step functions does not automatically grant that permissions to your workflow because you know security first and all that so i'll jump into the uh the i am role i'm just going to add it as an inline policy what was it comprehend and uh what's it called detect sentiment there we go um that's all i need i think give it a name that should be all i need to to let this work now if we run it again uh-oh that failed again that's interesting it's oh it's still not authorized to perform did i not save it perhaps i didn't save it i've got to text sentiment amazon comprehend it that should have worked i believe have a quick look at that check that out execution failed it needs the permission for detect sentiment i did run it again right i think so ah maybe i didn't maybe i just clicked on the wrong one uh there you go so that's now running with the direct sdk integration it's not using a lambda function for that anymore every bit is quick possibly even quicker um and my workflow is running as as we want or so we would think but now you can see here that the the choice state is suffering from some sort of error right so we can have a look in here and it's saying it couldn't find sentiments results payload so this is where again i would use my data flow simulator to see what's happening so i just copy the input here go to data flow simulator paste that in here and i want to find this negative again right so i'm going to go it's what it's dot sentiment results dot sentiment okay so it's removed that object that was uh payload which is what we had before because we're not using a lambda function so that kind of makes sense that must have been something that lander was was adding unbeknownst to us so i can just edit my state machine and this is something that would have taken a lot of time to maybe pinpoint before when you're not able to um to sort of investigate the json parts right without the data flow simulator yeah using trying to do it using logs or just trial trial and error just re-wrote or some sort of online tool or trying to step through and write stuff down really awkward before there you go straight to the end uh oh something interesting happening here we can try and figure out what that is or maybe it's just not got there yet um let's wait for that to run did that run yeah it completely okay just took a few seconds so uh we could go ahead and replace that with an sdk object as well this one's a bit more complicated because there's a lot more parameters involved right so it's a little bit more involved and you'll see what i mean so this is using a sorry go ahead you know yeah just one thing about what we're actually doing here with i think we tend to say that lambda functions should be used for uh transforming data not transporting data and and basically what what we used to do before the sdk integration was just transport data so we used the lambda function basically to do that but now we get rid of those but if you wanted to do some sort of transformation of the data you would still use a lambda function right yeah if you or if you're doing some kind of transformation or some some kind of computation um which is what this one this lambda function is doing here this is um generating a random string based on some sort of randomizer function so that's a reasonable thing to use lambda for there's there are better ways we could do that but it's still you know it's not a terrible use case for this particular workflow um so should we go ahead and replace this with an sdk integration yes go ahead so that would be ses and it's uh actually i'm just going to send email um oh there's lots of different ways to send an email apparently that's funny uh okay so is it this one i want to use yeah so the best way i tend to replace these lambda functions is by actually drilling into the lambda function itself because that's always seems to be the easiest way to see what uh sdk parameters i was using right so this one's got quite a lot in here this is the parameter uh object and what i'm going to do is i'm just going to paste it below here so that's the default object that the step functions console gives me and i'm going to try and map this onto the default object right so it needs a destination and looks like i've used some sort of array so it should work if i just paste that in there there's a two address i can look at that and say okay that wants an email address i'm just going to hard code that in for now okay what else does it need it needs a message body i'll take that from what i pasted from my lander function so that's these all need to be double quoted as well that's the tricky bit okay this bit here data this is what's going to get actually sent out um so i'm going to use that to say let's send out the message message and the subject we can just hard code that and say and then our source what does the source need to be uh the source is just the email the valid email address that's my email address okay and then i should be able to delete all of this and see if that has got a little error what's that error for see if you can help me find the arrow here goona oh it must be [Music] can you see where i've missed a quote or something like that can the chat see yeah help us out something missing [Music] oh it could be move out there that's that that's okay isn't it that's valid body text subject data oh i can't see what's wrong with that can you on line 16 expecting an end oh maybe i'm just missing one of them oh there you go i was missing a bracket okay so that's the parameters i need to set and the other thing i'm going to set is i'm always going to save this to a different place so i'm going to save this to i like to keep the keep adding to the payload on a small workflow like this so as especially as i'm building and then i can see what the data is looking like and now i should be able to just delete this lambda function and i've got my sdk version in there now i'll apply and exit and save that now we know that won't oh the source is required but was missing okay let's go back into the have a little look at what we did wrong with the source uh it's there i wonder if it needs to be i'll put it at the top subject is not supported okay great i think i uh i probably copied too much too quickly from my um subject data tell you what let what we'll do i'm gonna have a look at the one before i messed it up yeah paste that back in this is live demos for folks so oh yeah this is this is what people come to see isn't it yeah someone's struggling to make a demo work that's what i like enjoy watching yeah for sure so in the meantime if you just joined us this is the aws nordics office hours i'm joined by ben smith today to talk about what's new with aws step functions and we've had a look at the workflow studio to begin with and we've also looked at how to replace well start using sdk integrations and in this case replace some lambda functions in our workflow hey we're just going to start again here i'm going to take it back to this yeah we're just gonna start again i reckon i had too many uh brackets and all sorts of stuff going on so we'll go a bit slower what we really need is the message which is body and this bit that's what we really need text it'd be nice if they had a whole uh convert to sdk uh native sdk button wouldn't it that's probably the next thing we should start requesting yeah and the other thing i need is the address in here destination to address so in the meantime if you have any questions just post them in the chat and we'll try to answer those as well let's see how does that look that might be it you know well there's no errors let's see so remember we know that it's not going to add permissions for our step functions automatically so we need to give our step functions uh permission to to run the ses send email command right so i'm going to add another inline policy and i'll just do it through this service here that's ses actions will send email i'm just going to be naughty and say all resources and i promise i'll close it down after the demo of course there's a question in the chat if you're going to be at re invent this year ben yes i am yeah i'll be doing um a couple of talks and uh actually we're making a um a brand new demo in the in the dev lounge at re invent this year called serverless espresso which will be something to demonstrate how to order a coffee online using service technologies and there's a big step functions component of that so we'd love to chat to people about that there are you going guna i am going i also have a few sessions and workshops things like that so awesome i will try out your serverless espresso yeah it's going to be real coffee too it's gone right so that should work maybe we hope so if the demo gods allow oh i got two send emails in i forgot to delete the uh one of them but i'm pretty sure this will work now so there we we've one of them didn't work let's have a quick look at that while we're here we've got time uh how do we jump in headed state machine workforce studio which one didn't work the first one was it yeah yeah because that's the template one where uh try that again well that was quick so um we've built this with workflow studio we've replaced a bunch of lambda functions with some sdk integrations we've used the data flow simulator to kind of check out uh why our paths were were mismatching and going wrong uh it's probably a similar error here oh that's a weird one then i spelt amazon wrong that's why that didn't work so it's to have a valid email address to send out from and i sent out from amazon so that's completely on me for mistaking that i'll just quickly edit that just so we know that it's working okay so like you were saying earlier that at what point do you kind of switch out from the console and go into your your local infrastructure as code template and that's that's the new dilemma i did workflow studio is you can go so far with it and you can keep going with it but at some point you probably you probably will want to start using some kind of infrastructure as code template to to continue building out your application right um and that's what i'm going to show you next this is the point where i would switch back into my local ide and we'll see some interesting uh tools to help you do that so here's my local id this is this code visual studio or visual studio code something like that i forget what exactly the name is but this is what i use to build serverless applications this is my sam template remember my uh i said sam serverless application model it's a template for building serverless application using infrastructure as code it's kind of an abstraction on top of cloud formation if you like and in this sam template i defined the various lander functions the different i am roles i defined an api gateway resource which invokes my lambda function and i and i define my sorry an api gateway resource which invokes my step functions workflow and i also define the step functions workflow here now i'm going to build this now as a synchronous express workflow this is a different type of workflow which was launched about a year ago at last year's reinvent and this allows you to um to run a workflow synchronously so you can get the response so what that means is i can send an http rest call via api gateway to my api gateway endpoint that will invoke my step functions workflow and wait for that workflow to finish before returning the response back on the http response object so that's great for doing things like websites or what we're doing here which is posting a contact form so here's my sam template in a separate file i have my asl definition of my workflow and at the moment this all this has is a a simple pass state in there so this is ready to go there's a new feature of aws sound which is in preview called sam accelerate and one of the things that sound accelerate has is a new a new command called sam seek and sam sync the first time you run it it deploys your entire application stack to an aws account if you also add this watch flag to it what it does is it runs a background process which watches for any changes in your application and automatically deploys that to the cloud in the background okay and what it does as well is that it distinguishes between changes in infrastructure and your sound template infrastructure it distinguishes between that and changes in code now changes in code can be anything from a lambda function to an open api definition for api gateway it can be an asl definition and it will detect changes in in that code and use aws api to automatically upload that directly to your account rather than running the cloud formation transform and deploy process so what that means is it's much quicker it takes a second or two to save code and in effect i'm able to code on my local machine i can press ctrl save or command save and before i switch to my terminal to view the output it's already synced back with the cloud right um and then those infrastructure changes it's it still watches for them and still automatically deploys them but then they tend to be much less often right because you know as you're developing your kind of inner loop is all based on on code and um and testing code quickly in a fast cycle so the best way to test your code in the cloud is to test it in the cloud right so that's what this whole kind of uh new feature of sam is is really useful for is synchronizing your local stack with a cloud developer environment important to know that you shouldn't do that with your production environment this is just while you're building out your application okay so all that to say i'm going to run this sam sync command now with the watch flag and that will upload this application which is just a simple pass state a very tiny workflow what i'm then going to do while that's uploading and deploying is i'm going to come back into my um my workflow that we've been building out and i'm going to edit i'm going to go to workflow studio and i will look at this definition and here's the asl definition and i'm just going to copy all of that using that button there and uh this back to my ide this the infrastructure sync is complete so now whenever i save code it will automatically redeploy right i'm going to copy this asl definition here now something really cool that i haven't actually mentioned is this is used using the aws um plug-in for this code and it has a special feature for step functions which lets you automatically view your step functions in your ide as you build and it also kind of auto fills as you build in asl as well so that's a really handy tool to use as soon as i save this by pressing ctrl s you can see look it's automatic automatically and very quickly uploaded that entire step functions workflow to the cloud so let's sync that straight away and i can prove that it synced that by um we can edit something right so let's say we we want to save to our dynamodb table the um the id of the user and the message that the user has uh left and that's what it's been saving so far and we can see that here if we go to our dynamodb table and i look at the items it's saving the the user id and the message nothing in this column so let's change that let's save something in the sentiment column so i'm going to edit this locally now i'm going to say it's going to be a string and it's going to be what was it sentiment results dot sentiment if i remember correctly i can't remember if that was a capital s or not though uh let's have a quick look down here yes that let's save that in our dynamodb table and i should just press ctrl s save that will watch this down here you can see it says it's finished syncing and now if i come to my step functions workflow and run again uh let's let's come out here come out here and come out here and it's this one here so it's uploaded this as an express workflow different workflow type remember i'm going to start an execution give it a payload and now i should be able to go to dynamodb and you can see there is this one has a the sentiment's also been saved there as negative so the final thing to do here to you know complete this as a full application would be to plug this into a front-end uh form right so there's lots of different ways you can do this by the way but the way i've been i like to use oh that's that's the wrong idea let's go back to this code and if we look up here when i first ran this deployment this synchronization command it gave me some outputs one of the outputs it gives me is my http api invocation um and then i'm going to switch over to some other code now which is a front end for a web form okay i'll show you what the web form looks like it looks like this super simple uh i'm going to zoom out a little bit and this is the code that defines that web form and here is in that web form where i'm going to put what http url to post to and the other thing i need to give it is the um the step functions arn which is this so i'm going to paste that into my form code happens to be the same arn and i'll save that and now this might not work because of the demos but we'll see what happens so this this should be the complete application right this is me filling out a real contact form and saying my edge i fully expect this not to work by the way we'll see what happens oh it worked cool so that's realized that oh no sorry to hear you had a bad experience it realized it was a negative comment right if i were to say uh i love this contact form then we should see a different sort of response yay no negative experience green light and it again because it's a synchronous express workflow it's waited for our workflow to finish running it's grabbed the um the id here and returned that to me under the rest call in the response object so i'm able to use that in my web um in my web form and that's a demo and that's pretty quick yeah it is workflows are actually really quick there's a few drawbacks compared to standard workflows one is that they don't run for as long so a standard workflow can run for up to one year whereas express workflow can only run for five minutes and another key difference is the the console experience so with express workflows you can't kind of step through each step of the payload if you like you still have cloud watch logs but it's not quite as easy to debug which is why i started building this out with a standard workflow and then switched to an express workflow once we were happy that it was working more or less that's cool yeah are there are there any differences in in how the steps work in regards to express or standard or can you always do it build it out that way as you just mentioned yeah there's no difference in how the step works uh it's more in terms of like this the speed or the rate of transitions from through the steps it's much quicker with express workflows and they're also a lot cheaper as well or a lot more uh cost efficient i suppose it's the correct way but uh no there's no difference in terms of the different controls or the different configuration of the workflow at all that's cool so uh sam accelerate them yeah you you ran the sync command are you able to start that way or do you have to do a deploy first or does sync take care of the the initial deployment as well yeah sync does take care of the initial deployment so um this is the first time i'm running it right i guess you won't be able to see that initial deployment because we've i already deployed it um but oh no here you go you can see it so essentially this is what would happen if i had never built this application before it would attempt to uh to deploy it the first time and then it will say okay your application's now in sync and because i use the dash dash watch flag it's running that background process to check if i'm saving any files in the background that's right i think this is really cool uh i think 50 of my development time is is waiting for deployments otherwise um that's my style of writing code frequent deployments testing things out so yeah i think sync is is really cool i totally agree there's a few little nuances to know when you're using this with step functions actually the first is that if you're using definition substitutions like this so you might define something in your sound template and then pass that to your asl definition using a definition substitution now if you use that that's that's a great way of building out uh step functions actually but sam accelerate being that it's still in preview it then will treat your workflow um updates as an infrastructure update and not code update and it will take longer to update because it needs to kind of reference back to the infrastructure part so that's something the team are looking at ways that they can improve that experience but it's something that caught me out when i started uh using this i i didn't expect that just something to be aware of so so not when you're making changes of those it's as long as you have those included it will treat it as an infrastructure update as of now yes so that's so you see i have these commented out so um so it it if even if i had this uncommented and i saved it i think it uh it might not even okay so i have them uncommented now whenever i were to save my asl definition in a moment it will say oh uh you have to run this manually because you're using definition substitutions right it's because i've defined that here so that's something that i know the step functions team are looking to kind of improve but because i had that commented out and i pasted in directly from a workflow studio that's not a problem that we hit here and what about um the build the face of sam build when well whatever code you're writing and you usually do have a build step is that affected in any way and does it just do that step as part of the single process uh it does do that step as part of the sync process yes and it also distinguishes between your co-dependencies um it does it like an incremental build so they kind of redefined that build process for using sam sync and the incremental build for sam is something that was introduced a couple months back but it's automatically what's used um when you use the the sync command right so there's a few minutes left if you have any questions for ben about step functions or serverless in general do post them in the chat i think this was a very cool demo you you showed us ben of how to to make use of some of these new features with step functions and with aws sam uh and i'm as i mentioned early on i'm a huge fan of both workload workflow studio and of sdk integrations it's right it's a great way to to actually well first off build your workflows but then also be more efficient have less less moving parts in your workflows as well yeah i mean the the more the more you can reduce code the the more the less you have to maintain the less you have uh dependencies on other other parts of your application right so generally reducing code is normally a good thing so that's why this is such a cool release and i think they went from something like 200 api actions to 9000 now so like the the possibilities are really interesting and what happens when there are new api actions do they automatically become available in step functions now i believe so i believe there's like a internal api actions table which everything feeds into which the step functions uh sort of looks at and generates from um so i think ongoing that that is the idea yeah that's very cool manifest that's the word yeah no that's very cool yeah it might mean that certain things are available quicker through step functions than through cloud formation for instance um so yeah that's very cool right any questions to ben before we wrap things up i think i think not for now but yeah very cool then i i think it was a really cool demo and thanks for joining us today no there is actually here we go so here's a question for you would it be possible to organize a workshop for step functions are there any are there any workshops available right now that make use of some of these new these new features absolutely there are yes so if you hang on let me find the link for you this is something if anyone's going to reinvent which we'll be running let me find this it's called image processing uh workshop and we recently we recently re did it to include some of these new features so it should be yeah here it is uh you paste this into the chat here how can i paste this into the chat you know uh you can paste it in the private chat and i can share it with the viewers yeah yeah so this this takes you through it's i think a five-part module takes you through all sorts of um different uh parts of the step functions uh interface and it's a really good way to sort of start using aws step functions we do run this at various events we're running it at re invent this year that's a great one to get started with for sure that's cool all right i pasted a link in the chat so do check that one out and with that well thanks again ben for joining us um as you mentioned early on we've pushed this a few times to be able to include more and more uh releases and features and right glad to finally have you join me for this and thanks to all the viewers for joining us today as well and thanks for your questions and comments and with that well thank you all and i hope to see you again next week on the aws nordics office hours bye bye you
Info
Channel: Gunnar Grosch
Views: 59
Rating: undefined out of 5
Keywords:
Id: QFqSFAOnQZE
Channel Id: undefined
Length: 56min 38sec (3398 seconds)
Published: Mon Oct 18 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.