Skip to content

Commit

Permalink
Lambda Layer support
Browse files Browse the repository at this point in the history
  • Loading branch information
briananstett committed May 27, 2021
1 parent 844a6ba commit a027e0d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# 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.
- Updated pipeline only publish package. It no longers updates the patch number.
6 changes: 1 addition & 5 deletions bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,5 @@ pipelines:
name: Deploying to npm.24g.dev
image: node:12-alpine
script:
- npm install
- npm run lint
- apk --update add git
- npm version patch -m "[skip ci] %s"
- npm publish --registry https://npm.24g.dev
- git push
- npm publish --registry https://npm.24g.dev
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
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": {
Expand Down

0 comments on commit a027e0d

Please sign in to comment.