{"id":15918365,"url":"https://github.com/mileszim/chambermaid","last_synced_at":"2025-04-08T08:49:35.140Z","repository":{"id":38292169,"uuid":"284101510","full_name":"mileszim/chambermaid","owner":"mileszim","description":"Companion Ruby Gem for chamber cli","archived":false,"fork":false,"pushed_at":"2022-06-07T21:45:41.000Z","size":55,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T16:33:49.251Z","etag":null,"topics":["aws","aws-ssm","chamber","dotenv","env","parameter-store","rails","ruby","ssm"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/mileszim.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}},"created_at":"2020-07-31T18:14:50.000Z","updated_at":"2023-03-05T01:27:41.000Z","dependencies_parsed_at":"2022-09-02T19:23:22.260Z","dependency_job_id":null,"html_url":"https://github.com/mileszim/chambermaid","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mileszim%2Fchambermaid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mileszim%2Fchambermaid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mileszim%2Fchambermaid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mileszim%2Fchambermaid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mileszim","download_url":"https://codeload.github.com/mileszim/chambermaid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809875,"owners_count":20999811,"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","aws-ssm","chamber","dotenv","env","parameter-store","rails","ruby","ssm"],"created_at":"2024-10-06T18:41:47.172Z","updated_at":"2025-04-08T08:49:35.118Z","avatar_url":"https://github.com/mileszim.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chambermaid [![Gem Version](https://badge.fury.io/rb/chambermaid.svg)](https://badge.fury.io/rb/chambermaid) [![Build Status](https://travis-ci.com/mileszim/chambermaid.svg?branch=master)](https://travis-ci.com/mileszim/chambermaid)\n\nCompanion RubyGem for [chamber](https://github.com/segmentio/chamber).\n\nChambermaid injects AWS SSM params into your ENV. Plays nice with other ENV gems like dotenv.\n\n - [RubyDocs](https://rubydoc.info/gems/chambermaid)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'chambermaid'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install chambermaid\n\n## Usage\n\n**Standalone**\n\n```ruby\nChambermaid.add_namespace(\"/my/param/namespace\")\nChambermaid.add_service(\"my-chamber-service\")\n```\n\n**Configuration Block**\n\n```ruby\n# config/initializers/chambermaid.rb\n\nChambermaid.configure do |config|\n  # Load all values from SSM Namespace path\n  config.add_namespace(\"/my/param/namespace\")\n\n  # Load values from chamber-cli service\n  config.add_service(\"my-chamber-service\")\n\n  # Set `overload: true` to choose these params over existing\n  # ones in ENV when they are merged together\n  config.add_namespace(\"/my/important/namespace\", overload: true)\nend\n\n# If this is standalone ruby (not a Rails environment),\n# call `Chambermaid.load!` after the configuration block\n#\n# Chambermaid.load!\n```\n\n**Reload SSM into ENV**\n```ruby\nChambermaid.reload!\n```\n\n**Restore ENV to original state**\n```ruby\nChambermaid.restore!\nChambermaid.reset! # alias of .restore!\n```\n\n**Configure Logging**\n```ruby\nChambermaid.configure do |config|\n  # ... other config ...\n\n  # Change log level\n  config.log_level = :debug\n\n  # Set custom logger instance\n  config.logger = MyCoolLogger.new\nend\n\n# Outside of config block\nChambermaid.log_level = :warn\n```\n\n_Note: Chambermaid.logger is set to Rails.logger automatically if including inside a rails app_\n\n### AWS Authentication\n\nChambermaid expects your AWS credential configuration to live inside ENV on application load.\n\n\u003e **Note:** `AWS_DEFAULT_REGION` or `AWS_REGION` is **required**\n\nYou can use either:\n* `AWS_ACCESS_KEY_ID`\n* `AWS_SECRET_ACCESS_KEY`\n\nor STS grants:\n```bash\n$ aws-vault exec my-user -- bundle exec rails server\n```\n\u003e *See [aws-vault](https://github.com/99designs/aws-vault/blob/master/USAGE.md) docs for more info*\n\nor a metadata endpoint grant:\n* Available in attached Task or EC2 instance. *See [AWS Docs](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint.html) for more info.*\n* Through aws-vault: `aws-vault exec -s my-user`\n\n#### IAM Permissions Required\n\nSince this is meant to work out of the box as a complement to [chamber cli](https://github.com/segmentio/chamber), it needs similar IAM permissions.\n\nIn this case, however, we can grant read-only to the namespace(s).\n```json\n{\n    \"Version\": \"2012-10-17\",\n    \"Statement\": [\n        {\n            \"Sid\": \"\",\n            \"Effect\": \"Allow\",\n            \"Action\": \"ssm:DescribeParameters\",\n            \"Resource\": \"*\"\n        },\n        {\n            \"Sid\": \"\",\n            \"Effect\": \"Allow\",\n            \"Action\": [\n                \"ssm:GetParametersByPath\",\n                \"ssm:GetParameters\",\n                \"ssm:GetParameter\",\n                \"kms:Decrypt\"\n            ],\n            \"Resource\": [\n                \"arn:aws:ssm:us-east-1:1234567890:parameter/my-chamber-service\",\n                \"arn:aws:kms:us-east-1:1234567890:key/258574a1-cfce-4530-9e3c-d4b07cd04115\"\n            ]\n        }\n    ]\n}\n```\n\u003e **Note:** `Resource` array MUST include the full ARN of the key id used for chamber cli\n\u003e *(Default alias is `parameter_store_key`)*\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 tags, 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/mileszim/chambermaid. 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/mileszim/chambermaid/blob/master/CODE_OF_CONDUCT.md).\n\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 Chambermaid project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/mileszim/chambermaid/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmileszim%2Fchambermaid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmileszim%2Fchambermaid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmileszim%2Fchambermaid/lists"}