psadm

package module
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2019 License: BSD-3-Clause Imports: 6 Imported by: 0

README

psadm - A library and command-line tool for AWS Systems Manager Parameter Store

It provides the import and export features for SSM Parameter Store via the library.

Features

psadm provides the API client with the following additional feature to aws-sdk-go's one:

Use-case

  • use with Lambda functions
  • use with daemon on initializaton

Installation

go get -u github.com/nabeken/psadm/cmd/psadm

Usage

To export parameters in YAML to STDOUT:

psadm export [--key-prefix=PREFIX] > exported.yml

Note: All SecureString parameters are decrypted.

To import from exported parameters in YAML:

psadm import [--dryrun] [--skip-exist] [--overwrite] [--default-kms-key-id=KMS-KEY-ID] exported.yml

To get a parameter at give time in YAML:

psadm get [--at=TIME] KEY

Tutorial

TBD

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedClient

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

func (*CachedClient) GetParameter

func (c *CachedClient) GetParameter(key string) (string, error)

func (*CachedClient) GetParameterByTime

func (c *CachedClient) GetParameterByTime(key string, at time.Time) (*Parameter, error)

func (*CachedClient) GetParameterWithDescription

func (c *CachedClient) GetParameterWithDescription(key string) (*Parameter, error)

func (*CachedClient) GetParametersByPath

func (c *CachedClient) GetParametersByPath(pathPrefix string) ([]*Parameter, error)

type Client

type Client struct {
	SSM ssmClient
}

Client wraps SSM client for psadm.

func NewClient

func NewClient(sess *session.Session) *Client

NewClient returns an AWS wrapper client fr psadm.

func (*Client) CachedClient

func (c *Client) CachedClient(cache *cache.Cache) *CachedClient

func (*Client) GetParameter

func (c *Client) GetParameter(key string) (string, error)

GetParameter returns the decrypted parameter.

func (*Client) GetParameterByTime

func (c *Client) GetParameterByTime(key string, at time.Time) (*Parameter, error)

GetParameterByTime returns the latest parameter.

func (*Client) GetParameterWithDescription

func (c *Client) GetParameterWithDescription(key string) (*Parameter, error)

func (*Client) GetParametersByPath

func (c *Client) GetParametersByPath(pathPrefix string) ([]*Parameter, error)

GetParametersByPath gets all parameters having given path prefix.

func (*Client) PutParameter

func (c *Client) PutParameter(param *Parameter, overwrite bool) error

PutParameter puts param into Parameter Store.

type Parameter

type Parameter struct {
	Description string `yaml:"description"`
	KMSKeyID    string `yaml:"kmskeyid"`
	Name        string `yaml:"name"`
	Type        string `yaml:"type"`
	Value       string `yaml:"value"`
}

Parameter is the parameter exported by psadm. This should be sufficient for import and export.

Source Files

Directories

Path Synopsis
cmd
psadm
psadm is a tool for EC2 System Manager Parameter Store.
psadm is a tool for EC2 System Manager Parameter Store.

Jump to

Keyboard shortcuts

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