ssm

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 6 Imported by: 0

README

go-ssm-aws

A thin go client that interfaces with AWS SSM.

Why this package?

This package is a thin wrapper over the aws-sdk-go and hides the complexity dealing with the GO AWS SDK. A good use case for this package is when secure parameters for an application are stored in AWS Parameter Store. During application startup this package can be used to fetch the params (typically DB Hostname, username, password etc) and can be used in the application.

Example

Installation
go get -u github.com/IamMayankThakur/go-ssm-aws
Basic Usage
    // If the following parameters are present in SSM:
    // /path/to/key  -> with value "value" 

    import "github.com/IamMayankThakur/go-ssm-aws"

    cfg := ssm.Config {
        Enabled: true
        SecretsPath: "/my-service/dev"
        Region: "us-east-1"
    }
    ssmClient, err := ssm.New(&cfg)
    if err != nil {
        return err
    }
    // And getting a specific value
    value, err := ssmClient.GetValueByName("param-1", true)
    // value should be "value"

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidConfig       = errors.New("config cannot be nil")
	ErrConfigInvalidRegion = errors.New("region not found: ssm region is a required config")
	ErrSSMNotEnabled       = errors.New("ssm is disabled")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) (*Client, error)

func (*Client) GetValueByName

func (c *Client) GetValueByName(name string, decrypt bool) (string, error)

type Config

type Config struct {
	Enabled     bool
	SecretsPath string
	Region      string
}

Jump to

Keyboard shortcuts

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