[{"data":1,"prerenderedAt":66},["ShallowReactive",2],{"pattern-lambda-sfn-terraform":3},{"id":4,"title":5,"architectureURL":6,"cleanup":7,"contributors":12,"deploy":14,"description":18,"extension":19,"framework":20,"gitHub":21,"highlight":6,"introBox":31,"language":35,"level":36,"meta":37,"patternArch":38,"resources":52,"s3URL":6,"services":6,"stem":61,"testing":62,"videoId":6,"__hash__":65},"patterns\u002Fpatterns\u002Flambda-sfn-terraform.json","AWS Lambda to AWS Step Functions",null,{"headline":8,"text":9},"Cleanup",[10,11],"1. Delete the stack: \u003Ccode>terraform destroy\u003C\u002Fcode>.","2. Confirm the stack has been deleted: \u003Ccode>terraform show\u003C\u002Fcode>",[13],"content\u002Fcontributors\u002Fahmad-aboushady.json",{"text":15},[16,17],"terraform init","terraform apply","Invoke an AWS Step Functions workflow from AWS Lambda, with logging enabled","json","Terraform",{"template":22,"payloads":27},{"projectFolder":23,"repoURL":24,"templateURL":25,"templateFile":26},"lambda-sfn-terraform","https:\u002F\u002Fgithub.com\u002Faws-samples\u002Fserverless-patterns\u002Ftree\u002Fmain\u002Flambda-sfn-terraform","serverless-patterns\u002Flambda-sfn-terraform","main.tf",[28],{"headline":29,"payloadURL":30},"Sample Lambda payload","lambda-sfn\u002Fevents\u002FinputFile.txt",{"headline":32,"text":33},"How it works",[34],"The Terraform template deploys a Lambda function, and a Step Functions workflow, a Log group and the IAM resources required to run the application. A Lambda function uses the AWS SDK to asyncronously invoke the Step Functionsworkflow, passing the event body. The Express Workflow results are logged in Amazon CloudWatch Logs. The Lambda function returns the response from the Step Functionsincluding the execution ARN and start date.","Python","300",{},{"icon1":39,"icon2":44,"line1":48},{"x":40,"y":41,"service":42,"label":43},20,50,"lambda","AWS Lambda",{"x":45,"y":41,"service":46,"label":47},80,"sfn","Step Functions",{"from":49,"to":50,"label":51},"icon1","icon2","",{"headline":53,"bullets":54},"Additional resources",[55,58],{"text":56,"link":57},"Tutorial: Using AWS Lambda with Amazon S3","https:\u002F\u002Fdocs.aws.amazon.com\u002Flambda\u002Flatest\u002Fdg\u002Fwith-s3-example.html",{"text":59,"link":60},"Blog Series: Building scalable serverless applications with Amazon S3 and AWS Lambda.","https:\u002F\u002Faws.amazon.com\u002Fblogs\u002Fcompute\u002Fbuilding-scalable-serverless-applications-with-amazon-s3-and-aws-lambda\u002F","patterns\u002Flambda-sfn-terraform",{"text":63},[64],"See the README in the GitHub repo for detailed testing instructions.","O0WwUZTH3O360VabuOx65Tgq-vSx0gDRMNrecGj0P7g",1782297327220]