aws

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.22.0

type Config struct {
	// Addr is the HTTP address of the AWS Secret
	// Manager. In general, the address has the
	// following form:
	//  secretsmanager.<region>.amazonaws.com
	Addr string

	// Region is the AWS region. Even though the Addr
	// endpoint contains that information already, this
	// field is mandatory.
	Region string

	// The KMSKeyID is the AWS-KMS key ID specifying the
	// AWS-KMS key that is used to encrypt (and decrypt) the
	// values stored at AWS Secrets Manager.
	KMSKeyID string

	// Login contains the AWS credentials (access/secret key).
	Login Credentials
}

Config is a structure containing configuration options for connecting to the AWS SecretsManager.

type Conn added in v0.22.0

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

Conn is a connection to an AWS SecretsManager.

func Connect added in v0.22.0

func Connect(ctx context.Context, config *Config) (*Conn, error)

Connect establishes and returns a Conn to a AWS SecretManager using the given config.

func (*Conn) Create added in v0.22.0

func (c *Conn) Create(ctx context.Context, name string, value []byte) error

Create stores the given key-value pair at the AWS SecretsManager if and only if it doesn't exists. If such an entry already exists it returns kes.ErrKeyExists.

If the SecretsManager.KMSKeyID is set AWS will use this key ID to encrypt the values. Otherwise, AWS will use the default key ID for encrypting secrets at the AWS SecretsManager.

func (*Conn) Delete added in v0.22.0

func (c *Conn) Delete(ctx context.Context, name string) error

Delete removes the key-value pair from the AWS SecretsManager, if it exists.

func (*Conn) Get added in v0.22.0

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

Get returns the value associated with the given key. If no entry for key exists, it returns kes.ErrKeyNotFound.

func (*Conn) List added in v0.22.0

func (c *Conn) List(ctx context.Context) (kms.Iter, error)

List returns a new Iterator over the names of all stored keys.

func (*Conn) Status added in v0.22.0

func (c *Conn) Status(ctx context.Context) (kms.State, error)

Status returns the current state of the AWS SecretsManager instance. In particular, whether it is reachable and the network latency.

type Credentials

type Credentials struct {
	AccessKey    string // The AWS access key
	SecretKey    string // The AWS secret key
	SessionToken string // The AWS session token
}

Credentials represents static AWS credentials: access key, secret key and a session token

Jump to

Keyboard shortcuts

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