DEV Community

Cover image for Lessons in AWS Python CDK: 0-An Introduction
Jakob Ondrey for AWS Community Builders

Posted on

Lessons in AWS Python CDK: 0-An Introduction

TLDR
The official Python documentation for the AWS CDK is not great. Also, the community support is more lackluster than TypeScript, especially for beginners. This will eventually be a collection of the things I have learned. Maybe my words will speak more clearly to you than the AWS docs or other resources out there.

About Me
My name is Jakob and I am a DevOps Engineer. I used to be a lot of other things as well (Dish Washer, Retail Employee, Camp Counselor, Army Medic, Infectious Disease Researcher), but now I am a DevOps Engineer. I received no formal CS education but I'm not self taught, because I had thousands of instructors who taught me through their tutorials and blog posts. The culture of information sharing within the software engineering community is vital to everyone, especially those like me who didn't have other options. So, as I learn new things I will be documenting them through the eyes of someone learning for the first time, because those are the people most in need of a guide. Happy Learning! And don't be a stranger.

Note: I am NOT going to be sourcing and fact checking everything here. This is not an O'Reilly book. The language and descriptions are intended to allow beginners to understand. If you want to be pedantic about details or critique my framing of what something is or how it works feel free to write your own post about it. These posts are intended to be enough to get you started so that you can begin breaking things in new ways on your own!


The Introduction

The AWS Cloud Development Kit (CDK) is a tool for using common programming languages to write CloudFormation (CFn) templates. The templates serve as a declarative representation of the infrastructure that you want to deploy out into AWS. After the CDK builds the CFn templates, it can send them to the CloudFormation service which will then provision the requested infrastructure.

If you have the option to use TypeScript to write your CDK stacks, the term used by the CDK and CloudFormation to describe groupings of infrastructure that are intended to work together, you probably should use TypeScript. The documentation and community support for Typescript is top notch. If you must use Python or don't want to learn TypeScript continue on. Just know that Python is kind of a second class citizen.

Hopefully these guides will be useful to you and others and add to the body of Python CDK resources.

I also plan on doing video walk-through versions of each post. Some people need to see what is happening in a way that may not translate well to text and screenshots. I got you covered.


Future Posts

In future posts I will be certainly covering the following topics:

  • Installing requirements to get your first project running (update: here it is)
    • including dealing with problematic node versions
  • Lambda functions
    • including local testing with events
  • Deploying using CICD pipelines (Github Actions)
    • including using environmental variables to deploy to multiple accounts and regions

That's all I know because I have already started working on those. I will certainly come up with others as I learn myself and share those lessons with you.

Let's Go!!

Top comments (1)

Collapse
 
hectorlaris profile image
Héctor Serrano

Thankyou Jakob, your work has been so useful for me!