Skip to content

Commit

Permalink
Merged in bugfix/lambda-env (pull request #7)
Browse files Browse the repository at this point in the history
Lambda Layer support
briananstett committed May 27, 2021
2 parents 844a6ba + cc89185 commit cc8cafb
Showing 3 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.1.2] - 2021-05-27
### Changed
- Updated the logic gate to determine if the code is running in a container or Lambda. It now uses `AWS_LAMBDA_FUNCTION_NAME` instead of `AWS_EXECUTION_ENV` since `AWS_LAMBDA_FUNCTION_NAME` isn't always set which caused issues when using this package in a Lambda layer.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ module.exports = async function getSecret(secretPath, options = {}) {
// If the user passed in an existing Vault token, you that. Don't go through the process of generating one
if (token == null) {
// Determine if being called in Lambda or container.
if (process.env.AWS_EXECUTION_ENV) {
if (process.env.AWS_LAMBDA_FUNCTION_NAME) {
// Running in Lambda. Make necessary assumptions.
if (!vaultRole) throw new Error('Requires either options.vaultRole or VAULT_ROLE environment variable.');
vaultClient = new VaultAwsAuth({
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@24g/vault",
"version": "1.1.1",
"version": "1.1.2",
"description": "Module for interacting with Vault",
"main": "index.js",
"scripts": {

0 comments on commit cc8cafb

Please sign in to comment.