<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Taranjeet</title>
    <description>The latest articles on DEV Community by Taranjeet (@taranjeetsingh).</description>
    <link>https://dev.to/taranjeetsingh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1318750%2F8cc0a919-75c2-493d-a5cd-3800ce6148fb.JPG</url>
      <title>DEV Community: Taranjeet</title>
      <link>https://dev.to/taranjeetsingh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/taranjeetsingh"/>
    <language>en</language>
    <item>
      <title>Deploy Next JS App to AWS Lambda using AWS SAM</title>
      <dc:creator>Taranjeet</dc:creator>
      <pubDate>Sat, 09 Mar 2024 01:28:45 +0000</pubDate>
      <link>https://dev.to/taranjeetsingh/deploy-next-js-app-to-aws-lambda-using-aws-sam-5ael</link>
      <guid>https://dev.to/taranjeetsingh/deploy-next-js-app-to-aws-lambda-using-aws-sam-5ael</guid>
      <description>&lt;p&gt;Here I will be documenting how to deploy your nextJs application to AWS lambda. We will be building cloudformation stack using AWS SAM.&lt;br&gt;
All code can be found in GitHub repository and it will be maintained and updated as per time: &lt;a href="https://github.com/singh-taranjeet/next-aws-lambda" rel="noopener noreferrer"&gt;github-repository&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So follow the steps as following:&lt;/p&gt;
&lt;h3&gt;
  
  
  Initialise the NextJS application
&lt;/h3&gt;

&lt;p&gt;Create directory named &lt;code&gt;app&lt;/code&gt; where nextJS application will be installed.&lt;/p&gt;

&lt;p&gt;Run following command to install next js application&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-next-app@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fndgclevr1xka8g5eurck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fndgclevr1xka8g5eurck.png" alt="next app installation" width="800" height="437"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Initialise the AWS SAM
&lt;/h3&gt;

&lt;p&gt;Now we will be using code as infrastructure to build our cloudformation stack. So initialise the sam application using the following the guide as per your Operating system &lt;a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html" rel="noopener noreferrer"&gt;aws-docs&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure NextJS application
&lt;/h2&gt;

&lt;p&gt;We need to export the application as standalone to deploy on lambda as a node server.&lt;/p&gt;

&lt;p&gt;So in the next.config.js file add following code to deploy app on lambda:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/** @type {import('next').NextConfig} */
const nextConfig = {
  output: "standalone",
};

export default nextConfig;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we need to create a script to start our node js server.&lt;br&gt;
So create a new file named &lt;code&gt;run.sh&lt;/code&gt; in root of &lt;code&gt;app&lt;/code&gt; directory and add following commands to run the server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash -x

[ ! -d '/tmp/cache' ] &amp;amp;&amp;amp; mkdir -p /tmp/cache

exec node server.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we need to configure docker image to which will be used by our lambda function.&lt;br&gt;
So create a &lt;code&gt;Dockerfile&lt;/code&gt; in root of &lt;code&gt;app&lt;/code&gt; directory. Add following code to the &lt;code&gt;Dockerfile&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM public.ecr.aws/docker/library/node:20.9.0-slim AS builder
WORKDIR /app
COPY . .
# declare the sharp path to be /tmp/node_modules/sharp
ENV NEXT_SHARP_PATH=/tmp/node_modules/sharp
# install the dependencies and build the app
RUN npm ci &amp;amp;&amp;amp; npm run build

FROM public.ecr.aws/docker/library/node:20.9.0-slim AS runner
# install aws-lambda-adapter
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.7.2 /lambda-adapter /opt/extensions/lambda-adapter
# expose port 3000 and set env variables
ENV PORT=3000 NODE_ENV=production
ENV AWS_LWA_ENABLE_COMPRESSION=true
WORKDIR /app

# copy static files and images from build
COPY --from=builder /app/public ./public
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/run.sh ./run.sh
RUN ln -s /tmp/cache ./.next/cache

