Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Cloud Development Kit

Introduction to Cloud Development Kit

Siddharth Balyan

February 14, 2022
Tweet

More Decks by Siddharth Balyan

Other Decks in Programming

Transcript

  1. Introduction to AWS Cloud
    Development Kit
    Siddharth Balyan
    1
    1

    View full-size slide


  2. whoami
    Student aspiring to be security researcher / engineer
    Part of null’s Cloud Security Study Group
    Have been diving into Cloud and Cloud Native as a
    result 2
    2

    View full-size slide

  3. Topics Covered
    Infrastructure as Code
    AWS Cloud Development Kit
    CDK Constructs
    CDK Stacks
    Mini-project: URL Shortener service
    3
    3

    View full-size slide

  4. Infrastructure as Code
    Process of managing of infrastructure through code
    instead of manual process.
    Going throug the AWS Console to create one EC2
    instance is tiring enough, imagine doing it for 50 EC2
    Instances, a Load Balancer, API Gateways and much
    much more.
    Hence, it’s just easier to write down what you want and
    have AWS do it automatically.
    4
    4

    View full-size slide

  5. Writing down instructions = code
    Deploying infrastructure based on instructions =
    Infrastructure as Code
    5
    5

    View full-size slide

  6. AWS CloudFormation
    CloudFormation is the original tool for IaC by AWS.
    Allows you to define the infrastructure using JSON and
    YAML.
    Example of CFN to deploy a WordPress instance
    6
    6

    View full-size slide

  7. Configuration file based IaC have some drawbacks:
    1. It’s hard to write JSON or YAML files
    2. The power of a programming language is not utilized
    Enter CDK, a software development framework with
    support for Python, Java, JS, TS etc.
    Better than just declarative config files
    7
    7

    View full-size slide

  8. CDK Constructs
    It is the basic building block of AWS CDK applications.
    Can be a single resource; AWS S3 bucket.
    Can be higher level abstraction consisting of multiple
    resources, like Lambda linked to DynamoDB
    More details and info here and here
    A construct represents a cloud component and
    encapsulates eveything AWS needs to create the
    component
    8
    8

    View full-size slide

  9. CDK Stacks
    A unit of deployment in AWS CDK is a stack.
    A CDK stack is a combination of all the constructs we
    have defined in our application.
    cdk ls

    Allow us to manage all cloud components (ie
    constructs) as a single unit
    CDK App <— entrypoint for CDK Stacks <— contain all
    the constructs (components)
    10
    10

    View full-size slide

  10. Mini-Project: URL Shortener Service
    Architecture
    Code:
    https://github.com/alt-glitch/url-shortener
    12
    12

    View full-size slide