Documentation ¶
Overview ¶
Package secretsmanager provides a client to make API requests to AWS Secrets Manager.
Index ¶
- type DescribeSecretOutput
- type ErrSecretAlreadyExists
- type ErrSecretNotFound
- type SecretsManager
- func (s *SecretsManager) CreateSecret(secretName, secretString string) (string, error)
- func (s *SecretsManager) DeleteSecret(secretName string) error
- func (s *SecretsManager) DescribeSecret(secretName string) (*DescribeSecretOutput, error)
- func (s *SecretsManager) GetSecretValue(ctx context.Context, name string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DescribeSecretOutput ¶ added in v1.16.0
type DescribeSecretOutput struct { Name *string CreatedDate *time.Time Tags []*secretsmanager.Tag }
DescribeSecretOutput is the output returned by DescribeSecret.
type ErrSecretAlreadyExists ¶
type ErrSecretAlreadyExists struct {
// contains filtered or unexported fields
}
ErrSecretAlreadyExists occurs if a secret with the same name already exists.
func (*ErrSecretAlreadyExists) Error ¶
func (err *ErrSecretAlreadyExists) Error() string
type ErrSecretNotFound ¶ added in v1.16.0
type ErrSecretNotFound struct {
// contains filtered or unexported fields
}
ErrSecretNotFound occurs if a secret with the given name does not exist.
func (*ErrSecretNotFound) Error ¶ added in v1.16.0
func (err *ErrSecretNotFound) Error() string
type SecretsManager ¶
type SecretsManager struct {
// contains filtered or unexported fields
}
SecretsManager wraps the AWS SecretManager client.
func New ¶
func New(s *session.Session) *SecretsManager
New returns a SecretsManager configured against the input session.
func (*SecretsManager) CreateSecret ¶
func (s *SecretsManager) CreateSecret(secretName, secretString string) (string, error)
CreateSecret creates a secret using the default KMS key "aws/secretmanager" to encrypt the secret and returns its ARN.
func (*SecretsManager) DeleteSecret ¶
func (s *SecretsManager) DeleteSecret(secretName string) error
DeleteSecret force removes the secret from SecretsManager.
func (*SecretsManager) DescribeSecret ¶ added in v1.16.0
func (s *SecretsManager) DescribeSecret(secretName string) (*DescribeSecretOutput, error)
DescribeSecret retrieves the details of a secret.
func (*SecretsManager) GetSecretValue ¶ added in v1.29.1
GetSecretValue retrieves the value of a secret from AWS Secrets Manager. It takes the name of the secret as input and returns the corresponding value as a string.