Heading image

Prerequisites

  1. Basic familiarity with AWS CDK for TypeScript.

Getting started

We will clone the template repo to get started:

Adding a pattern construct

We want to create a re-useable construct that will allow us to deploy a basic Python lambda functions.

Creating the function

Inside of functions/hello-python-lambda/index.py, add the following code:

Adding the construct to our stack

Inside of lib/aws-cdk-with-typescript-foundations-stack.ts, add the following code:

Deploying to LocalStack

This will follow on from what was demonstrated in the “Using The AWS CDK With LocalStack And aws-cdk-local” post.

Invoking the function

Tear down

Finally, we can tear down the stack:

Summary

Today’s post demonstrated how to deploy a basic Python lambda function to LocalStack using the TypeScript AWS CDK.

Resources and further reading

  1. AWS CDK for TypeScript
  2. Project code

--

--

--

Senior Engineer @ UsabilityHub. Formerly Culture Amp.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

IPFS: A Distributed File Store

Challenges Organizations Face When Preparing for DevOps Transition

Hiding an Element When There Is No Enough Space — Thanos Snap Technique

JadeALM Manifesto

Keeping Session Secrets Secret

Software Testing Process and Levels of Testing

Importing a VM as an Image using VM import/Export (Part 3)

Yoyo cash customer care number^9832968895..

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dennis O'Keeffe

Dennis O'Keeffe

Senior Engineer @ UsabilityHub. Formerly Culture Amp.

More from Medium

Building A Containerized Lambda Function

Accelerating AWS deployment when using Typescript

Migrating a WSGI Python application to Serverless on AWS

Deploying Python Lambda function with Serverless Framework