aws-secretsmanager-env

command module
v0.0.0-...-b9f2888 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 1 Imported by: 0

README

AWS SecretsManager ENV

Lambda runtime wrapper for exporting a SecretsManager JSON secret to the ENV

Purpose

Instead of storing sensitive ENV variables in your Lambda function configuration, you might store a JSON document containing sensitive variables and their values and then load that secret in a Lambda runtime wrapper script

Example secret JSON:


{
  "SOME_API_KEY": "F!ZZ",
  "SOME_SECRET": "B@ZZ"
}

Including aws-secretsmanager-env in your functions allows you to export the contents of a secret JSON document into the ENV during the runtime init phase of the function lifecycle.

Usage

Download the latest version of the aws-secretsmanager-env binary from the releases page.

Or, build it yourself with make build.

Include the binary in your lambda package or create a layer from the binary.

Set the following environmental variables in your Lambda:

ENV Example
AWS_SECRET [your secret name]
AWS_LAMBDA_EXEC_WRAPPER /opt/aws-secretsmanager-env (Lambda layer)
AWS_LAMBDA_EXEC_WRAPPER /var/task/aws-secretsmanager-env (Lambda package)

With these variables set, your lambda will export the given SecretsManager secret JSON to the Lambda runtime ENV.

Documentation

Overview

Copyright © 2023 Alexander Mancevice <alexander.mancevice@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL