Skip to content

Commit

Permalink
Merge pull request #55 from handlename/feature/use-entire-path-for-lib
Browse files Browse the repository at this point in the history
supports use entire path for lib
  • Loading branch information
handlename committed Mar 3, 2022
2 parents 4652901 + 0b9c281 commit 1034b76
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 6 additions & 2 deletions README.md
Expand Up @@ -27,20 +27,24 @@ $ ssmwrap -help
Usage of ./cmd/ssmwrap/ssmwrap:
-env
export values as environment variables (default true)
-env-entire-path
use entire parameter path for name of environment variables
disabled: /path/to/value -> VALUE
enabled: /path/to/value -> PATH_TO_VALUE
-env-prefix string
prefix for environment variables
-file value
write values as file
format: Name=VALUE_NAME,Path=FILE_PATH,Mode=FILE_MODE,Gid=FILE_GROUP_ID,Uid=FILE_USER_ID
example: Name=/foo/bar,Path=/etc/bar,Mode=600,Gid=123,Uid=456
-names string
comma separated parameter names
comma separated parameter names
-no-env
disable export to environment variables
-no-recursive
retrieve values just under -paths only
-paths string
comma separated parameter paths
comma separated parameter paths
-prefix string
alias for -env-prefix
-recursive
Expand Down
14 changes: 8 additions & 6 deletions lib.go
Expand Up @@ -5,19 +5,21 @@ import (
)

type ExportOptions struct {
Paths []string
Names []string
Prefix string
Recursive bool
Retries int
Paths []string
Names []string
Prefix string
UseEntirePath bool
Recursive bool
Retries int
}

// Export fetches paramters from SSM and export those to environment variables.
// This is for use ssmwrap as a library.
func Export(options ExportOptions) error {
ssm := DefaultSSMConnector{}
dest := DestinationEnv{
Prefix: options.Prefix,
Prefix: options.Prefix,
UseEntirePath: options.UseEntirePath,
}

parameters := map[string]string{}
Expand Down

0 comments on commit 1034b76

Please sign in to comment.