awssecretsfs

package
v0.0.0-...-b955eaa Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 12 Imported by: 1

README

Package cloudeng.io/aws/awssecretsfs

import cloudeng.io/aws/awssecretsfs

Package awssecrets provides an implementation of fs.ReadFileFS that reads secrets from the AWS secretsmanager.

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.

Functions
func WithAllowCreation(allow bool) Option

WithAllowCreation specifies whether creation of new secrets is allowed.

func WithAllowUpdates(allow bool) Option

WithAllowUpdates specifies whether writes to existing secrets are allowed.

func WithRecoveryDelay(days int64) Option

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(client Client) Option

WithSecretsClient specifies the secretsmanager.Client to use. If not specified, a new is created.

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.

Functions
func New(cfg aws.Config, options ...Option) *T

New creates a new instance of fs.ReadFile backed by the secretsmanager.

func NewSecretsFS(cfg aws.Config, options ...Option) *T

NewSecretsFS creates a new instance of T.

Methods
func (smfs *T) Delete(ctx context.Context, nameOrArn string) error

Delete deletes the secret with the given name. Name can be the short name of the secret or the ARN.

func (smfs *T) Open(name string) (fs.File, error)

Open implements fs.FS. Name can be the short name of the secret or the ARN.

func (smfs *T) ReadFile(name string) ([]byte, error)

ReadFile implements fs.ReadFileFS. Name can be the short name of the secret or the ARN.

func (smfs *T) ReadFileCtx(ctx context.Context, nameOrArn string) ([]byte, error)

ReadFileCtx is like ReadFile but with a context.

func (smfs *T) WriteFileCtx(ctx context.Context, nameOrArn string, data []byte, _ fs.FileMode) error

Documentation

Overview

Package awssecrets provides an implementation of fs.ReadFileFS that reads secrets from the AWS secretsmanager.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func WithAllowCreation(allow bool) Option

WithAllowCreation specifies whether creation of new secrets is allowed.

func WithAllowUpdates

func WithAllowUpdates(allow bool) Option

WithAllowUpdates specifies whether writes to existing secrets are allowed.

func WithRecoveryDelay

func WithRecoveryDelay(days int64) Option

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

func WithSecretsClient(client Client) Option

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 New

func New(cfg aws.Config, options ...Option) *T

New creates a new instance of fs.ReadFile backed by the secretsmanager.

func NewSecretsFS

func NewSecretsFS(cfg aws.Config, options ...Option) *T

NewSecretsFS creates a new instance of T.

func (*T) Delete

func (smfs *T) Delete(ctx context.Context, nameOrArn string) error

Delete deletes the secret with the given name. Name can be the short name of the secret or the ARN.

func (*T) Open

func (smfs *T) Open(name string) (fs.File, error)

Open implements fs.FS. Name can be the short name of the secret or the ARN.

func (*T) ReadFile

func (smfs *T) ReadFile(name string) ([]byte, error)

ReadFile implements fs.ReadFileFS. Name can be the short name of the secret or the ARN.

func (*T) ReadFileCtx

func (smfs *T) ReadFileCtx(ctx context.Context, nameOrArn string) ([]byte, error)

ReadFileCtx is like ReadFile but with a context.

func (*T) WriteFileCtx

func (smfs *T) WriteFileCtx(ctx context.Context, nameOrArn string, data []byte, _ fs.FileMode) error

Jump to

Keyboard shortcuts

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