Giter Site home page Giter Site logo

aws-secrets-manager-rotation-lambda-go's Introduction

AWS Secrets Manager Custom Rotation Lambda for Golang

Based heavily on the Python version distributed by AWS, this lambda provides a wireframe for automated secret rotation for custom secrets in AWS Secrets Manager. I wanted to have a version in Go, as many other microservices I work on are also in Go, and although the official (Python) version works fine, I felt it more appropriate to consolidate my language choices.

How to customize for your own secret:

This lambda handles the transition of labels on Secret Manager stored secrets. You will need to write your own code for the setSecret and testSecret stages.

Set Secret Stage

The setSecret stage should set the AWSPENDING secret in the service that the secret belongs to. For example, if you are wanting to rotate a password for a user in a database, this stage would connect to the database and update the password.

Test Secret Stage

The testSecret stage should validate that the AWSPENDING secret works in the service that the secret belongs to. Following the previous example, this stage should attempt to use the new password in order to validate the update worked as expected.

How to build the lambda for deployment:

Unix:

GOOS=linux go build main.go
zip main.zip ./main

Windows (Powershell):

AWS provides a utility (build-lambda-zip.exe) to make it easier to create lambda Go packages. More information can be found on the official AWS Lambda Deployment Package in Go guide, along with the download link for build-lambda-zip.exe.

$env:GOOS = "linux"
go build -o main main.go
~\Go\Bin\build-lambda-zip.exe -o main.zip main

aws-secrets-manager-rotation-lambda-go's People

Contributors

georgejenkins avatar

Watchers

James Cloos avatar  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.