Documentation
¶
Overview ¶
Package awssecrets provides an implementation of fs.ReadFileFS that reads secrets from the AWS secretsmanager.
Index ¶
- type Client
- type Option
- type T
- func (smfs *T) Delete(ctx context.Context, nameOrArn string) error
- func (smfs *T) Open(name string) (fs.File, error)
- func (smfs *T) ReadFile(name string) ([]byte, error)
- func (smfs *T) ReadFileCtx(ctx context.Context, nameOrArn string) ([]byte, error)
- func (smfs *T) WriteFileCtx(ctx context.Context, nameOrArn string, data []byte, _ fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
ListSecretVersionIds(ctx context.Context, params *secretsmanager.ListSecretVersionIdsInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.ListSecretVersionIdsOutput, error)
GetSecretValue(ctx context.Context, params *secretsmanager.GetSecretValueInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.GetSecretValueOutput, error)
DeleteSecret(ctx context.Context, params *secretsmanager.DeleteSecretInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.DeleteSecretOutput, error)
PutSecretValue(ctx context.Context, params *secretsmanager.PutSecretValueInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.PutSecretValueOutput, error)
CreateSecret(ctx context.Context, params *secretsmanager.CreateSecretInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.CreateSecretOutput, error)
DescribeSecret(ctx context.Context, params *secretsmanager.DescribeSecretInput, optFns ...func(*secretsmanager.Options)) (*secretsmanager.DescribeSecretOutput, error)
}
Client represents the set of AWS Secrets service methods used by awssecretsfs.
type Option ¶
type Option func(o *options)
Option represents an option to New.
func WithAllowCreation ¶
WithAllowCreation specifies whether creation of new secrets is allowed.
func WithAllowUpdates ¶
WithAllowUpdates specifies whether writes to existing secrets are allowed.
func WithRecoveryDelay ¶
WithRecoveryDelay specifies the number of days to retain a secret after deletion. Set to 0 for immediate deletion without recovery, the default is 7 days.
func WithSecretsClient ¶
WithSecretsClient specifies the secretsmanager.Client to use. If not specified, a new is created.
func WithSecretsOptions ¶
func WithSecretsOptions(opts ...func(*secretsmanager.Options)) Option
WithSecretsOptions wraps secretsmanager.Options for use when creating an s3.Client.
type T ¶
type T struct {
// contains filtered or unexported fields
}
T implements fs.ReadFileFS for secretsmanager.
func NewSecretsFS ¶
NewSecretsFS creates a new instance of T.
func (*T) Delete ¶
Delete deletes the secret with the given name. Name can be the short name of the secret or the ARN.
func (*T) ReadFile ¶
ReadFile implements fs.ReadFileFS. Name can be the short name of the secret or the ARN.
func (*T) ReadFileCtx ¶
ReadFileCtx is like ReadFile but with a context.