appconfig

package
v0.0.0-...-3f59448 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package appconfig manages the configuration of the agent.

Package appconfig manages the configuration of the agent.

Package appconfig manages the configuration of the agent.

Package appconfig manages the configuration of the agent.

Index

Constants

View Source
const (
	// Agent defaults
	DefaultAgentName = "amazon-ssm-agent"

	DefaultCommandWorkersLimit    = 1
	DefaultCommandWorkersLimitMin = 1
	DefaultCommandWorkersLimitMax = 10

	DefaultCommandRetryLimit    = 15
	DefaultCommandRetryLimitMin = 1
	DefaultCommandRetryLimitMax = 100

	DefaultStopTimeoutMillis    = 20000
	DefaultStopTimeoutMillisMin = 10000
	DefaultStopTimeoutMillisMax = 1000000

	// SSM defaults
	DefaultSsmHealthFrequencyMinutes    = 5
	DefaultSsmHealthFrequencyMinutesMin = 5
	DefaultSsmHealthFrequencyMinutesMax = 60

	//aws-ssm-agent bookkeeping constants
	DefaultLocationOfPending   = "pending"
	DefaultLocationOfCurrent   = "current"
	DefaultLocationOfCompleted = "completed"
	DefaultLocationOfCorrupt   = "corrupt"
	DefaultLocationOfState     = "state"
	// DefaultCommandRootDirName is the root directory for storing command states
	DefaultCommandRootDirName = "command"

	// Permissions defaults
	//NOTE: Limit READ, WRITE and EXECUTE access to administrators/root.
	ReadWriteAccess        = 0600
	ReadWriteExecuteAccess = 0700

	// ExitCodes
	SuccessExitCode = 0
	ErrorExitCode   = 1

	// DefaultPluginConfig is a default config with which the plugins are initialized
	DefaultPluginConfig = "aws:defaultPluginConfig"

	// PluginNameAwsAgentUpdate is the name for agent update plugin
	PluginNameAwsAgentUpdate = "aws:updateSsmAgent"

	AppConfigFileName    = "amazon-ssm-agent.json"
	SeelogConfigFileName = "seelog.xml"
)
View Source
const (
	// DefaultProgramFolder is the default folder for SSM
	DefaultProgramFolder = "/etc/amazon/ssm/"

	// AppConfigPath is the path of the AppConfig
	AppConfigPath = DefaultProgramFolder + AppConfigFileName

	// DownloadRoot specifies the directory under which files will be downloaded
	DownloadRoot = "/var/log/amazon/ssm/download/"

	// DefaultDataStorePath represents the directory for storing system data
	DefaultDataStorePath = "/var/lib/amazon/ssm/"

	// UpdaterArtifactsRoot represents the directory for storing update related information
	UpdaterArtifactsRoot = "/var/lib/amazon/ssm/update/"

	// PluginNameAwsRunScript is the name for run script plugin
	PluginNameAwsRunScript = "aws:runShellScript"

	// RebootExitCode that would trigger a Soft Reboot
	RebootExitCode = 194
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	Name                 string
	Version              string
	Region               string
	OrchestrationRootDir string
	DownloadRootDir      string
}

AgentInfo represents metadata for amazon-ssm-agent

type CredentialProfile

type CredentialProfile struct {
	Path         string
	Name         string
	ShareCreds   bool
	ShareProfile string
}

CredentialProfile represents configurations for aws credential profile

type MdsCfg

type MdsCfg struct {
	Endpoint            string
	CommandWorkersLimit int
	StopTimeoutMillis   int64
	CommandRetryLimit   int
}

MdsCfg represents configuration for Message delivery service (MDS)

type Mock

type Mock struct {
	mock.Mock
}

Mock mocks a AppConfig.

func NewMockAppConfig

func NewMockAppConfig() *Mock

NewMockAppConfig returns an instance of Mock for AppConfig.

func (*Mock) GetConfig

func (m *Mock) GetConfig(reload bool) (appconfig SsmagentConfig, errs []error)

GetConfig is a mocked method that just returns what mock tells it to.

type OsInfo

type OsInfo struct {
	Lang    string
	Name    string
	Version string
}

OsInfo represents os related information

type S3Cfg

type S3Cfg struct {
	Region    string
	LogBucket string
	LogKey    string
}

S3Cfg represents configurations related to S3 bucket and key for SSM

type SsmCfg

type SsmCfg struct {
	Endpoint               string
	HealthFrequencyMinutes int
	// TODO: test hook, can be removed before release
	// this is to skip ssl verification for the beta self signed certs
	InsecureSkipVerify bool
}

SsmCfg represents configuration for Simple system manager (SSM)

type SsmagentConfig

type SsmagentConfig struct {
	Profile CredentialProfile
	Mds     MdsCfg
	Ssm     SsmCfg
	Agent   AgentInfo
	Os      OsInfo
	S3      S3Cfg
}

SsmagentConfig stores agent configuration values.

func Config

func Config(reload bool) (SsmagentConfig, error)

Config loads the app configuration for amazon-ssm-agent. If reload is true, it loads the config afresh, otherwise it returns a previous loaded version, if any.

func DefaultConfig

func DefaultConfig() SsmagentConfig

DefaultConfig returns default ssm agent configuration

func (SsmagentConfig) ProfileCredentials

func (config SsmagentConfig) ProfileCredentials() (credsInConfig *credentials.Credentials, err error)

ProfileCredentials checks to see if specific profile is being asked to use

Jump to

Keyboard shortcuts

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