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 ¶
const ( // Agent defaults DefaultAgentName = "amazon-ssm-agent" DefaultCommandWorkersLimit = 5 DefaultCommandWorkersLimitMin = 1 DefaultCommandRetryLimit = 15 DefaultCommandRetryLimitMin = 1 DefaultCommandRetryLimitMax = 100 DefaultStopTimeoutMillis = 20000 DefaultStopTimeoutMillisMin = 10000 DefaultStopTimeoutMillisMax = 1000000 // SSM defaults DefaultSsmHealthFrequencyMinutes = 5 DefaultSsmHealthFrequencyMinutesMin = 5 DefaultSsmHealthFrequencyMinutesMax = 60 DefaultSsmAssociationFrequencyMinutes = 10 DefaultSsmAssociationFrequencyMinutesMin = 5 DefaultSsmAssociationFrequencyMinutesMax = 60 //aws-ssm-agent bookkeeping constants DefaultLocationOfPending = "pending" DefaultLocationOfCurrent = "current" DefaultLocationOfCompleted = "completed" DefaultLocationOfCorrupt = "corrupt" DefaultLocationOfState = "state" DefaultLocationOfAssociation = "association" //aws-ssm-agent bookkeeping constants for long running plugins LongRunningPluginsLocation = "longrunningplugins" LongRunningPluginsHealthCheck = "healthcheck" LongRunningPluginDataStoreLocation = "datastore" LongRunningPluginDataStoreFileName = "store" PluginNameLongRunningPluginInvoker = "lrpminvoker" //aws-ssm-agent bookkeeping constants for inventory plugin InventoryRootDirName = "inventory" CustomInventoryRootDirName = "custom" InventoryContentHashFileName = "contentHash" // DefaultDocumentRootDirName is the root directory for storing command states DefaultDocumentRootDirName = "document" // ConfigurationRootDirName - the configuration folder used in ec2 config ConfigurationRootDirName = "Configuration" // WorkersRootDirName - the worker folder used in ec2 config WorkersRootDirName = "Workers" // Permissions defaults //NOTE: Limit READ, WRITE and EXECUTE access to administrators/root. ReadWriteAccess = 0600 ReadWriteExecuteAccess = 0700 // Common file flags when opening/creating files FileFlagsCreateOrAppend = os.O_APPEND | os.O_WRONLY | os.O_CREATE FileFlagsCreateOrTruncate = os.O_TRUNC | os.O_WRONLY | os.O_CREATE // ExitCodes SuccessExitCode = 0 ErrorExitCode = 1 // DefaultPluginConfig is a default config with which the plugins are initialized DefaultPluginConfig = "aws:defaultPluginConfig" // PluginNameAwsConfigureDaemon is the name for configure daemon plugin PluginNameAwsConfigureDaemon = "aws:configureDaemon" // PluginNameAwsConfigurePackage is the name for configure package plugin PluginNameAwsConfigurePackage = "aws:configurePackage" // PluginNameAwsRunShellScript is the name for run shell script plugin PluginNameAwsRunShellScript = "aws:runShellScript" // PluginNameAwsRunPowerShellScript is the name of the run powershell script plugin PluginNameAwsRunPowerShellScript = "aws:runPowerShellScript" // PluginNameAwsAgentUpdate is the name for agent update plugin PluginNameAwsAgentUpdate = "aws:updateSsmAgent" // PluginEC2ConfigUpdate is the name for ec2 config update plugin PluginEC2ConfigUpdate = "aws:updateAgent" // PluginNameAwsSoftwareInventory is the name for inventory plugin PluginNameAwsSoftwareInventory = "aws:softwareInventory" AppConfigFileName = "amazon-ssm-agent.json" SeelogConfigFileName = "seelog.xml" // PluginNameDomainJoin is the name of domain join plugin PluginNameDomainJoin = "aws:domainJoin" // PluginNameCloudWatch is the name of cloud watch plugin PluginNameCloudWatch = "aws:cloudWatch" // PluginNameRunDockerAction is the name of the docker container plugin PluginNameDockerContainer = "aws:runDockerAction" // PluginNameConfigureDocker is the name of the configure Docker plugin PluginNameConfigureDocker = "aws:configureDocker" // PluginNameRefreshAssociation is the name of refresh association plugin PluginNameRefreshAssociation = "aws:refreshAssociation" )
const ( // DefaultProgramFolder is the default folder for SSM DefaultProgramFolder = "/etc/amazon/ssm/" // AppConfigPath is the path of the AppConfig AppConfigPath = DefaultProgramFolder + AppConfigFileName // PackageRoot specifies the directory under which packages will be downloaded and installed PackageRoot = "/var/lib/amazon/ssm/packages" // PackagePlatform is the platform name to use when looking for packages PackagePlatform = "linux" // DaemonRoot specifies the directory where daemon registration information is stored DaemonRoot = "/var/lib/amazon/ssm/daemons" // LocalCommandRoot specifies the directory where users can submit command documents offline LocalCommandRoot = "/var/lib/amazon/ssm/localcommands" // LocalCommandRootSubmitted is the directory where locally submitted command documents // are moved when they have been picked up LocalCommandRootSubmitted = "/var/lib/amazon/ssm/localcommands/submitted" // LocalCommandRootInvalid is the directory where locally submitted command documents // are moved if the service cannot validate the document (generally impossible via cli) LocalCommandRootInvalid = "/var/lib/amazon/ssm/localcommands/invalid" // 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/" // EC2ConfigDataStorePath represents the directory for storing ec2 config data EC2ConfigDataStorePath = "/var/lib/amazon/ec2config/" // EC2ConfigSettingPath represents the directory for storing ec2 config settings EC2ConfigSettingPath = "/var/lib/amazon/ec2configservice/" // UpdaterArtifactsRoot represents the directory for storing update related information UpdaterArtifactsRoot = "/var/lib/amazon/ssm/update/" // DefaultPluginPath represents the directory for storing plugins in SSM DefaultPluginPath = "/var/lib/amazon/ssm/plugins" // RebootExitCode that would trigger a Soft Reboot RebootExitCode = 194 // Default Custom Inventory Inventory Folder DefaultCustomInventoryFolder = DefaultDataStorePath + "inventory/custom" // PowerShellPluginCommandName is the path of the powershell.exe to be used by the runPowerShellScript plugin PowerShellPluginCommandName = "/usr/bin/powershell" // Used to capture and return exit code for windows powershell script execution - empty for unix shell script case ExitCodeTrap = "" // PowerShellPluginCommandArgs is the arguments of powershell.exe to be used by the runPowerShellScript plugin PowerShellPluginCommandArgs = "" // Exit Code for a command that exits before completion (generally due to timeout or cancel) CommandStoppedPreemptivelyExitCode = 137 // Fatal error (128) + signal for SIGKILL (9) = 137 // RunCommandScriptName is the script name where all downloaded or provided commands will be stored RunCommandScriptName = "_script.sh" )
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 ¶
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 ¶
Mock mocks a AppConfig.
func NewMockAppConfig ¶
func NewMockAppConfig() *Mock
NewMockAppConfig returns an instance of Mock for AppConfig.
type SsmCfg ¶
type SsmCfg struct { Endpoint string HealthFrequencyMinutes int AssociationFrequencyMinutes int AssociationRetryLimit int // TODO: test hook, can be removed before release // this is to skip ssl verification for the beta self signed certs InsecureSkipVerify bool CustomInventoryDefaultLocation string }
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