{"id":15064568,"url":"https://github.com/alekpopovic/aws-secrets-manager","last_synced_at":"2026-02-13T20:03:12.444Z","repository":{"id":255445728,"uuid":"849329687","full_name":"alekpopovic/aws-secrets-manager","owner":"alekpopovic","description":"Aws Secrets Manager","archived":false,"fork":false,"pushed_at":"2024-12-20T11:53:13.000Z","size":81,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T11:08:46.106Z","etag":null,"topics":["aws-secrets-manager","rack","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/aws-secrets-manager","language":"Ruby","has_issues":false,"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/alekpopovic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2024-08-29T12:05:23.000Z","updated_at":"2024-12-24T18:52:10.000Z","dependencies_parsed_at":"2024-12-03T19:32:42.827Z","dependency_job_id":"a5457076-53e2-4362-b074-5a1ed45544fb","html_url":"https://github.com/alekpopovic/aws-secrets-manager","commit_stats":{"total_commits":28,"total_committers":1,"mean_commits":28.0,"dds":0.0,"last_synced_commit":"ed03c88992eee1fd3432212d6651070c53d16d8d"},"previous_names":["alekpopovic/aws-secrets-manager"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekpopovic%2Faws-secrets-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekpopovic%2Faws-secrets-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekpopovic%2Faws-secrets-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alekpopovic%2Faws-secrets-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alekpopovic","download_url":"https://codeload.github.com/alekpopovic/aws-secrets-manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217115,"owners_count":21066633,"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":["aws-secrets-manager","rack","ruby","ruby-on-rails"],"created_at":"2024-09-25T00:20:37.498Z","updated_at":"2026-02-13T20:03:07.407Z","avatar_url":"https://github.com/alekpopovic.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aws-secrets-manager\n\n[![Ruby](https://github.com/alekpopovic/aws-secrets-manager/actions/workflows/main.yml/badge.svg)](https://github.com/alekpopovic/aws-secrets-manager/actions/workflows/main.yml)\n\n[![Ruby Gem](https://github.com/alekpopovic/aws-secrets-manager/actions/workflows/gem-push.yml/badge.svg)](https://github.com/alekpopovic/aws-secrets-manager/actions/workflows/gem-push.yml)\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add aws-secrets-manager\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install aws-secrets-manager\n\n## Usage\n\nIf you using Ruby on Rails then\n\n```ruby\nrails g aws_secrets_manager:install\n```\n\nor manualy add in Rack app config file:\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'aws_secrets_manager'\n\nAwsSecretsManager.configure do |config|\n  config.aws_region = ENV.fetch('AWS_REGION', 'eu-west-1')\nend\n\nAwsSecretsManager.get_secret_value(\n  secrets: [\n    {\n      name: ENV.fetch('AWS_SECRETS_PLAINTEXT_1', 'aws-secrets-plaintext-1-development'),\n      type: AwsSecretsManager::Config::PLAINTEXT\n    },\n    {\n      name: ENV.fetch('AWS_SECRETS_PLAINTEXT_2', 'aws-secrets-plaintext-2-development'),\n      type: AwsSecretsManager::Config::PLAINTEXT\n    },\n    {\n      name: ENV.fetch('AWS_SECRETS_KEY_VALUE_1', 'aws-secrets-key-value-1-development'),\n      type: AwsSecretsManager::Config::KEY_VALUE\n    },\n    {\n      name: ENV.fetch('AWS_SECRETS_KEY_VALUE_2', 'aws-secrets-key-value-2-development'),\n      type: AwsSecretsManager::Config::KEY_VALUE\n    },\n  ]\n)\n```\n\nIn complex environments where applications require the use of multiple secrets, this gem can be an interesting solution.\n\nIn AWS Secrets Manager if you have secret with name example-1 and with Secret value type =\u003e Key/value:\n\n```ruby\n{\n  \"ex_1\":\"1\",\n  \"ex_2\":\"2\",\n  \"ex_3\":\"3\"\n}\n```\nin console when type ENV you will have 3 env variable like:\n\n```ruby\n{\n  \"EX_1\"=\u003e\"1\",\n  \"EX_1\"=\u003e\"1\",\n  \"EX_1\"=\u003e\"1\"\n}\n```\n\nIn AWS Secrets Manager if you have secret with name example-2 and with Secret value type =\u003e Plaintext with value: 123456789\n\nin console when type ENV you will have 1 env variable like:\n\n```ruby\n{\n  \"EXAMPLE_2\"=\u003e\"123456789\"\n}\n```\n\nIMPORTANT!!! When type =\u003e Plaintext\n\nSECRET NAME IS ENV KEY AND Secret value IS ENV VALUE\n\nFull example:\n\nConfig:\n\n```ruby\n# frozen_string_literal: true\n\nrequire 'aws_secrets_manager'\n\nAwsSecretsManager.configure do |config|\n  config.aws_region = ENV.fetch('AWS_REGION', 'eu-west-1')\nend\n\nAwsSecretsManager.get_secret_value(\n  secrets: [\n    {\n      name: 'common-secrets',\n      type: AwsSecretsManager::Config::KEY_VALUE\n    },\n    {\n      name: 'fake-ssh-key',\n      type: AwsSecretsManager::Config::PLAINTEXT\n    },\n  ]\n)\n```\nConsole output:\n\n```ruby\n{\n  \"DATABASE_DSN\"=\u003e\"postgres://user:pass@server:5432/db\",\n  \"API_KEY\"=\u003e\"5S6BX2c6vx879eZ\",\n  \"ORIGIN\"=\u003e\"https://example.com\"\n  \"SMTP_HOST\"=\u003e\"mailcluster.example.com\",\n  \"FAKE_SSH_KEY\"=\u003e\"-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCxxx7OfuLEm3wm\\njOVKL4+ibYBrrL3p8id2x4DZ3C+7C8ZkwsC6\\n\"\n}\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/alekpopovic/aws-secrets-manager. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/alekpopovic/aws-secrets-manager/blob/main/CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the aws-secrets-manager project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/alekpopovic/aws-secrets-manager/blob/main/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekpopovic%2Faws-secrets-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falekpopovic%2Faws-secrets-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falekpopovic%2Faws-secrets-manager/lists"}