psadm

package module
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

README

psadm

Go

psadm is a library and a command-line tool for AWS Systems Manager Parameter Store.

The command-line application 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

Overview

Package psadm is a generated GoMock package.

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
}

CachedClient is a cache-aware psadmin client.

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)

func (*CachedClient) PutParameter added in v0.3.0

func (c *CachedClient) PutParameter(p *Parameter, overrite bool) error

PutParameter forwards a call to the underlying client. It doesn't do any caching.

type Client

type Client struct {
	SSM ssmClient
}

Client wraps the SSM client for psadm.

func NewClient

func NewClient(sess *session.Session) *Client

NewClient returns a psadm client.

func (*Client) CachedClient

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

CachedClient returns a client with caching.

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.

func (*Client) SingleflightClientWithCache added in v0.3.0

func (c *Client) SingleflightClientWithCache(cache *cache.Cache) *SingleflightClient

SingleflightClient returns a client with single flight caching.

type Mockclient added in v0.3.0

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

Mockclient is a mock of client interface.

func NewMockclient added in v0.3.0

func NewMockclient(ctrl *gomock.Controller) *Mockclient

NewMockclient creates a new mock instance.

func (*Mockclient) EXPECT added in v0.3.0

func (m *Mockclient) EXPECT() *MockclientMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*Mockclient) GetParameter added in v0.3.0

func (m *Mockclient) GetParameter(arg0 string) (string, error)

GetParameter mocks base method.

func (*Mockclient) GetParameterByTime added in v0.3.0

func (m *Mockclient) GetParameterByTime(arg0 string, arg1 time.Time) (*Parameter, error)

GetParameterByTime mocks base method.

func (*Mockclient) GetParameterWithDescription added in v0.3.0

func (m *Mockclient) GetParameterWithDescription(arg0 string) (*Parameter, error)

GetParameterWithDescription mocks base method.

func (*Mockclient) GetParametersByPath added in v0.3.0

func (m *Mockclient) GetParametersByPath(arg0 string) ([]*Parameter, error)

GetParametersByPath mocks base method.

func (*Mockclient) PutParameter added in v0.3.0

func (m *Mockclient) PutParameter(arg0 *Parameter, arg1 bool) error

PutParameter mocks base method.

type MockclientMockRecorder added in v0.3.0

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

MockclientMockRecorder is the mock recorder for Mockclient.

func (*MockclientMockRecorder) GetParameter added in v0.3.0

func (mr *MockclientMockRecorder) GetParameter(arg0 interface{}) *gomock.Call

GetParameter indicates an expected call of GetParameter.

func (*MockclientMockRecorder) GetParameterByTime added in v0.3.0

func (mr *MockclientMockRecorder) GetParameterByTime(arg0, arg1 interface{}) *gomock.Call

GetParameterByTime indicates an expected call of GetParameterByTime.

func (*MockclientMockRecorder) GetParameterWithDescription added in v0.3.0

func (mr *MockclientMockRecorder) GetParameterWithDescription(arg0 interface{}) *gomock.Call

GetParameterWithDescription indicates an expected call of GetParameterWithDescription.

func (*MockclientMockRecorder) GetParametersByPath added in v0.3.0

func (mr *MockclientMockRecorder) GetParametersByPath(arg0 interface{}) *gomock.Call

GetParametersByPath indicates an expected call of GetParametersByPath.

func (*MockclientMockRecorder) PutParameter added in v0.3.0

func (mr *MockclientMockRecorder) PutParameter(arg0, arg1 interface{}) *gomock.Call

PutParameter indicates an expected call of PutParameter.

type MockssmClient added in v0.3.0

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

MockssmClient is a mock of ssmClient interface.

func NewMockssmClient added in v0.3.0

func NewMockssmClient(ctrl *gomock.Controller) *MockssmClient

NewMockssmClient creates a new mock instance.

func (*MockssmClient) DescribeParameters added in v0.3.0

DescribeParameters mocks base method.

func (*MockssmClient) EXPECT added in v0.3.0

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockssmClient) GetParameter added in v0.3.0

func (m *MockssmClient) GetParameter(arg0 *ssm.GetParameterInput) (*ssm.GetParameterOutput, error)

GetParameter mocks base method.

func (*MockssmClient) GetParameterHistory added in v0.3.0

GetParameterHistory mocks base method.

func (*MockssmClient) PutParameter added in v0.3.0

func (m *MockssmClient) PutParameter(arg0 *ssm.PutParameterInput) (*ssm.PutParameterOutput, error)

PutParameter mocks base method.

type MockssmClientMockRecorder added in v0.3.0

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

MockssmClientMockRecorder is the mock recorder for MockssmClient.

func (*MockssmClientMockRecorder) DescribeParameters added in v0.3.0

func (mr *MockssmClientMockRecorder) DescribeParameters(arg0 interface{}) *gomock.Call

DescribeParameters indicates an expected call of DescribeParameters.

func (*MockssmClientMockRecorder) GetParameter added in v0.3.0

func (mr *MockssmClientMockRecorder) GetParameter(arg0 interface{}) *gomock.Call

GetParameter indicates an expected call of GetParameter.

func (*MockssmClientMockRecorder) GetParameterHistory added in v0.3.0

func (mr *MockssmClientMockRecorder) GetParameterHistory(arg0 interface{}) *gomock.Call

GetParameterHistory indicates an expected call of GetParameterHistory.

func (*MockssmClientMockRecorder) PutParameter added in v0.3.0

func (mr *MockssmClientMockRecorder) PutParameter(arg0 interface{}) *gomock.Call

PutParameter indicates an expected call of PutParameter.

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.

type SingleflightClient added in v0.3.0

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

SingleflightClient is a duplicate function call suppression client.

func (*SingleflightClient) GetParameter added in v0.3.0

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

func (*SingleflightClient) GetParameterByTime added in v0.3.0

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

func (*SingleflightClient) GetParameterWithDescription added in v0.3.0

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

func (*SingleflightClient) GetParametersByPath added in v0.3.0

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

func (*SingleflightClient) PutParameter added in v0.3.0

func (c *SingleflightClient) PutParameter(p *Parameter, overrite bool) error

PutParameter forwards a call to the underlying client. It doesn't do any deduplication.

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