{"id":15491361,"url":"https://github.com/n1ru4l/ssm-parameter-env","last_synced_at":"2025-07-25T11:04:10.691Z","repository":{"id":39034260,"uuid":"122036001","full_name":"n1ru4l/ssm-parameter-env","owner":"n1ru4l","description":" Supply your environment with the AWS Systems Manager Parameter Store","archived":false,"fork":false,"pushed_at":"2025-07-22T06:49:56.000Z","size":1198,"stargazers_count":5,"open_issues_count":24,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-22T08:50:56.695Z","etag":null,"topics":["aws","environment","environment-variables","serverless","ssm"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n1ru4l.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-02-19T08:32:13.000Z","updated_at":"2023-08-03T12:46:23.000Z","dependencies_parsed_at":"2023-10-13T11:47:09.195Z","dependency_job_id":"e3e9e582-492f-4f96-a27a-5d0f2932ba1d","html_url":"https://github.com/n1ru4l/ssm-parameter-env","commit_stats":{"total_commits":1322,"total_committers":4,"mean_commits":330.5,"dds":0.0226928895612708,"last_synced_commit":"89d88c07d902d6aed526f65873eb23e5f07d8a80"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/n1ru4l/ssm-parameter-env","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1ru4l%2Fssm-parameter-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1ru4l%2Fssm-parameter-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1ru4l%2Fssm-parameter-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1ru4l%2Fssm-parameter-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n1ru4l","download_url":"https://codeload.github.com/n1ru4l/ssm-parameter-env/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n1ru4l%2Fssm-parameter-env/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266507366,"owners_count":23940055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","environment","environment-variables","serverless","ssm"],"created_at":"2024-10-02T07:52:53.872Z","updated_at":"2025-07-25T11:04:10.653Z","avatar_url":"https://github.com/n1ru4l.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SSM Parameter Env\n\nSupply your environment with the [AWS Systems Manager Parameter Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html)\n\n## Install\n\n### yarn\n\n`yarn add @n1ru4l/ssm-parameter-env`\n\n### npm\n\n`npm install @n1ru4l/ssm-parameter-env`\n\n## Usage Example (lambda)\n\n```js\n\"use strict\";\nconst AWS = require(\"aws-sdk\");\nconst ssm = new AWS.SSM();\nconst createGetEnvironment = require(\"@n1ru4l/ssm-parameter-env\");\nconst expect = require(\"expect\");\n\n// You would probably use process.env\nconst env = {\n  MY_SCURR: \"ssm:/Scurr/Burr/Eagle\",\n  MY_BAZZ: \"Passthrough value\"\n};\n\n// Create outside of handler to use in-memory caching (default is 5 minutes)\nconst getEnvironment = createGetEnvironment({\n  env,\n  ssm,\n  expires: 5 * 60 * 1000\n});\n\nmodule.exports.handler = (event, context, callback) =\u003e {\n  getEnvironment().then(env =\u003e {\n    expect(env).toEqual({\n      MY_SCURR: \"TOP SECRET VALUE\",\n      MY_BAZZ: \"Passthrough value\"\n    }); // true\n\n    const response = {\n      statusCode: 200,\n      body: JSON.stringify({\n        message: env.MY_SCURR\n      })\n    };\n    callback(null, response);\n  });\n};\n```\n\nMore documentation will follow soon. For more detail you can take a look at the [tests](./src/index.test.js) 😇.\n\n## How to use with serverless(-offline)\n\nThis plugin should work out of the box with serverless-offline.\nYou should not uny any environment variables prefixed with `ssm:` in your local development environment to prevent any request to AWS.\n\n## Required Permissions\n\n[This document](https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-access.html) should cover all info about permissions.\nYou will have to give permissions to your target for the following actions: `ssm:GetParameters` and `kms:Decrypt`.\nI recommend to group your ssm parameters with a prefix (e.g. `my-project-production/database-password`). By doing so you can restrict the `ssm:GetParameters` to a subset of ssm parameters that start with the shared prefix (e.g. `my-project-production/*`).\n\n**I use serverless and I don't care, I am testing and I just wanne copy paste stuff**\n\nIf you do not care about fine graned access control just use these iamRoleStatements (serverless):\n\n```yml\n  iamStatements:\n    - Effect: Allow\n      Action:\n        - ssm:GetParameters\n      Resource: *\n    - Effect: Allow\n      Action:\n        - kms:Decrypt\n      Resource: *\n```\n\n## Roadmap\n\n* [x] Make it compatible to serverless framework (offline mode)\n* [ ] Test in Real World Application\n* [x] Publish to npm\n* [x] Implement caching\n\n## Useful Links\n\n* [You should use ssm parameter store over lambda env variables](https://hackernoon.com/you-should-use-ssm-parameter-store-over-lambda-env-variables-5197fc6ea45b)\n\n* [AWS Lambda lifecycle and in-memory caching](https://medium.com/@tjholowaychuk/aws-lambda-lifecycle-and-in-memory-caching-c9cd0844e072)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn1ru4l%2Fssm-parameter-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn1ru4l%2Fssm-parameter-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn1ru4l%2Fssm-parameter-env/lists"}