Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
const ( Cluster = "ecs_cluster" CreatedAt = "ecs_created_at" TaskFamily = "ecs_task_family" ServiceDesiredCount = "ecs_service_desired_count" ServiceRunningCount = "ecs_service_running_count" )
TaskFamily is the key that stores the task family of an ECS Task
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EcsClient ¶ added in v1.2.0
type EcsClient interface {
	// Returns a EcsInfo struct containing data needed for a report.
	GetInfo([]string) EcsInfo
}
    EcsClient is a wrapper around an AWS client that makes all the needed calls and just exposes the final results. We create an interface so we can mock for testing.
type EcsInfo ¶ added in v1.2.0
type EcsInfo struct {
	Tasks          map[string]EcsTask
	Services       map[string]EcsService
	TaskServiceMap map[string]string
}
    EcsInfo is exported for test
type EcsService ¶ added in v1.2.0
type EcsService struct {
	ServiceName string
	// The following values may be stale in a cached copy
	DeploymentIDs     []string
	DesiredCount      int64
	PendingCount      int64
	RunningCount      int64
	TaskDefinitionARN string
}
    EcsService describes the parts of ECS services we care about. Services are highly mutable and so we can only cache them on a best-effort basis. We have to refresh referenced (ie. has an associated task) services each report but we avoid re-listing services unless we can't find a service for a task. Exported for test.
type EcsTask ¶ added in v1.2.0
type EcsTask struct {
	TaskARN           string
	CreatedAt         time.Time
	TaskDefinitionARN string
	// These started fields are immutable once set, and guaranteed to be set once the task is running,
	// which we know it is because otherwise we wouldn't be looking at it.
	StartedAt time.Time
	StartedBy string // tag or deployment id
}
    EcsTask describes the parts of ECS tasks we care about. Since we're caching tasks heavily, we ensure no mistakes by casting into a structure that only contains immutable attributes of the resource. Exported for test.
      
      Source Files
      ¶
    
- client.go
 - reporter.go