Documentation
¶
Overview ¶
Package parameterstore loads configuration from AWS Parameter Store.
It requires following permissions to access object from AWS S3:
- ssm:GetParametersByPath
Change notification ¶
By default, it's periodically polls the configuration. It also listens to change events by register it to SNS notifier with one of following setups:
- EventBridge with SNS target
Only following events trigger polling the configuration and other type of events are ignored:
- Parameter Store Change
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(options *options)
Option configures the a ParameterStore with specific options.
func WithAWSConfig ¶
WithAWSConfig provides the AWS Config for the AWS SDK.
By default, it loads the default AWS Config.
func WithFilter ¶
func WithFilter(filters ...types.ParameterStringFilter) Option
WithFilter provides [filter] that will be used to select a set of parameters.
Filters to limit the request results. The following Key values are supported for GetParametersByPath : Type, KeyId, and Label. The following Key values aren't supported for GetParametersByPath : tag, DataType, Name, Path, and Tier .
func WithNameSplitter ¶
WithNameSplitter provides the function used to split parameter names into nested keys. If it returns an nil/[]string{}/[]string{""}, the parameter will be ignored.
For example, with the default splitter, an parameter name like "PARENT/CHILD/KEY" would be split into "PARENT", "CHILD", and "KEY".
func WithPath ¶
WithPath provides the hierarchy for loading parameters from Parameter Store. Only parameters under the given path will be loaded. Hierarchies start with a forward slash (/). The hierarchy is the parameter name except the last part of the parameter.
For example, if the prefix is "/server", only parameters starts with "/server/" will be loaded. By default, the path is "/" for all parameters.
func WithPollInterval ¶
WithPollInterval provides the interval for polling the configuration.
The default interval is 1 minute.
type ParameterStore ¶
type ParameterStore struct {
// contains filtered or unexported fields
}
func New ¶
func New(opts ...Option) *ParameterStore
New creates a ParameterStore with the given endpoint and Option(s).
func (*ParameterStore) OnEvent ¶
func (p *ParameterStore) OnEvent(msg []byte) error
func (*ParameterStore) Status ¶
func (p *ParameterStore) Status(onStatus func(bool, error))
func (*ParameterStore) String ¶
func (p *ParameterStore) String() string