ssm

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 10, 2022 License: MIT Imports: 5 Imported by: 0

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"
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(path string) error

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".

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL