Documentation ¶
Overview ¶
Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at
http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( ContainerDepsDirPrefix = "/ecs-execute-command-" SSMAgentBinName = "amazon-ssm-agent" SSMAgentWorkerBinName = "ssm-agent-worker" SessionWorkerBinName = "ssm-session-worker" HostLogDir = "/var/log/ecs/exec" ContainerLogDir = "/var/log/amazon/ssm" ECSAgentExecLogDir = "/log/exec" HostCertFile = "/var/lib/ecs/deps/execute-command/certs/tls-ca-bundle.pem" ContainerCertFileSuffix = "certs/amazon-ssm-agent.crt" ContainerConfigDirName = "config" ContainerConfigFileSuffix = "configuration/" + containerConfigFileName // ECSAgentExecConfigDir is the directory where ECS Agent will write the ExecAgent config files to ECSAgentExecConfigDir = ecsAgentExecDepsDir + "/" + ContainerConfigDirName // HostExecConfigDir is the dir where ExecAgents Config files will live HostExecConfigDir = hostExecDepsDir + "/" + ContainerConfigDirName ExecAgentLogConfigFileName = "seelog.xml" ContainerLogConfigFile = "configuration/" + ExecAgentLogConfigFileName )
Variables ¶
var GetExecAgentConfigFileName = getAgentConfigFileName
var GetExecAgentLogConfigFile = getAgentLogConfigFile
Functions ¶
func IsExecEnabledContainer ¶
func IsExecEnabledContainer(container *apicontainer.Container) bool
func IsExecEnabledTask ¶
func NewManager ¶
func NewManager() *manager
func NewManagerWithBinDir ¶
func NewManagerWithBinDir(hostBinDir string) *manager
Types ¶
type AgentMetadata ¶
type AgentMetadata struct { PID string `json:"PID"` DockerExecID string `json:"DockerExecID"` CMD string `json:"CMD"` }
AgentMetadata holds metadata about the exec agent running inside the container (i.e. SSM Agent).
func MapToAgentMetadata ¶
func MapToAgentMetadata(md map[string]interface{}) AgentMetadata
func (*AgentMetadata) String ¶
func (md *AgentMetadata) String() string
func (*AgentMetadata) ToMap ¶
func (md *AgentMetadata) ToMap() map[string]interface{}
type Manager ¶
type Manager interface { InitializeContainer(taskId string, container *apicontainer.Container, hostConfig *dockercontainer.HostConfig) error StartAgent(ctx context.Context, client dockerapi.DockerClient, task *apitask.Task, container *apicontainer.Container, containerId string) error RestartAgentIfStopped(ctx context.Context, client dockerapi.DockerClient, task *apitask.Task, container *apicontainer.Container, containerId string) (RestartStatus, error) }
type RestartStatus ¶
type RestartStatus int
const ( HostBinDir = hostExecDepsDir + "/bin" ExecuteCommandAgentName = ecs.ManagedAgentNameExecuteCommandAgent Restarted RestartStatus = iota NotRestarted Unknown )
func (RestartStatus) String ¶
func (rs RestartStatus) String() string
type StartError ¶
type StartError struct {
// contains filtered or unexported fields
}
func (StartError) Retry ¶
func (e StartError) Retry() bool