Skip to content

dorneanu/aws-custom-resource-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS custom resources using Golang, Lambda and TypeScript.

Motivation

This is ready-to-deploy proof of concept leveraging Golang to efficiently handle the lifecycle management of so called AWS custom resources. This repository exemplifies how to use these to create SSM parameters of type SecureString in CDK. You can, of course, use this repository as a template for more advanced custom resources.

📖 You can read more on my blog at AWS Custom resources with Lambda and Golang.

Deployment

Make sure you first install all dependencies:

  • go binary
  • npm

Then clone this repository:

$ git clone https://github.com/dorneanu/aws-custom-resource-golang

Then install all npm dependencies:

$ cd deployments
$ npm i --save-dev
added 310 packages in 3s

30 packages are looking for funding
run `npm fund` for details

I always recommend to first run cdk diff before deploying. This way you can review the changes before it’s to late:

$ npx aws-cdk diff

Afterwards you can deploy:

$ npx aws-cdk deploy

TODOs

  • [ ] Add logrus
  • [X] Try to bundle Golang based lambda function locally first (see this example)
  • [X] Test locally

Resources