Documentation ¶
Index ¶
Constants ¶
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 ¶
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 ¶
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.