param

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 12 Imported by: 0

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 paramversion.Parse.

Index

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 New

func New(client Client) *Store

New builds a Store backed by the given SSM client.

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

func (s *Store) Delete(ctx context.Context, name string, _ ...provider.DeleteOption) error

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) History

func (s *Store) History(ctx context.Context, name string) ([]domain.Version, error)

History returns the parameter's version history, newest first.

func (*Store) List

func (s *Store) List(ctx context.Context) ([]string, error)

List returns the names of all parameters, paging through DescribeParameters.

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

func (s *Store) Resolve(ctx context.Context, name, spec string) (provider.VersionRef, error)

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).

func (*Store) Tag

func (s *Store) Tag(ctx context.Context, name string, add map[string]string) error

Tag adds or updates tags on a parameter.

func (*Store) Untag

func (s *Store) Untag(ctx context.Context, name string, keys []string) error

Untag removes tags (by key) from a parameter.

type Tier

type Tier struct {
	provider.WriteOptionMarker

	Value string
}

Tier sets the SSM parameter tier (Standard, Advanced, or Intelligent-Tiering). It implements provider.WriteOption.

Jump to

Keyboard shortcuts

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