aws

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AWSCURRENT  = "AWSCURRENT"  // latest
	AWSPREVIOUS = "AWSPREVIOUS" // latest - 1
	AWSPENDING  = "AWSPENDING"  // Temporary while secret is being rotated
)

AWS Staging Labels are used to access secret versions by an alias, retrieving versions such as the latest version.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the AWS Secrets Manager Client wrapper. Implements secretly.Client

func NewClient

func NewClient(cfg Config, cfgs ...*aws.Config) *Client

NewClient returns an AWS Secrets Manager client wrapper with the configs applied. Will error if authentication with the secrets manager fails.

func Wrap

func Wrap(client *secretsmanager.SecretsManager, cfg Config) *Client

Wrap wraps the AWS Secrets Manager client.

func (*Client) GetSecret

func (c *Client) GetSecret(ctx context.Context, name string) ([]byte, error)

GetSecret retrieves the secret labeled AWSCURRENT for name from AWS Secrets Manager.

func (*Client) GetSecretWithVersion

func (c *Client) GetSecretWithVersion(ctx context.Context, name, versionOrVersionStage string) ([]byte, error)

GetSecretWithVersion retrieves the specific secret version for name from AWS Secrets Manager.

Note: The version provided can be either a version id or one of the default version staging labels, AWSCURRENT, AWSPREVIOUS, or AWSPENDING.

func (*Client) Process

func (c *Client) Process(spec any, opts ...secretly.ProcessOption) error

Process resolves the provided specification using AWS Secrets Manager. ProcessOptions can be provided to add additional processing for the fields, like reading version info from the env or a file.

(*Client).Process is a convenience for calling secretly.Process with the Client.

type Config

type Config struct {
	// ConfigProvider provides service clients with a client.Config.
	ConfigProvider client.ConfigProvider

	SecretlyConfig secretly.Config
}

Config provides both AWS Secrets Manager client and secretly wrapper configurations.

Jump to

Keyboard shortcuts

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