Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kilee1230/cdk-workshop-lambda
To learn how to use cdk for add lambda resource
https://github.com/kilee1230/cdk-workshop-lambda
Last synced: about 2 months ago
JSON representation
To learn how to use cdk for add lambda resource
- Host: GitHub
- URL: https://github.com/kilee1230/cdk-workshop-lambda
- Owner: kilee1230
- Created: 2024-12-05T10:58:58.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-12-06T01:08:17.000Z (about 2 months ago)
- Last Synced: 2024-12-06T01:28:31.422Z (about 2 months ago)
- Language: TypeScript
- Homepage:
- Size: 39.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CDK Workshop
This project is based on the AWS CDK workshop available at [AWS CDK Workshop](https://catalog.us-east-1.prod.workshops.aws/workshops/10141411-0192-4021-afa8-2436f3c66bd8/en-US/100-getting-started).
## Setup
1. **Install dependencies:**
```sh
pnpm install
```2. **Configure AWS CLI:**
```sh
aws configure
```3. **Build the project:**
```sh
pnpm build
```## Deployment
1. **Bootstrap the environment (if not already done):**
```sh
pnpm bootstrap
```2. **Deploy the stack:**
```sh
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](http://_vscodecontentref_/4):
```typescript
import { APIGatewayProxyEvent, APIGatewayProxyResult } from "aws-lambda";export const handler = async (
event: APIGatewayProxyEvent,
): Promise => {
return {
statusCode: 200,
headers: { "Content-Type": "text/plain" },
body: `Hello, CDK! You've hit ${event.path}\n`,
};
};
```