ssmutil

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrParameterExists = errors.New("parameter already exists")

ErrParameterExists reports that StoreParameterIfAbsent found the parameter already set and left it untouched.

Functions

func ClearCachedParameter

func ClearCachedParameter(name string)

ClearCachedParameter drops a parameter's cached value so the next GetParameterWithCaching re-reads it from SSM. Callers that delete or overwrite a cached parameter must use this; otherwise the stale value is served for the rest of the process's life.

func DeleteParameter

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

DeleteParameter deletes a parameter from AWS SSM Parameter Store If you have cached the parameter, clear the cached env vars before deleting the parameter.

func GetParameterWithCaching

func GetParameterWithCaching(ctx context.Context, name string, withDecryption bool, cacheParam ...bool) (string, error)

GetParameterWithCaching retrieves a parameter from AWS SSM Parameter Store with caching. It caches the parameter value in an environment variable with SSM_ prefix (uppercase). cacheParam defaults to true if not provided.

func IsParameterNotFound

func IsParameterNotFound(err error) bool

IsParameterNotFound reports whether err is the SSM "parameter does not exist" error, so callers can detect an absent parameter without importing the SDK error types themselves.

func StoreParameter

func StoreParameter(ctx context.Context, name, value string) error

StoreParameter stores a parameter in AWS SSM Parameter Store as a SecureString

func StoreParameterIfAbsent

func StoreParameterIfAbsent(ctx context.Context, name, value string, paramType ssm_types.ParameterType) error

StoreParameterIfAbsent writes a parameter only when it does not already exist, returning ErrParameterExists otherwise.

Overwrite:false makes this a single atomic operation rather than a read-then-write, which matters for write-once material: a check followed by a put has a window in which two callers both observe "absent" and the second silently replaces the first's value.

func StoreParameterWithType

func StoreParameterWithType(ctx context.Context, name, value string, paramType ssm_types.ParameterType) error

StoreParameterWithType stores a parameter in AWS SSM Parameter Store with specified type

Types

This section is empty.

Jump to

Keyboard shortcuts

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