Skip to content

kilee1230/cdk-workshop-lambda

Repository files navigation

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

About

To learn how to use AWS CDK for add lambda resource

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published