secretsmanager

package module
v0.0.0-...-8f5d76e Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package secretsmanager implements a koanf.Provider for AWS SecretsManager and provides it to koanf to be parsed by a koanf.Parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// The AWS SecretsManager Delim that might be used
	// delim string
	Delim string

	// The SecretsManager name or arn to fetch
	// name or the secret ID.
	SecretId string

	// The type of values secre value set, it can only be string or map.
	// if the value is type of app, each key is unfallten to create new
	// single var like: parent: {"child": "value"} -> parent.child = value
	Type string

	// The SecretsManager Configuration Version to fetch. Specifying a VersionId
	// ensures that the configuration is only fetched if it is updated. If not specified,
	// the latest available configuration is fetched always.
	// Setting this to the latest configuration version will return an empty slice of bytes.
	VersionId *string

	// The AWS Access Key ID to use. This value is fetched from the environment
	// if not specified.
	AWSAccessKeyID string

	// The AWS Secret Access Key to use. This value is fetched from the environment
	// if not specified.
	AWSSecretAccessKey string

	// The AWS IAM Role ARN to use. Useful for access requiring IAM AssumeRole.
	AWSRoleARN string

	// The AWS Region to use. This value is fetched from teh environment if not specified.
	AWSRegion string

	// Time interval at which the watcher will refresh the configuration.
	// Defaults to 3600 seconds.
	WatchInterval time.Duration
}

Config holds the AWS SecretsManager Configuration.

type SMConfig

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

SMConfig implements an AWS SecretsManager provider.

func Provider

func Provider(cfg Config, cb func(s string) string) *SMConfig

Provider returns an AWS SecretsManager provider.

func ProviderWithClient

func ProviderWithClient(cfg Config, cb func(s string) string, client *secretsmanager.Client) *SMConfig

ProviderWithClient returns an AWS SecretsManager provider using an existing AWS SecretsManager client.

func (*SMConfig) Read

func (sm *SMConfig) Read() (map[string]interface{}, error)

Read is not supported by the SecretsManager provider.

func (*SMConfig) ReadBytes

func (sm *SMConfig) ReadBytes() ([]byte, error)

ReadBytes returns the raw bytes for parsing.

func (*SMConfig) Watch

func (sm *SMConfig) Watch(cb func(event interface{}, err error)) error

Watch polls AWS AppConfig for configuration updates.

Jump to

Keyboard shortcuts

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