https://github.com/envato/stack_master-gpg_parameter_resolver
https://github.com/envato/stack_master-gpg_parameter_resolver
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/envato/stack_master-gpg_parameter_resolver
- Owner: envato
- License: mit
- Created: 2019-07-18T22:44:26.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2024-02-17T06:54:35.000Z (over 2 years ago)
- Last Synced: 2025-06-12T18:45:29.658Z (about 1 year ago)
- Language: Ruby
- Size: 27.3 KB
- Stars: 1
- Watchers: 61
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# StackMaster::GpgParameterResolver
[](https://github.com/envato/stack_master-gpg_parameter_resolver/blob/main/LICENSE.txt)
[](https://rubygems.org/gems/stack_master-gpg_parameter_resolver)
[](https://github.com/envato/stack_master-gpg_parameter_resolver/actions?query=branch%3Amain+workflow%3Atests)
Resolve [StackMaster] parameters from within GPG encrypted YAML files.
[StackMaster]: https://github.com/envato/stack_master
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'stack_master-gpg_parameter_resolver'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install stack_master-gpg_parameter_resolver
## Usage
The secret parameters resolver expects a `secret_file` to be defined in the
stack definition which is a GPG encrypted YAML file. Once decrypted and parsed,
the value provided to the secret resolver is used to lookup the associated key
in the secret file. A common use case for this is to store database passwords.
stack_master.yml:
```yaml
stacks:
us-east-1:
my_app:
template: my_app.json
secret_file: production.yml.gpg
```
secrets/production.yml.gpg, when decrypted:
```yaml
db_password: my-password
```
parameters/my_app.yml:
```yaml
db_password:
secret: db_password
```
## Development
After checking out the repo, run `script/setup` to install dependencies. You can also run `script/console` for an interactive prompt that will allow you to experiment.
To 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).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/envato/stack_master-gpg_parameter_resolver.