From a027e0df15c92028bdb3a8bd58bf43012708cfa0 Mon Sep 17 00:00:00 2001 From: Brian Anstett Date: Thu, 27 May 2021 14:32:01 -0400 Subject: [PATCH] Lambda Layer support --- CHANGELOG.md | 12 ++++++++++++ bitbucket-pipelines.yml | 6 +----- index.js | 2 +- package.json | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3966314 --- /dev/null +++ b/CHANGELOG.md @@ -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. \ No newline at end of file diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d0c11a9..9377941 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -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 \ No newline at end of file + - npm publish --registry https://npm.24g.dev \ No newline at end of file diff --git a/index.js b/index.js index ed914b3..f6a594d 100644 --- a/index.js +++ b/index.js @@ -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({ diff --git a/package.json b/package.json index 293bc9d..d66fe21 100644 --- a/package.json +++ b/package.json @@ -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": {