Using AWS SAM CLI, we can call any Lambda Function in our service with parameters depending on what we want to do. Let’s try to run these commands one by one to understand what we can do with applications or user data.
Below, we are using the AWS CLI, via aws lambda invoke, to directly call a deployed AWS Lambda Function with the desired content. We haven’t started using AWS Step Functions yet. Here, we’re just testing the Lambda Functions that we’ll start organizing into a workflow using StepFunctions in this workshop.
aws lambda invoke --function-name sfn-workshop-SubmitApplication --payload '{ "name": "Spock", "address": "123 Enterprise Street" }' /dev/stdout
aws lambda invoke --function-name sfn-workshop-FlagApplication --payload '{ "id": "REPLACE_WITH_ID", "flagType": "REVIEW" }' /dev/stdout
aws lambda invoke --function-name sfn-workshop-FlagApplication --payload '{ "id": "application_869a2256-fe54-4731-9522-4cbbc1a184ad", "flagType": "REVIEW" }' /dev/stdout
aws lambda invoke --function-name sfn-workshop-FindApplications --payload '{ "state": "FLAGGED_FOR_REVIEW" }' /dev/stdout
aws lambda invoke --function-name sfn-workshop-ApproveApplication --payload '{ "id": "REPLACE_WITH_ID" }' /dev/stdout
aws lambda invoke --function-name sfn-workshop-ApproveApplication --payload '{ "id": "application_869a2256-fe54-4731-9522-4cbbc1a184ad" }' /dev/stdout