Discover Packages
github.com/mhemmings/ssm-env
package
module
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Apr 10, 2022
License: MIT
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
ssm-env
A Go package to set an environment using AWS SSM.
Usage
Assuming you have parameters set in SSM using:
$ aws ssm put-parameter --name=/ssm/path/FOO --value=secretfoo --type SecureString
$ aws ssm put-parameter --name=/ssm/path/BAR --value=secretbar --type SecureString
package main
import (
"fmt"
"os"
"github.com/mhemmings/ssm-env"
)
func main() {
err := ssm.Parse("/ssm/path")
if err != nil {
panic(err)
}
// Now the environment has been setup.
foo := os.Getenv("FOO")
bar := os.Getenv("BAR")
fmt.Println(foo) // Prints: "secretfoo"
fmt.Println(bar) // Prints: "secretbar"
}
Expand ▾
Collapse ▴
Documentation
¶
Parse sets the environment using AWS SSM. All parameters are fetched from
SSM using the provided path, and used to set the current environment.
It is assumed that all parameters are of type "SecureString".
Source Files
¶
Click to show internal directories.
Click to hide internal directories.