# configure the run command to start the server
RUN ["chmod", "+x", "./run.sh"]
CMD exec ./run.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above docker file we are using &lt;code&gt;aws-lambda-adapter&lt;/code&gt;. It is a tool to run web applications on AWS Lambda.&lt;/p&gt;

&lt;p&gt;AWS Lambda Web Adapter allows developers to build web apps (http api) with familiar frameworks (e.g. Express.js, Next.js, Flask, SpringBoot, ASP.NET and Laravel, anything speaks HTTP 1.1/1.0) and run it on AWS Lambda. The same docker image can run on AWS Lambda, Amazon EC2, AWS Fargate, and local computers.&lt;/p&gt;

&lt;h1&gt;
  
  
  Configure SAM template
&lt;/h1&gt;

&lt;p&gt;Now create a new file in the root of the application and outside the app directory.&lt;br&gt;
&lt;code&gt;template.yaml&lt;/code&gt;&lt;br&gt;
Add following code to the &lt;code&gt;template.yaml&lt;/code&gt; to configure AWS Lambda and AWS Api Gateway.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: &amp;gt;
  serverless app to deploy next app to aws lambda

Globals:
  Function:
    Timeout: 30

Resources:
  NextAppStackFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: app/
      PackageType: Image
      Architectures:
        - x86_64
      Events:
        HttpEvent:
          Type: HttpApi
    Metadata:
      DockerTag: v1
      DockerContext: ./app
      Dockerfile: Dockerfile
Outputs:
  NextAppStackUrl:
    Description: "API Gateway endpoint URL for servering the next app"
    Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.${AWS::URLSuffix}/"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure docker is running on your machine.&lt;/p&gt;

&lt;p&gt;Now we need to build sam application using following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sam build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After building the sam application, we can deploy the application on cloudformation stack using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sam deploy --guided
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fto8fzedlgpghk6gjwizx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fto8fzedlgpghk6gjwizx.png" alt="Sam deploy --guided" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After successfully deploying the output will look like following with the hosted url.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjyl3tilxfjxd7ojw0a4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyjyl3tilxfjxd7ojw0a4.png" alt="deploy output" width="800" height="496"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>lambda</category>
      <category>apigateway</category>
      <category>aws</category>
    </item>
    <item>
      <title>Deploy nest app to AWS Lambda using cloud-formation stack and AWS CDK</title>
      <dc:creator>Taranjeet</dc:creator>
      <pubDate>Sat, 02 Mar 2024 05:58:55 +0000</pubDate>
      <link>https://dev.to/taranjeetsingh/deploy-nest-app-to-aws-lambda-using-cloud-formation-stack-and-aws-cdk-25gb</link>
      <guid>https://dev.to/taranjeetsingh/deploy-nest-app-to-aws-lambda-using-cloud-formation-stack-and-aws-cdk-25gb</guid>
      <description>&lt;p&gt;Here I will be documenting how to deploy your nest application to AWS lambda. We will be building cloudformation stack using AWS cdk.&lt;br&gt;
All code can be found in GitHub repository and it will be maintained and updated as per time: &lt;a href="https://github.com/singh-taranjeet/nest-aws-lambda" rel="noopener noreferrer"&gt;github-repository&lt;/a&gt;&lt;br&gt;
So follow the steps as following: &lt;/p&gt;
&lt;h2&gt;
  
  
  Create seperate directories for nest and cdk applicaiton.
&lt;/h2&gt;

&lt;p&gt;Create seperate directories to hold nestJS application and CDK application.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;app&lt;/em&gt;&lt;/strong&gt; directory for nestJS application&lt;br&gt;
&lt;strong&gt;&lt;em&gt;cdk&lt;/em&gt;&lt;/strong&gt; directory for building cloudformation stack&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zjc430qxfgtx4dv1sgw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zjc430qxfgtx4dv1sgw.png" alt="app and cdk directories" width="682" height="360"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Setup nestjs application
&lt;/h2&gt;

