This project is based on the AWS CDK workshop available at AWS CDK Workshop.
-
Install dependencies:
pnpm install
-
Configure AWS CLI:
aws configure
-
Build the project:
pnpm build
-
Bootstrap the environment (if not already done):
pnpm bootstrap
-
Deploy the stack:
pnpm deploy
This command will build the project and deploy the stack to your AWS account.
The Lambda function is defined in index.ts:
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";
export const handler = async (
event: APIGatewayProxyEvent,
): Promise<APIGatewayProxyResult> => {
return {
statusCode: 200,
headers: { "Content-Type": "text/plain" },
body: `Hello, CDK! You've hit ${event.path}\n`,
};
};