Should you ditch Serverless for AWS CDK?

Should you ditch Serverless for AWS CDK?

The Serverless Framework is the most popular framework for building serverless applications, but does how it compare to the new AWS CDK?

The Serverless Framework is the most popular framework for building serverless applications, but does how it compare to the new AWS CDK? In July 2019, AWS announced its own framework Cloud Development KitAWS CDK is a framework to deploy serverless applications and any AWS resource. AWS CDK helps you achieve infrastructure as code similar to AWS CloudFormation and Terraform.

This post will compare Serverless Framework and AWS CDK in different areas: framework ease of use, extensibility, and security. By the end you should be able to determine whether you should stay with Serverless or adopt CDK.

Overview of the frameworks

Both AWS CDK (which we will refer to as “CDK”) and the Serverless Framework (which we will refer to as “Serverless”) are both JavaScript frameworks that you may install as a Command Line Interface (CLI) script via npm or yarn. Both support AWS, but their use varies.

What is the Serverless Framework?

Serverless allows you to deploy serverless applications to multiple cloud providers. Serverless supports the following providers:

  • AWS
  • Azure
  • Tencent Cloud
  • Google Cloud
  • Knative
  • Alibaba Cloud
  • Cloudflare
  • fn
  • Kubeless
  • OpenWhisk
  • spotinst

The Serverless configuration file (named “serverless.yml”) uses a similar format for most providers, which allows you to switch mental context between providers reasonably easily. The “serverless.yml” file will enable you to specify your configuration using YAML syntax and put your function source code like JavaScript, Python, Go, and any other language the cloud provider supports. Serverless will deserialize the “serverless.yml” and convert it to the cloud provider’s underlying format (e.g., AWS CloudFormation template).

What is Amazon Web Services (AWS) Cloud Development Kit (CDK)?

CDK allows you to deploy resources in AWS using TypeScript, JavaScript, Python, Java, and .NET. Your source code defines both the resources and the files those resources need (e.g., AWS Lambda function source code). CDK will synthesize the source code to create the appropriate AWS CloudFormation template.

aws programming aws-lambda cloud-computing serverless

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Multi-cloud Spending: 8 Tips To Lower Cost

Mismanagement of multi-cloud expense costs an arm and leg to business and its management has become a major pain point. Here we break down some crucial tips to take some of the management challenges off your plate and help you optimize your cloud spend.

AWS Lambda’s Major Limitations

Lambda promises cheaper compute, easier architecture, and simpler development processes. But does it deliver?It’s the industry’s flagship serverless computing product, allowing customers to run workloads without thinking about the server on which they will run. Lambda promises cheaper compute, easier architecture, and simpler development processes.

AWS Lambda Tutorial | Learn Serverless Computing With AWS

This AWS Lambda Tutorial will introduce you to the concept of Serverless Computing. Serverless Computing has taken computation on Cloud Platforms to a different level. You'll learn in detail about different Amazon Web Services applications and services that let you implement Serverless computing on top of AWS Platform. You'll also learn how to build a detailed application which will be Serverless in nature.

The Right Way of Tracing AWS Lambda Functions

With an emphasis on distributed tracing, this article discusses best practices for gaining and leveraging observability into AWS Lambda functions.

Serverless Express – Easy APIs On AWS Lambda & AWS HTTP API

Serverless Express enables you to easily host Express.js APIs on AWS Lambda and AWS HTTP API. Here is how to get started and deliver a Serverless Express.js based API with a custom domain, free SSL certificate and much more!