ssm

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 4 Imported by: 0

README

go-ssm Go Report Card Generic badge Go Reference

Package ssm provides the client and types for making API requests to Amazon Simple Systems Manager (SSM).

import "github.com/pradeeprajagopal/go-ssm"
What is SSM?

AWS Systems Manager Parameter Store provides secure, hierarchical storage for configuration data management and secrets management

How to use?
1.Get Parameter value:
package main
import (
    "github.com/pradeeprajagopal/go-ssm"
    "log"
)

func main() {
	svc := ssm.New()
	result,err := svc.Param("ParameterName", true).GetValue()
	if err != nil {
		log.Println(err)
	}
	log.Println(result)
}

OUTPUT: MyParameterOutput

2. Get Multiple parameter Value:
	value, _ := ssmsvc.Params(names, true).GetValues()
	log.Println(value)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Param

type Param struct {
	// Name of the parameter
	// example:  MyParameterKey
	// required: true
	Name string
	// WithDecryption is mandatory only if the value is SecureString
	// example:  MyParameterKey
	// required: false
	WithDecryption bool
	// contains filtered or unexported fields
}

Param input for querying a parameter from the store

func (*Param) GetValue

func (p *Param) GetValue() (string, error)

GetValue type receives Param as receiver and returns the value in the form of string and error

type Params

type Params struct {
	// Names of the parameters in the form of list
	// required: true
	Names []*string
	// WithDecryption is mandatory only if the value is SecureString
	// example:  MyParameterKey
	// required: false
	WithDecryption bool
	// contains filtered or unexported fields
}

Params input for querying multiple parameters from the store

func (*Params) GetValues

func (p *Params) GetValues() ([]string, error)

GetValues type receives Params as receiver and returns the value in the form of list of string and error

type SSM

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

SSM is a SSM API client.

func New

func New() *SSM

New an exported function used to create a new SSM session with default credentials.

func (*SSM) Param

func (s *SSM) Param(name string, decryption bool) *Param

Param creates the struct for querying the param store. Type receives a name of the parameter as string and whether the parameter decryption needs to be performed

func (*SSM) Params

func (s *SSM) Params(names []string, decryption bool) *Params

Params creates the struct for querying one more items from the param store. Type receives a name of the parameter as list of string and whether the parameter decryption needs to be performed

Jump to

Keyboard shortcuts

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