Setup Permission, Function, and State Machine
Learn to set up permission for S3, function, and state machine for the packaging step.
We'll cover the following...
Now, because we have the Lambda function, we can set up permission for S3, set up the Lambda function, and adjust the state machine so we have our packaging step up and running.
First, open the serverless.yml
file below:
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
Permission
First, within ...