Skip to content

Elisabeth-Team/cdk-code

Repository files navigation

Three-Tier Serverless Application

A simple three-tier serverless web application built with AWS CDK and TypeScript.

Architecture

  • Web Tier: API Gateway
  • App Tier: AWS Lambda functions (Node.js 18)
  • Database Tier: DynamoDB

This serverless architecture requires no VPC, no Docker builds, and no container orchestration.

Project Structure

lib/
  components/
    deployed-application.ts      # Main application construct
    subcomponents/
      app-tier.ts                # Lambda functions
      web-tier.ts                # API Gateway
      database-tier.ts           # DynamoDB table
app/
  lambda-handler.js              # Lambda function code
  package.json                   # Lambda dependencies

Deployment

npm install
npm run build
npx cdk deploy

After deployment, the API Gateway URL will be output to the console.

Useful Commands

  • npm run build compile typescript to js
  • npm run watch watch for changes and compile
  • npx cdk deploy deploy this stack to your default AWS account/region
  • npx cdk diff compare deployed stack with current state
  • npx cdk synth emits the synthesized CloudFormation template
  • npx cdk destroy remove all resources from AWS

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors