{"_id":"serverless-plugin-static-env","_rev":"4-c303681a3b461dac1feaed6fcfe39f1f","name":"serverless-plugin-static-env","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"serverless-plugin-static-env","version":"0.1.0","description":"Replace environment variables with static strings before deployment. It is for Lambda @ Edge.","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+ssh://git@github.com/orthanc/serverless-plugin-static-env.git"},"keywords":["serverless","lambda","edge","env"],"author":{"name":"orthanc"},"license":"MIT","bugs":{"url":"https://github.com/orthanc/serverless-plugin-static-env/issues"},"homepage":"https://github.com/orthanc/serverless-plugin-static-env#readme","gitHead":"37e60e0586bb53665a69caf1775146c5a7d82e4e","_id":"serverless-plugin-static-env@0.1.0","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-g7BhclCQ+C88Jjqn9vlEKLaoLme21reygInYwGwWbk8y2WbLwv/kwy87POcrjTqqR1uDZNs3besSDZeUp4t92g==","shasum":"2c7d3b770a7fb500135fda4cb680526d101f079d","tarball":"https://registry.npmjs.org/serverless-plugin-static-env/-/serverless-plugin-static-env-0.1.0.tgz","fileCount":7,"unpackedSize":3771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf6+ChCRA9TVsSAnZWagAA6icP/idw9rASIe2o3Bs8O9G/\n4ha3+mCF/VT3URRRG4Q3IyHeHUcRU5YcA4X/FuqFQQjCF3G8WXd7IJMlRmYv\n5sa/vrcIrVCD1750rFn8nTS0mpKFnQiK8fQoG5VVSgpgrzgC1hVzQAnGQeh0\n4EoPhHCQscO6Jb4q8o8KO1x880wBfbbiqZjfzdfzkDvmnNm8San3u0UbiyeW\nEybMFoLU2OAq72kVS5skiUa3YrbmB7a5s/T28RUilfaGAX3QPx0DJ3eS5w3Y\nkUkxZE2Azu1ex4JWHXrNF2NcQjRf7bIrqbQSuJMWxAV3N3HWQbdWOL2+ZuQl\nMYAspyz57VXYlPfVOvyH/2tWrmNXWlTaF/7UNpZVsJyLF5NIDbTgiHksvSeR\nJ1QW6ZY13kXS3dFHZBeAWLpy2pRRZFU12VqZIzPeXWUZmFs1jAN4XUD39ZVy\nK56y+u6gi0CNSDECt3Q4zXlLNjAo8M5YzGk3Ul/XH+FfJfiCrJIs4LLAf6w2\nM9Q7Fi//JMO9fb8dqtHONyFtRuV1DNn8pP4Q/DVX7HGe6qPYvqDSIjw4kVMN\nIs1Hl8PeIrE4qNcxykQLSk4UZNS5TRxVcV1kBSQpUQmAHM/ZHu+orRjkJgJp\nDcKqjrhOVaZN9sRqAmNGOMplfuYYcdv2oFmUh/C5kl0kT+x4n4SJ9apUVwIW\nOfpE\r\n=SPEF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBRucWdseOGebUxFYzY8ud7BiAIN7RCmh3XENXN3VnTYAiBo18KZi2CqrGDDQ+NqWbErdaTooN5cb3geJOYDQU1/uQ=="}]},"_npmUser":{"name":"orthanc","email":"ed@conqahq.com"},"directories":{},"maintainers":[{"name":"orthanc","email":"ed@conqahq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-plugin-static-env_0.1.0_1609293985394_0.3258471756069625"},"_hasShrinkwrap":false},"0.2.0-alpha.1":{"name":"serverless-plugin-static-env","version":"0.2.0-alpha.1","description":"Replace environment variables with static strings before deployment. It is for Lambda @ Edge.","main":"dist/index.js","scripts":{"build":"tsc","lint":"eslint src","release":"semantic-release"},"repository":{"type":"git","url":"git+ssh://git@github.com/orthanc/serverless-plugin-static-env.git"},"keywords":["serverless","lambda","edge","env"],"author":{"name":"orthanc"},"license":"MIT","bugs":{"url":"https://github.com/orthanc/serverless-plugin-static-env/issues"},"homepage":"https://github.com/orthanc/serverless-plugin-static-env#readme","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@tsconfig/node12":"^1.0.7","@types/node":"^14.14.16","@types/serverless":"^1.78.16","@typescript-eslint/eslint-plugin":"^4.11.1","@typescript-eslint/parser":"^4.11.1","eslint":"^7.16.0","eslint-config-prettier":"^7.1.0","eslint-plugin-prettier":"^3.3.0","husky":"^4.3.6","prettier":"^2.2.1","semantic-release":"^17.3.1","typescript":"^4.1.3"},"gitHead":"3c6b1da0c14a702b870e225657fe038719420691","_id":"serverless-plugin-static-env@0.2.0-alpha.1","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-CCDs2egDd3Quqk+0npwdn+2wR+VQRKinkDwdXX64okJ0yG1vidMdF8BwesIblrHtbLRUw0O8Pf+wOTG9PzaXjg==","shasum":"b68a8841e49832f4fe4ee39ba3211d9e3baddd4f","tarball":"https://registry.npmjs.org/serverless-plugin-static-env/-/serverless-plugin-static-env-0.2.0-alpha.1.tgz","fileCount":4,"unpackedSize":11178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8oFhCRA9TVsSAnZWagAAR8gP/R0BNtfwL0C3BPU5Ixpi\nVlKEmOxud9Pc57/Gn6mOLubwREFTuairXXNq1gMIlzfGiVwLo/zQw8bWOlVu\nvtk/a2by4HPqwe84GGztwpYVFdp8mig/1X5jtGXyb+9+qxBuPGPZZX82J0nO\n7NR+cqr96sWVsBc5fGfJgisg/NN3K7Ea44dmAO6DdRWAcvk3oz25gI8AXAfp\nVouEIqCjEAtUEhtpQt2dSt7df/bfZSlhNdjatwQ/y+7qapjnZIwlNtFVWa2o\n4xGZnZKzj7/P3VLAfwbDHQPf/M0qy6i2QKHV+H2nZhC2L/p8KUaGBKbXCkKZ\nBBJ+kHKnvtQ46dUD9lMkuWLau7Ozn+6KigPD+y3roSwb/HP/peovbjkHh5Pp\nu20ckE6cPIQFyhkw2OhFy8un/lJS66Zg5S2+o7B/bnUyGRDf11WnU60mwy3Z\nC0FfPoNrSnjCXYFxxfq3eSdgd6alN3hfTt63yqPAWrT1BUe6Erz2iQINE5AF\nSmvOz8kEJt1hhg19Rwj9deOsYLRpWuheYBQEW+WDpyX808LQ+IX5fIRFd9pQ\nOgaxspx1jRBhVVyltIvLyxd2sM2NBF4mvRAfg0BQL9d3gdApnIX/maRcBg4Z\nEbW6MNetNPWSMucruR0JDuotgp3vzsxHWfN48eASs0LTm1AeqtfOq5b5LfkN\n5khk\r\n=/OEy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwp6n6UIrG+YD1hYEDXMN0Ai7LU/Wo3AkzsvSuYwTRkwIhAPL4XZs1SPf4f0Vk7oLOok7oghfhAU4Tml/2OWgKPDGd"}]},"_npmUser":{"name":"orthanc","email":"ed@conqahq.com"},"directories":{},"maintainers":[{"name":"orthanc","email":"ed@conqahq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-plugin-static-env_0.2.0-alpha.1_1609728352617_0.06983811301977538"},"_hasShrinkwrap":false},"0.2.0":{"name":"serverless-plugin-static-env","version":"0.2.0","description":"Replace environment variables with static strings before deployment. It is for Lambda @ Edge.","main":"dist/index.js","scripts":{"build":"tsc","lint":"eslint src","release":"semantic-release"},"repository":{"type":"git","url":"git+ssh://git@github.com/orthanc/serverless-plugin-static-env.git"},"keywords":["serverless","lambda","edge","env"],"author":{"name":"orthanc"},"license":"MIT","bugs":{"url":"https://github.com/orthanc/serverless-plugin-static-env/issues"},"homepage":"https://github.com/orthanc/serverless-plugin-static-env#readme","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@tsconfig/node12":"^1.0.7","@types/node":"^14.14.16","@types/serverless":"^1.78.16","@typescript-eslint/eslint-plugin":"^4.11.1","@typescript-eslint/parser":"^4.11.1","eslint":"^7.16.0","eslint-config-prettier":"^7.1.0","eslint-plugin-prettier":"^3.3.0","husky":"^4.3.6","prettier":"^2.2.1","semantic-release":"^17.3.1","typescript":"^4.1.3"},"gitHead":"75a5dab6beea5751dcc08dec04bb0337fd9cd4ba","_id":"serverless-plugin-static-env@0.2.0","_nodeVersion":"12.18.2","_npmVersion":"6.14.5","dist":{"integrity":"sha512-w9ByoT8X/LoSETwTqlUXAwhPxfDnsymn9pMrD+zaFjTfyEQNQlL5QeUR2lJ6AR7/I2HfylQxoi1P6dWkVTRN6w==","shasum":"0a3d034c7c95fb21d8b052f3a86160b589c40635","tarball":"https://registry.npmjs.org/serverless-plugin-static-env/-/serverless-plugin-static-env-0.2.0.tgz","fileCount":4,"unpackedSize":11170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8oUvCRA9TVsSAnZWagAAsh8P/RXVcYEYFogsj1HwJMcD\npfnbfLbf1pEQLRXFOICPIfTCLh9hq3SXNUUEuOGb/MMbJpTgp2c4ofyIyDvh\nqbeHCn8HIglRe3b83saRddRsR6FHA88RWZytTDJhlSDaTKRFl5wKKziyhKDV\n6qM2HRoL+b3kDQdzs80Pgk75nXha9r2jOJ9HeIrTBQKAGi1oqrAZYDiDRZsG\nlP00qU7+c96j/QwApZMPK74Fld90cLHtQGN5bgTWnRJhrEkt+7GHEq8PXGd6\ngRIOu9m6hSkr+VsN8etuAygUe+/SGbegEOoZVlIYwu00hRyTVRecnfpDbmdh\nRp0V8oyDRLPj+hoOS5rA6sXmz12J/55h6oIcFtFd/la1WSLzngP5NTEalHo+\nChMOgLJFJ1xdCeB7ZdaDTbffXwckh15pVmHh/CtTBh19in85S09m2Zkswm2/\nz96ZSjBMcv0jDOJ8imYpmQD0mjf1QG2fg+zsDpUGfUvDIbg/3zdoReYtlCBc\nLKuxX7BqekjtbDHLyj4Df/Rn2VJ9CiOpWvj2GI4YfUteHdmJSInUZSlgSgHi\nhYBa1nFo2toxVe6pZUnuTFFeuI13qfkv/2CA7pgmkS7hsxVSRWBYtl3eItoM\nZM4bAGWEDnOh0wtjnrzBg8QjRKv8a6VJKLCuQlqfVlZiW7kOWdibIsmQMz0l\nZZaA\r\n=bWNM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDJICJFn2nHcN8MPM/6KWZrUI/8s+y9ZCWpVxlmg9SLtQIhANry5sr+QXeKDcsM2d9h3KSaSnXGUJBP4k0aWtXgM7tt"}]},"_npmUser":{"name":"orthanc","email":"ed@conqahq.com"},"directories":{},"maintainers":[{"name":"orthanc","email":"ed@conqahq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-plugin-static-env_0.2.0_1609729327018_0.09419160519241232"},"_hasShrinkwrap":false},"1.0.0":{"name":"serverless-plugin-static-env","version":"1.0.0","description":"Replace environment variables with static strings before deployment. It is for Lambda @ Edge.","main":"dist/index.js","scripts":{"build":"tsc","lint":"eslint src","release":"semantic-release"},"repository":{"type":"git","url":"git+ssh://git@github.com/orthanc/serverless-plugin-static-env.git"},"keywords":["serverless","lambda","edge","env"],"author":{"name":"orthanc"},"license":"MIT","bugs":{"url":"https://github.com/orthanc/serverless-plugin-static-env/issues"},"homepage":"https://github.com/orthanc/serverless-plugin-static-env#readme","devDependencies":{"@commitlint/cli":"^11.0.0","@commitlint/config-conventional":"^11.0.0","@tsconfig/node12":"^1.0.7","@types/node":"^14.14.16","@types/serverless":"^1.78.16","@typescript-eslint/eslint-plugin":"^4.11.1","@typescript-eslint/parser":"^4.11.1","eslint":"^7.16.0","eslint-config-prettier":"^7.1.0","eslint-plugin-prettier":"^3.3.0","husky":"^4.3.6","prettier":"^2.2.1","semantic-release":"^17.3.1","typescript":"^4.1.3"},"gitHead":"6a2ae16a5884d3008ab24b3918c7eeaf32e825a8","_id":"serverless-plugin-static-env@1.0.0","_nodeVersion":"10.23.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-wij8wLsGFJrYPJDu1ScHqQekEvpNevSbeXU8j6CDAxKy85dq64wr3yaPVnqbUhTgxLnLwGoaZlra2IHgoRY6Cg==","shasum":"784e39278e594980555f75103533621a6297d69b","tarball":"https://registry.npmjs.org/serverless-plugin-static-env/-/serverless-plugin-static-env-1.0.0.tgz","fileCount":4,"unpackedSize":11170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf8oYTCRA9TVsSAnZWagAALg8QAKQiPk98uTZra3VbHnFp\ncNaGC8gLpcI/4Agzo58t6LDs7ft8tFIcXzLExmji1A8y4VrK70E7Jwoz6y/E\nUuxDseuaiAJqLgGbN1XeRjwz0pBZM86N7b8DKmEi5leuqULwXZ4nq3LrSKM7\nGoCfWN3cly6SBU7yGR85PITMlsAVeHVpBVXzwhz5ptmkDzN8UPXPhEmtI7KG\njQXT0OoZsTILQ33jMbZFvzV3ki4l2fdJqJiMGDi7Hr2Bkv+WzdzJSu1fS/p7\nWENk1qQDXoZt14dxVQl9vuekXssjS88LH5j/prspbynuwowuWMl4PBTV9+6q\n/e+IuhqPflsg1FHCmUYGOYRZPBuqKHtCn/1kDZJFAnhAYTGh/jmeLVxwkELs\notyMJqPkklZVXTuSTq9vNZlzp+A2nrK1lKI7b9FIXoX9fullQOywFchiDpEA\njmct2tcKtVNGzkvCq/uG9yFSeJt6OT/esYYOEs6uWEO5LbDorkgaxFVuzD9a\ns2zLLd2pUun588IY7kNaKyXEu9tJDVZqtc83Vfyc+QOtqabVD6DgipZ3G3RF\nekQ+EbYoUBmY9ZSmxF3Qor8CI5Wog45nSoWSR6sdOtKggbt2t8fj+ZP5hy7T\nsOCy3H2z1zXGpuLzvaT1t6Ilph8HP7mlVVhRD7wlF8hgkIAStRak45kaFAJ2\n6+Qi\r\n=+10w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiqEq99m60FWYRpIauQOdI0CFFK8jTc2SGLseyZDUaqwIgOfDLq50kaXY/yn3m0eb4l07NtHmeaLOr8Tphhtiummc="}]},"_npmUser":{"name":"orthanc","email":"ed@conqahq.com"},"directories":{},"maintainers":[{"name":"orthanc","email":"ed@conqahq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/serverless-plugin-static-env_1.0.0_1609729555009_0.9303941957507356"},"_hasShrinkwrap":false}},"time":{"created":"2020-12-30T02:06:25.394Z","0.1.0":"2020-12-30T02:06:25.539Z","modified":"2022-05-17T13:12:38.463Z","0.2.0-alpha.1":"2021-01-04T02:45:52.777Z","0.2.0":"2021-01-04T03:02:07.134Z","1.0.0":"2021-01-04T03:05:55.172Z"},"maintainers":[{"name":"orthanc","email":"ed@conqahq.com"}],"description":"Replace environment variables with static strings before deployment. It is for Lambda @ Edge.","homepage":"https://github.com/orthanc/serverless-plugin-static-env#readme","keywords":["serverless","lambda","edge","env"],"repository":{"type":"git","url":"git+ssh://git@github.com/orthanc/serverless-plugin-static-env.git"},"author":{"name":"orthanc"},"bugs":{"url":"https://github.com/orthanc/serverless-plugin-static-env/issues"},"license":"MIT","readme":"[![serverless](http://public.serverless.com/badges/v3.svg)](http://www.serverless.com)\n[![npm version](https://badge.fury.io/js/serverless-plugin-static-env.svg)](https://badge.fury.io/js/serverless-plugin-static-env)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Static Env ServerlessFramework Plugin\n\nThis plugin is is intended for use with Lambda@Edge to replace `process.env` and other\nsimilar mechanisms referencing environment variables with static values so that environment\nspecific configuration can be used in Lambda@Edge (which does not support environment variables).\n\nThis is forked from [serverless-plugin-embedded-env-in-code](https://github.com/zaru/serverless-plugin-embedded-env-in-code)\nwith as it takes a different solution to the same problem of providing environment variables to Lambda@Edge.\n\nIn summary, what this does is take all environment variables specified in the `serverless.yml` in\n`provider.environment` or `function.environment` and packages them into the deployment zip so they\nbecome defaults if the environment variables defined when the function is executed. Practically speaking\nthis means any environment variables specified in `provider.environment` or `function.environment` are\navailable to Lambda@Edge functions the same way as they would to a normal lambda. The key difference being\na redeployment is required to update the values.\n\n# Configuration\n\nEnvironment variables and their values are configured as normal, either in the top level\n[provider.environment](https://www.serverless.com/framework/docs/providers/aws/guide/serverless.yml/)\nor [function.engironment](https://www.serverless.com/framework/docs/providers/aws/guide/functions#environment-variables)\n\nWhen the function is packaged for deployment the values will be embedded in the package so that they are present in `process.env`\nas normal. Note that any environment variables actually set in the environment will take precedence,\nthese are packaged as defaults only.\n\nBy default, any function with a [cloudFront event trigger](https://www.serverless.com/framework/docs/providers/aws/events/cloudfront/)\nwill have it's environment variables embedded during packaging.\n\nA function can explicitly opt in or out of this behavior by specifying the boolean `includeStaticEnv` in the function\ndefinition.\n\n# Example\n\nThe below serverless.yml shows the various usages\n\n```\nservice:\n  name: static-env-example\n\nprovider:\n  name: aws\n  runtime: nodejs12.x\n  stage: ${opt:stage, 'development'}\n  region: 'us-east-1'\n\n  # These environment variables will be made available to all function and included\n  # where static environment is embedded\n  environment:\n    SHARED_ENVIRONMENT_VAR1: 'value1'\n    SHARED_ENVIRONMENT_VAR2: 'value2'\n\nplugins:\n  - serverless-plugin-static-env\n\nfunctions:\n  edgeFunctionWithStaticEnv:\n    handler: dist/endpoints/edgeFunctionWithStaticEnv.handler\n    environment:\n      FUNCTION_SPECIFIC_ENVIRONMENT_VAR1: 'value3'\n      FUNCTION_SPECIFIC_ENVIRONMENT_VAR2: 'value4'\n    # includeStaticEnv: true # this will have static env by default because it includes a\n                             # cloudFront event trigger. If this was set to false it would\n                             # not have a static env even though it has a cloudFront trigger\n                             #\n                             # Without a cloudFront trigger this would have to be explicitly\n                             # set to true to opt in to embedding the static environment\n    events:\n      - cloudFront:\n          eventType: viewer-response\n          origin: s3://bucketname.s3.amazonaws.com/files\n```\n\n## How it Works\n\nFor each function an additional `-env.js` file is generated with the static environment. E.g. with\nthe example configuration above the file `dist/endpoints/edgeFunctionWithStaticEnv-env.js` would be\ngenerated with the following content\n\n```\nprocess.env[\"SHARED_ENVIRONMENT_VAR1\"] = process.env[\"SHARED_ENVIRONMENT_VAR1\"] == null ? \"value1\": process.env[\"SHARED_ENVIRONMENT_VAR1\"];\nprocess.env[\"SHARED_ENVIRONMENT_VAR2\"] = process.env[\"SHARED_ENVIRONMENT_VAR2\"] == null ? \"value2\": process.env[\"SHARED_ENVIRONMENT_VAR2\"];\nprocess.env[\"FUNCTION_SPECIFIC_ENVIRONMENT_VAR1\"] = process.env[\"FUNCTION_SPECIFIC_ENVIRONMENT_VAR1\"] == null ? \"value3\": process.env[\"FUNCTION_SPECIFIC_ENVIRONMENT_VAR1\"];\nprocess.env[\"FUNCTION_SPECIFIC_ENVIRONMENT_VAR2\"] = process.env[\"FUNCTION_SPECIFIC_ENVIRONMENT_VAR2\"] == null ? \"value4\": process.env[\"FUNCTION_SPECIFIC_ENVIRONMENT_VAR2\"];\n```\n\nThe file `dist/endpoints/edgeFunctionWithStaticEnv.js` would also be updated to require `dist/endpoints/edgeFunctionWithStaticEnv-env.js`\nas it's first action ensuring that these variables are present before any other required code is executed.\n","readmeFilename":"README.md"}