Documentation
¶
Index ¶
- Variables
- func ClearCachedParameter(name string)
- func DeleteParameter(ctx context.Context, name string) error
- func GetParameterWithCaching(ctx context.Context, name string, withDecryption bool, cacheParam ...bool) (string, error)
- func IsParameterNotFound(err error) bool
- func StoreParameter(ctx context.Context, name, value string) error
- func StoreParameterIfAbsent(ctx context.Context, name, value string, paramType ssm_types.ParameterType) error
- func StoreParameterWithType(ctx context.Context, name, value string, paramType ssm_types.ParameterType) error
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
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 ¶
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.