AWS CDK

And

AWS Lambda

Workshop

Prerequisites

General

Prerequisites

Linux
  • Latest version of Node.js
    hint: use nvm
  • AWS CDK:
    npm install -g aws-cdk@0.39.0

Prerequisites

Other Platforms
  • All roads lead to Rome Linux :)
  • Because some of the AWS CDK libraries might not work under a non-Linux platform (e.g. this one)
  • Maybe they'll work under Mac (since it's Unix-like platform) but I'm not sure

Prerequisites

Other Platforms

Suggested workaround:

  1. Launch an EC2 instance with all the necessary tooling and SSH into it
  2. Edit code locally in your favorite IDE
  3. Commit and push changes
  4. From within the EC2 instance:
    1. pull the changes
    2. run CDK commands

Gear Up!

workaround link

Infrastructure As Code

General Idea

Cloud resources (RDS / S3 storage / VPC network configuration / EC2 launch configurations etc.) are described in (usually) human-readable text files which are stored in a git repository and are therefore versioned.

A special tool reads the files (e.g. during a CI/CD pipeline run) and provisiones the defined infrastructure.

Infrastructure As Code

Why?
  • Repository => streamline GitOps infrastructure can be committed/reviewed/merged/tagged/etc.
  • Versioning => track changes, do "time travel"
  • Tool => minimize human factor e.g. get rid of typos during manual provisioning
  • Tool => automation => faster iterations have more time for development and other important job

Infrastructure As Code

How?

Let's RTFM a Little Bit

What we'll build

What we'll build

The final result is here.

However, as the Arthur Ashe put it:

Success is a journey, not a destination. The doing is often more important than the outcome.

Let's build it

we'll need the web UI from the final result though :)