config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config manages ssmx configuration loading and persistence.

Index

Constants

This section is empty.

Variables

View Source
var DefaultDocAliases = map[string]string{
	"patch":          "AWS-PatchInstanceWithRollback",
	"install":        "AWS-ConfigureAWSPackage",
	"ansible":        "AWS-RunAnsiblePlaybook",
	"update-windows": "AWS-InstallWindowsUpdates",
}

DefaultDocAliases are the built-in SSM document aliases.

Functions

func Dir

func Dir() (string, error)

Dir returns the path to the ssmx config directory (~/.ssmx).

func RemoveAlias

func RemoveAlias(name string) error

RemoveAlias deletes an alias by name and saves.

func Save

func Save(cfg *Config) error

Save writes cfg to ~/.ssmx/config.yaml, creating the directory if needed.

func SetAlias

func SetAlias(name, instanceID string) error

SetAlias adds or updates an alias → instance ID mapping and saves.

func SetSSHKeyPath

func SetSSHKeyPath(path string) error

SetSSHKeyPath stores the SSH key path used by the proxy and saves.

Types

type Config

type Config struct {
	DefaultProfile string            `mapstructure:"default_profile" yaml:"default_profile,omitempty"`
	DefaultRegion  string            `mapstructure:"default_region"  yaml:"default_region,omitempty"`
	SSHKeyPath     string            `mapstructure:"ssh_key_path"    yaml:"ssh_key_path,omitempty"`
	Aliases        map[string]string `mapstructure:"aliases"         yaml:"aliases,omitempty"`
	DocAliases     map[string]string `mapstructure:"doc_aliases"     yaml:"doc_aliases,omitempty"`
}

Config is the full contents of ~/.ssmx/config.yaml.

func Load

func Load() (*Config, error)

Load reads ~/.ssmx/config.yaml, returning an empty Config if the file does not exist yet.

Jump to

Keyboard shortcuts

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