Documentation
¶
Overview ¶
Package parameterstore provides an AWS SSM Parameter Store integration block.
Index ¶
- type Block
- func (b *Block) DeleteParameter(ctx context.Context, name string) error
- func (b *Block) GetParameter(ctx context.Context, name string) (string, error)
- func (b *Block) GetParameterDecrypted(ctx context.Context, name string) (string, error)
- func (b *Block) GetParametersByPath(ctx context.Context, path string) (map[string]string, error)
- func (b *Block) Init(ctx context.Context) error
- func (b *Block) Name() string
- func (b *Block) PutParameter(ctx context.Context, name, value string, paramType types.ParameterType, ...) error
- func (b *Block) Shutdown(_ context.Context) error
- type Option
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 ¶
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 ¶
DeleteParameter removes a parameter by name.
func (*Block) GetParameter ¶
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 ¶
GetParameterDecrypted retrieves a SecureString parameter with decryption forced on, regardless of the block-level WithDecryption setting.
func (*Block) GetParametersByPath ¶
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) 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.
type Option ¶
type Option func(*blockConfig)
Option configures a Parameter Store Block.
func WithAWSConfig ¶
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 ¶
WithEndpoint overrides the SSM endpoint.
func WithPathPrefix ¶
WithPathPrefix sets a base path prepended to all parameter names. For example, "/myapp/prod" + "/db/password" → "/myapp/prod/db/password".
func WithProfile ¶
WithProfile selects a named AWS credentials profile.