parameterstore

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package parameterstore provides an AWS SSM Parameter Store integration block.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

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

Block is an SSM Parameter Store integration block.

func New

func New(name string, opts ...Option) *Block

New creates a new Parameter Store Block.

block := parameterstore.New("config",
    parameterstore.WithRegion("us-east-1"),
    parameterstore.WithPathPrefix("/myapp/prod"),
    parameterstore.WithDecryption(),
)

func (*Block) DeleteParameter

func (b *Block) DeleteParameter(ctx context.Context, name string) error

DeleteParameter removes a parameter by name.

func (*Block) GetParameter

func (b *Block) GetParameter(ctx context.Context, name string) (string, error)

GetParameter retrieves a single parameter value by name. Decryption is applied when WithDecryption was set on the block or when the parameter is a plain String / StringList.

func (*Block) GetParameterDecrypted

func (b *Block) GetParameterDecrypted(ctx context.Context, name string) (string, error)

GetParameterDecrypted retrieves a SecureString parameter with decryption forced on, regardless of the block-level WithDecryption setting.

func (*Block) GetParametersByPath

func (b *Block) GetParametersByPath(ctx context.Context, path string) (map[string]string, error)

GetParametersByPath retrieves all parameters under path and returns a name → value map. Path is appended to the block's configured prefix. Pagination is handled internally.

func (*Block) Init

func (b *Block) Init(ctx context.Context) error

Init implements core.Block.

func (*Block) Name

func (b *Block) Name() string

Name implements core.Block.

func (*Block) PutParameter

func (b *Block) PutParameter(ctx context.Context, name, value string, paramType types.ParameterType, overwrite bool) error

PutParameter creates or updates a parameter. paramType should be types.ParameterTypeString, types.ParameterTypeStringList, or types.ParameterTypeSecureString.

func (*Block) Shutdown

func (b *Block) Shutdown(_ context.Context) error

Shutdown implements core.Block.

type Option

type Option func(*blockConfig)

Option configures a Parameter Store Block.

func WithAWSConfig

func WithAWSConfig(cfg aws.Config) Option

WithAWSConfig injects a pre-built aws.Config.

func WithDecryption

func WithDecryption() Option

WithDecryption enables automatic decryption of SecureString parameters for all Get operations on this block.

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint overrides the SSM endpoint.

func WithPathPrefix

func WithPathPrefix(prefix string) Option

WithPathPrefix sets a base path prepended to all parameter names. For example, "/myapp/prod" + "/db/password" → "/myapp/prod/db/password".

func WithProfile

func WithProfile(profile string) Option

WithProfile selects a named AWS credentials profile.

func WithRegion

func WithRegion(region string) Option

WithRegion sets the AWS region.

Jump to

Keyboard shortcuts

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