parameterstore

package module
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package parameterstore implements a koanf.Provider for AWS Systems Manager Parameter Store.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config[T Input] struct {
	// Delim is the delimiter to use
	// when specifying config key paths, for instance a . for `parent.child.key`
	// or a / for `parent/child/key`.
	Delim string

	// Input is the input to get parameters.
	Input T

	// OptFns is the additional functional options to get parameters.
	OptFns []func(*ssm.Options)

	// Callback is an optional callback that takes a (key, value)
	// with the variable name and value and allows you to modify both.
	// If the callback returns an empty key, the variable will be ignored.
	Callback func(key, value string) (string, interface{})
}

Config represents a ParameterStore provider configuration.

type Input

Input is a constraint that permits any input type to get paramers from AWS Systems Manager Parameter Store.

type ParameterStore

type ParameterStore[T Input] struct {
	// contains filtered or unexported fields
}

ParameterStore implements an AWS Systems Manager Parameter Store provider.

func Provider

func Provider[T Input](config Config[T]) (*ParameterStore[T], error)

Provider returns a ParameterStore provider. The AWS Systems Manager Client is configured via environment variables. The configuration values are read from the environment variables.

  • AWS_REGION
  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
  • AWS_SESSION_TOKEN

func ProviderWithClient

func ProviderWithClient[T Input](config Config[T], client *ssm.Client) *ParameterStore[T]

ProviderWithClient returns a ParameterStore provider using an existing AWS Systems Manager client.

func (*ParameterStore[T]) Read

func (ps *ParameterStore[T]) Read() (map[string]interface{}, error)

Read returns a nested config map.

func (*ParameterStore[T]) ReadBytes

func (ps *ParameterStore[T]) ReadBytes() ([]byte, error)

ReadBytes is not supported by the ParameterStore provider.

Jump to

Keyboard shortcuts

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