Coder Social home page Coder Social logo

cdk-in-go-brown-bag's Introduction

CDK 2 in Go brown-bag demo

This is a CDK 2 project in Go. I used it in one brown-bag session to introduce CDK to an engineering organisation.

talk slides

presentation slides

companion blog

Using CDK with Go - a recent brown bag talk and some thoughts

Useful commands

  • cdk deploy deploy this stack to your default AWS account/region
  • cdk diff compare deployed stack with current state
  • cdk synth emits the synthesized CloudFormation template
  • go test run unit tests

Build it from scratch

  • requires node.js
  • install CDK globally: npm i -g cdk or use npx cdk ...
  • we use CDK 2: cdk --version
  • mkdir project-name && cd project-name
  • init CDK project in Go: npx cdk init --language go
  • evaluate cdk.json
  • default deployment: npx cdk deploy
  • refine CloudFormation stack properties: name, tags
  • define s3 bucket
  • refine s3 bucket properties: encryption, bucket policy
  • define lambda function
  • define S3 event source to invoke lambda function
  • define DynamoDB table
  • grant lambda function permissions to access S3 bucket and DynamoDB table

Test deployment

  • upload a file to the provisioned S3 bucket upload a file to the provisioned S3 bucket

  • Lambda function should be invoked Lambda function should be invoked

  • Lambda should write the meta data in the DynamoDB table Lambda should write the meta data in the DynamoDB table

cdk-in-go-brown-bag's People

Contributors

chrischenyc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.