&lt;p&gt;Now change directory to &lt;strong&gt;app&lt;/strong&gt; and install nestjs cli and setup the application in app directory as shown below:&lt;/p&gt;

&lt;p&gt;You can follow setup details on nestJS docs &lt;a href="https://docs.nestjs.com/first-steps" rel="noopener noreferrer"&gt;here&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i -g @nestjs/cli
nest new nests-aws-lambda
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;check if the application is running by running following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm run start:dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Note:
&lt;/h3&gt;

&lt;p&gt;Please make sure you install &lt;code&gt;class-transformer&lt;/code&gt; and &lt;code&gt;class-validator&lt;/code&gt; if you get errors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initialise the CDK application
&lt;/h2&gt;

&lt;p&gt;If you have not install aws-cdk already install by following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g aws-cdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we will be using code as infrastructure to build our cloudformation stack. So initialise the cdk application in &lt;strong&gt;cdk&lt;/strong&gt; directory using following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cdk init --language typescript
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;cdk init&lt;/code&gt; command will create some important files in the application as shown below:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cdk/lib/cdk-stack.ts&lt;/code&gt; Main entry point for the application&lt;br&gt;
&lt;code&gt;cdk/bin/cdk.ts&lt;/code&gt; Defines the service stack&lt;/p&gt;

&lt;p&gt;To check if everything is fine run the following command to check if application is able to create a cloudformation template from our code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cdk synth
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should be able to see output on the screen as below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Resources:
  CDKMetadata:
    Type: AWS::CDK::Metadata
    Properties:
      ...

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create lambda handler for nestjs application
&lt;/h2&gt;

&lt;p&gt;The major part of this deployment is creating a lambda handler function which will start our nest application.&lt;/p&gt;

&lt;p&gt;To do that we need to install &lt;code&gt;@vendia/serverless-express&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i --save @vendia/serverless-express
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We will be using &lt;code&gt;@vendia/serverless-express&lt;/code&gt; to create a serverless express application. You can read more about &lt;code&gt;@codegenie/serverless-express&lt;/code&gt; &lt;a href="https://www.npmjs.com/package/@vendia/serverless-express" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;create a new file &lt;code&gt;lambda.bootstrap.ts&lt;/code&gt; in root of src directory. (app/src/bootstrap.lambda.ts)&lt;/p&gt;

&lt;p&gt;Paste the following content in the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { NestFactory } from '@nestjs/core';
import * as express from 'express';
import * as serverlessExpress from '@codegenie/serverless-express';
import { ExpressAdapter } from '@nestjs/platform-express';
import { INestApplication } from '@nestjs/common';
import { AppModule } from './app.module';

let cachedServer: any;

export const bootstrapLambda = async (
  attachPipes: (app: INestApplication&amp;lt;any&amp;gt;) =&amp;gt; void,
) =&amp;gt; {
  if (!cachedServer) {
    // create an express app
    const expressApp = express();

    // create an express adapter to work with nest applicaiton
    const expressAdapter = new ExpressAdapter(expressApp);

    // create a nest app using the express adapter
    const nestApp = await NestFactory.create(AppModule, expressAdapter);
    nestApp.enableCors();

    // configure nest application
    attachPipes(nestApp);

    // wait for the nest to initialise
    await nestApp.init();

    // create a serverless server using serverless express
    cachedServer = serverlessExpress.configure({ app: expressApp });

    return cachedServer;
  }

  return cachedServer;
};


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now update file called &lt;code&gt;main.ts&lt;/code&gt; with following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { INestApplication, ValidationPipe } from '@nestjs/common';
import { bootstrapLambda } from './lambda.bootstrap';

function attachPipes(app: INestApplication&amp;lt;any&amp;gt;) {
  app.useGlobalPipes(
    new ValidationPipe({
      whitelist: true,
      transform: true,
      forbidNonWhitelisted: true,
    }),
  );
  app.enableCors();
}

