[{"data":1,"prerenderedAt":50},["ShallowReactive",2],{"workflow-step-functions-lambda-version-cleanup":3},{"id":4,"title":5,"cleanup":6,"contributors":10,"deploy":12,"description":16,"diagram":17,"extension":18,"framework":19,"gitHub":20,"introBox":27,"level":31,"meta":32,"resources":33,"s3URL":36,"services":37,"simplicity":40,"stem":41,"testing":42,"type":46,"usecase":47,"videoId":48,"__hash__":49},"workflows\u002Fworkflows\u002Fstep-functions-lambda-version-cleanup.json","Lambda Version Cleanup",{"headline":7,"text":8},"Cleanup",[9],"1. Delete the stack: \u003Ccode>terraform destroy\u003C\u002Fcode>.",[11],"content\u002Fcontributors\u002Fmaureen-plank.json",{"text":13},[14,15],"terraform init","terraform apply -var='lambda_function_filter_prefix= '","This workflow demonstrates how to manage and cleanup the number of available versions of an AWS Lambda function.","\u002Fassets\u002Fimages\u002Fworkflows\u002Fstep-functions-lambda-version-cleanup.png","json","Terraform",{"template":21,"payloads":26},{"repoURL":22,"templateDir":23,"templateFile":24,"ASL":25},"https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fstep-functions-workflows-collection\u002Ftree\u002Fmain\u002Fstep-functions-lambda-version-cleanup\u002F","step-functions-lambda-version-cleanup","\u002Fmain.tf","statemachine\u002Fstatemachine.asl.json",[],{"headline":28,"text":29},"How it works",[30],"The workflow utilizes the `ListFunctions`, `ListVersionsByFunction`, and `DeleteFunction` SDK calls to determine which functions should be processed, understand the available number of versions, and reduce them to a specified amount. It considers Lambda aliases and offers the possibility to filter functions and specify how many versions to keep available, starting from the most recent one. An accompanying EventBridge scheduler can trigger this workflow regularly, automating Lambda version cleanup.","300",{},{"headline":34,"bullets":35},"Additional resources",[],null,[38,39],"lambda","eventbridge","3 - Application","workflows\u002Fstep-functions-lambda-version-cleanup",{"headline":43,"text":44},"Testing",[45],"See the GitHub repository for detailed testing instructions.","Standard","Automation","","Nk1pSi2NrIAyZemd7x_0N4p2wNq-FzGnSht_1UMpI-g",1779186915007]