Skip to content

Commit

Permalink
docs(README): Adds Supported Lookups section guide.
Browse files Browse the repository at this point in the history
* Explains supported lookup types (`:priority` and `:hash`)
* Includes examples

Co-authored-by: Sarah Young <sarahseewhy@gmail.com>
Co-authored-by: Alex Wilson <a.wilson@alumni.warwick.ac.uk>
  • Loading branch information
3 people committed Sep 4, 2018
1 parent 1c776e0 commit b8b69e6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -20,6 +20,7 @@ mYs3cR3TpAs5W0rD
## Contents

- [Install](#install)
- [Supported Lookups](#supported-lookups)
- [Configuration](#configuration)
- [Region](#region)
- [Credentials](#credentials)
Expand All @@ -45,6 +46,31 @@ Install the dependencies before attempting to use the gem:
bundle install
```

## Supported Lookups

hiera-secrets-manager supports `:priority` (single value) and `:hash` (key-value pair) lookups, but not `:array`.

### Priority Lookup

```puppet
# In environment 'production' with 'production/system/my-secret' set as 'some-password'
$secret = hiera('system/my-secret')
notice($secret) # prints 'Notice: Scope(Class[main]): some-password'
```

### Hash Lookup

```puppet
# In environment 'production' with 'production/system/my-secret' set as pairs 'foo:bar' and 'baz:zap'
$secret = hiera_hash('system/my-secret')
notice($secret['foo']) # prints 'Notice: Scope(Class[main]): bar'
notice($secret['baz']) # prints 'Notice: Scope(Class[main]): zap'
notice($secret) # prints 'Notice: Scope(Class[main]): {"foo"=>"bar", "baz"=>"zap"}'
```

## Configuration

Hiera Secrets Manager is configurable and the configuration has three required fields to operate: region, access_key_id, and secret_access_key.
Expand Down

0 comments on commit b8b69e6

Please sign in to comment.