{"id":16551288,"url":"https://github.com/iturgeon/aws-secrets-environment","last_synced_at":"2025-10-28T18:31:31.847Z","repository":{"id":52235510,"uuid":"197060238","full_name":"iturgeon/aws-secrets-environment","owner":"iturgeon","description":"Load AWS Secrets Manager values into Node.js process.env","archived":false,"fork":false,"pushed_at":"2019-07-15T21:53:15.000Z","size":7,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T17:11:13.531Z","etag":null,"topics":["12-factor","aws","aws-secrets-manager","env","environment-variables"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/iturgeon.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}},"created_at":"2019-07-15T19:32:55.000Z","updated_at":"2023-11-10T10:48:17.000Z","dependencies_parsed_at":"2022-08-28T13:00:39.629Z","dependency_job_id":null,"html_url":"https://github.com/iturgeon/aws-secrets-environment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iturgeon%2Faws-secrets-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iturgeon%2Faws-secrets-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iturgeon%2Faws-secrets-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iturgeon%2Faws-secrets-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iturgeon","download_url":"https://codeload.github.com/iturgeon/aws-secrets-environment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238700303,"owners_count":19515900,"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","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":["12-factor","aws","aws-secrets-manager","env","environment-variables"],"created_at":"2024-10-11T19:36:53.108Z","updated_at":"2025-10-28T18:31:31.516Z","avatar_url":"https://github.com/iturgeon.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Secrets Environment\n\nA Node module to easily load [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/) JSON secrets into your application's environment variables. This will allow your application to follow the [Twelve-Factor App](https://12factor.net/) principals while keeping access to your secrets controlled with AWS IAM.\n\n* Each key from the loaded secret will be registered as `process.env[key]`\n* Existing process.env variables will **not** be overwritten.\n* If the value of said key is 'true' or 'false', it will be converted to a boolean\n\n## Install\n\n```bash\nyarn install aws-secrets-environment\n```\n\n## Usage\n\nWith these secrets stored in AWS Secrets Manager as `MyApplicationDevSecrets`:\n\n```json\n{\n\t\"NODE_ENV\": \"development\",\n\t\"DB_USER\": \"user-from-aws\",\n\t\"DB_PASS\": \"secret-from-aws\"\n}\n```\n\nindex.js\n\n```javascript\nconst loadAWSJSONSecretsIntoENV = require('aws-secrets-environment')\nconst region = 'us-east-1'\nconst secretName = 'MyApplicationDevSecrets'\n\n// set an env var before loading? it won't be overridden\nprocess.env.DB_PASS = 'secret-from-code'\n\nloadAWSJSONSecretsIntoENV(region, secretName, console.log)\n.then(() =\u003e {\n\tconsole.log(process.env.NODE_ENV, process.env.DB_USER, process.env.DB_PASS)\n\t// Output is: \"development\", \"user-from-aws\", 'secret-from-code'\n\t// start your application\n})\n````\n\n### Arguments\n\n```javascript\nloadAWSJSONSecretsIntoENV('us-east-1', 'mySecret', logger.info)\n```\n\n1. string [AWS Region](https://docs.aws.amazon.com/general/latest/gr/rande.html)\n2. string Name of Secret Manager Secret (select \"Other type of secrets\" when creating)\n3. Optional function that will receive log messages\n\n### Return\n\nReturns a Promise. Once it resolves the secrets are available on process.env.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiturgeon%2Faws-secrets-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiturgeon%2Faws-secrets-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiturgeon%2Faws-secrets-environment/lists"}