Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 1.62 KB

File metadata and controls

37 lines (27 loc) · 1.62 KB

Development Environment

Requirements

  • node v14.15.0+
  • Go 1.16+

Setup

If you wish to work on the go-lambda-cleanup CLI, you'll first need Go installed on your machine (please check the requirements before proceeding).

Note: This project uses Go Modules making it safe to work with it outside of your existing GOPATH. The instructions that follow assume a directory in your home directory outside of the standard GOPATH.

Clone repository to: $HOME/projects/go-lambda-cleanup/

$ mkdir -p $HOME/projects/go-lambda-cleanup/; cd $HOME/projects/go-lambda-cleanup/
$ git clone git@github.com:karl-cardenas-coding/go-lambda-cleanup.git

Issue the command npm install. This will setup the commit hooks for the project through Husky v4

$ npm install

The clean command expects the file cmd/aws-regions.txt to be present. Otherwise binary builds or go run main.go clean will fail. Issue the command below from the root of the project namespace. This assumes you have your local aws credentials configured.

 aws ec2 describe-regions --region us-east-1 --query "Regions[].RegionName" --output text >> cmd/aws-regions.txt

Testing

Add test cases to new functions and new commands. Invoke the Go tests from the root namespace. The pipeline will invoke the Go tests as well.

go test -v ./...

Terraform

A terraform folder is included in this project. The Terraform code deploys 55 Lambdas. This is used to test the LambdaListFunctions API logic. To use this Terraform code you must provide your own AWS environment and credentials.