if (process.env.NODE_ENV === 'local') {
  async function bootstrap() {
    const app = await NestFactory.create(AppModule);
    attachPipes(app);
    await app.listen(3000);
  }

  bootstrap();
}

const handler = async (event: any, context: any, callback: any) =&amp;gt; {
  console.log('Event', event);
  const server = await bootstrapLambda(attachPipes);
  return server(event, context, callback);
};

module.exports.handler = handler;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create a Docker file for lambda function
&lt;/h2&gt;

&lt;p&gt;Since size of our application will be much more than the lambda function limit. We will be creating docker image as code of the lambda function.&lt;/p&gt;

&lt;p&gt;create a docker file in the root of app directory with following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FROM amazon/aws-lambda-nodejs

COPY . .
RUN npm install
RUN npm run build

CMD ["dist/main.handler"]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now our nestjs application configuration is complete.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create cloudformation template using AWS CDK
&lt;/h2&gt;

&lt;p&gt;ow change directory to &lt;code&gt;cdk/lib/cdk-stack.ts&lt;/code&gt; and add following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import * as cdk from "aws-cdk-lib";
import { LambdaIntegration, RestApi } from "aws-cdk-lib/aws-apigateway";
import { DockerImageCode, DockerImageFunction } from "aws-cdk-lib/aws-lambda";
import { Construct } from "constructs";
import * as logs from "aws-cdk-lib/aws-logs";
import path = require("path");

export class CdkStack extends cdk.Stack {
  constructor(scope: Construct, id: string, props?: cdk.StackProps) {
    super(scope, id, props);

    // Create a new lambda function
    const LambdaHandler = new DockerImageFunction(this, "LambdaHandler", {
      timeout: cdk.Duration.seconds(30),
      functionName: "LambdaHandler",
      code: DockerImageCode.fromImageAsset(path.join(__dirname, "../../app")),
    });

    // Create a new Log Group and Log Stream for the Lambda function
    new logs.LogGroup(this, "LambdaHandlerLogGroup", {
      logGroupName: `/aws/lambda/${LambdaHandler.functionName}`,
      retention: logs.RetentionDays.ONE_WEEK,
    });

    // Create a new api gateway
    const api = new RestApi(this, "ApiRest", {
      restApiName: "ApiRest",
      deploy: true,
      defaultMethodOptions: {
        apiKeyRequired: true,
      },
    });

    // add proxy resource to handle all api requests
    api.root.addProxy({
      defaultIntegration: new LambdaIntegration(LambdaHandler, {
        proxy: true,
      }),
    });

    // If you need to use api key and usage plan un-comment the following code:
    /*const apiKey = api.addApiKey("ApiKey");
    const usagePlan = api.addUsagePlan("ApiUsagePlan", {
      name: "ApiUsagePlan",
      apiStages: [
        {
          api,
          stage: api.deploymentStage,
        },
      ],
    });


    usagePlan.addApiKey(apiKey);


    new cdk.CfnOutput(this, "api-key", {
      value: apiKey.keyId,
      exportName: `some-unique-name-api-key`,
    });
    */
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Deploy application to AWS
&lt;/h2&gt;

&lt;p&gt;Install aws cli using following documentation as per you operating system &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mac OS users can download GUI installer from following &lt;a href="https://awscli.amazonaws.com/AWSCLIV2.pkg" rel="noopener noreferrer"&gt;link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installing aws-cli configure AWS CLI using following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure your docker application is running and change directory to &lt;strong&gt;cdk&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;cdk synth&lt;/code&gt; to check if the cdk code is working.&lt;/p&gt;

&lt;p&gt;To deploy application simple run following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cdk deploy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>cloudformation</category>
      <category>aws</category>
      <category>nestjs</category>
      <category>lambda</category>
    </item>
  </channel>
</rss>
