Testing
Explore how to test your AWS Step Functions workflow after deployment using command line tools and the AWS console. Understand how to track the state machine's progress and confirm data packaging output in S3. Learn troubleshooting tips for common issues like missing ingredients errors and database replenishment.
We'll cover the following...
We'll cover the following...
Now that we have everything prepared, we can test our flow. If you didn’t deploy the project in the previous lesson, do it now:
import {
APIGatewayProxyEvent,
APIGatewayProxyHandler,
APIGatewayProxyResult,
} from "aws-lambda";
import { validate as uuidValidate } from "uuid";
export const handler: APIGatewayProxyHandler = async (
event: APIGatewayProxyEvent
): Promise<APIGatewayProxyResult> => {
const batchId = event.body?.batchId;
if (batchId && uuidValidate(batchId)) {
return { validApiQualityCheck: true };
} else {
throw new Error("Quality check failed: invalid batch ID");
}
};
Project
To deploy the project, we can use sls deploy.