Documentation
¶
Overview ¶
Package param implements the provider.Store contract for AWS Systems Manager Parameter Store. It confines all SSM SDK types to this package: version resolution (absolute #version and ~shift against history) lives here, while spec PARSING stays generic via awsparamversion.Parse.
Index ¶
- type AllowedPattern
- type Client
- type DataType
- type Policies
- type Store
- func (s *Store) Create(ctx context.Context, name, value string, valueType domain.ValueType, ...) (domain.Version, error)
- func (s *Store) Delete(ctx context.Context, name string, _ ...provider.DeleteOption) error
- func (s *Store) Get(ctx context.Context, name string, ref provider.VersionRef) (*domain.Entry, error)
- func (s *Store) History(ctx context.Context, name string) ([]domain.Version, error)
- func (s *Store) List(ctx context.Context) ([]string, error)
- func (s *Store) Put(ctx context.Context, name, value string, valueType domain.ValueType, ...) (domain.Version, error)
- func (s *Store) Resolve(ctx context.Context, name, spec string) (provider.VersionRef, error)
- func (s *Store) Tag(ctx context.Context, name string, add map[string]string) error
- func (s *Store) Untag(ctx context.Context, name string, keys []string) error
- type Tier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedPattern ¶
type AllowedPattern struct {
provider.WriteOptionMarker
Value string
}
AllowedPattern sets a regular expression the parameter value must match. It implements provider.WriteOption.
type Client ¶
type Client interface {
GetParameter(ctx context.Context, params *ssm.GetParameterInput, optFns ...func(*ssm.Options)) (*ssm.GetParameterOutput, error)
GetParameterHistory(
ctx context.Context, params *ssm.GetParameterHistoryInput, optFns ...func(*ssm.Options),
) (*ssm.GetParameterHistoryOutput, error)
PutParameter(ctx context.Context, params *ssm.PutParameterInput, optFns ...func(*ssm.Options)) (*ssm.PutParameterOutput, error)
DeleteParameter(ctx context.Context, params *ssm.DeleteParameterInput, optFns ...func(*ssm.Options)) (*ssm.DeleteParameterOutput, error)
DescribeParameters(
ctx context.Context, params *ssm.DescribeParametersInput, optFns ...func(*ssm.Options),
) (*ssm.DescribeParametersOutput, error)
AddTagsToResource(ctx context.Context, params *ssm.AddTagsToResourceInput, optFns ...func(*ssm.Options)) (*ssm.AddTagsToResourceOutput, error)
RemoveTagsFromResource(
ctx context.Context, params *ssm.RemoveTagsFromResourceInput, optFns ...func(*ssm.Options),
) (*ssm.RemoveTagsFromResourceOutput, error)
ListTagsForResource(
ctx context.Context, params *ssm.ListTagsForResourceInput, optFns ...func(*ssm.Options),
) (*ssm.ListTagsForResourceOutput, error)
}
Client is the narrow SSM Parameter Store surface this adapter needs. The concrete *ssm.Client satisfies it; tests provide their own mock.
type DataType ¶
type DataType struct {
provider.WriteOptionMarker
Value string
}
DataType sets the SSM parameter data type (e.g. "text" or "aws:ec2:image"). It implements provider.WriteOption.
type Policies ¶
type Policies struct {
provider.WriteOptionMarker
JSON string
}
Policies sets the parameter policies as a JSON document (expiration, no-change notification, etc.). It implements provider.WriteOption.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the SSM Parameter Store implementation of provider.Store.
func (*Store) Create ¶
func (s *Store) Create( ctx context.Context, name, value string, valueType domain.ValueType, description string, opts ...provider.WriteOption, ) (domain.Version, error)
Create creates a new parameter (Overwrite=false) and returns the resulting version. It returns a wrapped provider.ErrAlreadyExists if the parameter already exists.
func (*Store) Delete ¶
Delete removes a parameter. Parameter Store exposes no delete options, so any provided DeleteOptions are ignored. A missing parameter maps to the wrapped provider.ErrNotFound sentinel so callers can treat it idempotently.
func (*Store) Get ¶
func (s *Store) Get(ctx context.Context, name string, ref provider.VersionRef) (*domain.Entry, error)
Get retrieves the parameter at the given ref (latest when ref is latest), decrypting SecureString values, and maps it to a domain.Entry with tags.
func (*Store) Put ¶
func (s *Store) Put( ctx context.Context, name, value string, valueType domain.ValueType, description string, opts ...provider.WriteOption, ) (domain.Version, error)
Put creates or updates a parameter (Overwrite=true) and returns the resulting version.
func (*Store) Resolve ¶
Resolve parses the version spec (generic) and resolves it (SSM-specific) to an opaque VersionRef holding the concrete version number. An empty/latest spec resolves to the latest ref (empty id).
type Tier ¶
type Tier struct {
provider.WriteOptionMarker
Value string
}
Tier sets the SSM parameter tier (Standard, Advanced, or Intelligent-Tiering). It implements provider.WriteOption.