Documentation
¶
Overview ¶
Package awsssm provides an AWS Systems Manager Parameter Store provider.
AWS SSM Parameter Store is a hierarchical configuration store. It's commonly used for storing configuration parameters, secrets, and other data that applications need at runtime.
Key Differences from AWS Secrets Manager (awssm) ¶
- Hierarchical paths: Parameters are organized in paths like /myapp/prod/DB_HOST
- Parameter types: String, StringList, and SecureString (encrypted)
- Free tier: Standard parameters are free, making it cost-effective
- Path-based retrieval: Can fetch all parameters under a path prefix
Setting up the environment ¶
Flags (not recommended):
configurer l awsssm \ --region "us-east-1" \ --path "/myapp/prod" \ --profile "default" -- env
Or for a single parameter:
configurer l awsssm \ --region "us-east-1" \ --parameter-name "/myapp/prod/DB_HOST" \ --profile "default" -- env
Environment Variables (recommended):
export AWS_REGION="us-east-1" export AWS_PROFILE="default" export AWSSSM_PATH="/myapp/prod" configurer l awsssm -- env
Index ¶
Constants ¶
const Name = "awsssm"
Name of the provider.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New( override, rawValue bool, config *Config, paramInfo *ParameterInformation, ) (provider.IProvider, error)
New creates a new AWS SSM Parameter Store provider.
The following environment variables can be used to configure the provider:
- AWS_REGION: The AWS region where parameters are stored.
- AWS_PROFILE: The AWS profile to use for authentication.
- AWS_ACCESS_KEY_ID: The AWS access key ID (not recommended, use IAM roles instead).
- AWS_SECRET_ACCESS_KEY: The AWS secret access key (not recommended, use IAM roles instead).
- AWSSSM_PATH: The parameter path prefix to load.
- AWSSSM_PARAMETER_NAME: A specific parameter name to load.
NOTE: It's recommended to use IAM roles for authentication instead of access keys.
func NewWithConfig ¶
func NewWithConfig( override, rawValue bool, config *Config, paramInfo *ParameterInformation, awsConfig aws.Config, ) (provider.IProvider, error)
NewWithConfig creates a new AWS SSM Parameter Store provider with custom AWS configuration.
Types ¶
type AWSSSM ¶
type AWSSSM struct {
*provider.Provider `json:"-" validate:"required"`
*Config `json:"-" validate:"required"`
*ParameterInformation `json:"-" validate:"required"`
// contains filtered or unexported fields
}
AWSSSM provider definition.
type Config ¶
type Config struct {
Region string `json:"region" validate:"omitempty,gte=1"`
Profile string `json:"profile" validate:"omitempty,gte=1"`
AccessKey string `json:"access_key" validate:"omitempty,gte=1"`
SecretKey string `json:"secret_key" validate:"omitempty,gte=1"`
}
Config contains AWS configuration settings.
type ParameterInformation ¶
type ParameterInformation struct {
// ParameterNames is a list of specific parameter names to retrieve.
ParameterNames []string `json:"parameter_names" validate:"omitempty"`
// Path is a parameter path prefix. If set, all parameters under this path
// will be retrieved recursively.
Path string `json:"path" validate:"omitempty"`
// Recursive determines whether to recursively retrieve all parameters under Path.
// Only applicable when Path is set.
Recursive bool `json:"recursive"`
// WithDecryption determines whether to decrypt SecureString parameters.
// When using the CLI, this defaults to true (decryption enabled).
// When using the library directly, set this explicitly.
WithDecryption bool `json:"with_decryption"`
}
ParameterInformation contains information about which parameters to retrieve.