Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.06 KB

README.md

File metadata and controls

57 lines (39 loc) · 1.06 KB

CDK Workshop

This project is based on the AWS CDK workshop available at AWS CDK Workshop.

Setup

  1. Install dependencies:

    pnpm install
  2. Configure AWS CLI:

    aws configure
  3. Build the project:

    pnpm build

Deployment

  1. Bootstrap the environment (if not already done):

    pnpm bootstrap
  2. Deploy the stack:

    pnpm deploy

    This command will build the project and deploy the stack to your AWS account.

Lambda Function

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`,
  };
};