Documentation
¶
Overview ¶
Package task provides support for running Amazon ECS tasks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultClusterGetter ¶
DefaultClusterGetter gets the default cluster.
type EnvRunner ¶
type EnvRunner struct {
// Count of the tasks to be launched.
Count int
// Group Name of the tasks that use the same task definition.
GroupName string
// App and Env in which the tasks will be launched.
App string
Env string
// Interfaces to interact with dependencies. Must not be nil.
VPCGetter VPCGetter
ClusterGetter ResourceGetter
Starter TaskRunner
}
EnvRunner can run an Amazon ECS task in the VPC and the cluster of an environment.
type EventsWriter ¶ added in v0.3.0
type EventsWriter struct {
GroupName string
Tasks []*Task
Writer io.Writer
EventsLogger TaskEventsLogger
Describer TasksDescriber
// contains filtered or unexported fields
}
EventsWriter represents a writer that writes tasks' log events to a writer.
func (*EventsWriter) WriteEventsUntilStopped ¶ added in v0.3.0
func (ew *EventsWriter) WriteEventsUntilStopped() error
WriteEventsUntilStopped writes tasks' events to a writer until all tasks have stopped.
type NetworkConfigRunner ¶
type NetworkConfigRunner struct {
// Count of the tasks to be launched.
Count int
// Group Name of the tasks that use the same task definition.
GroupName string
// Network configuration
Subnets []string
SecurityGroups []string
// Interfaces to interact with dependencies. Must not be nil.
ClusterGetter DefaultClusterGetter
Starter TaskRunner
// Must not be nil if using default subnets.
VPCGetter VPCGetter
}
NetworkConfigRunner runs an Amazon ECS task in the subnets, security groups, and the default cluster.
func (*NetworkConfigRunner) Run ¶
func (r *NetworkConfigRunner) Run() ([]*Task, error)
Run runs tasks in the subnets and the security groups, and returns the tasks. If subnets are not provided, it uses the default subnets.
type ResourceGetter ¶
type ResourceGetter interface {
GetResourcesByTags(resourceType string, tags map[string]string) ([]*resourcegroups.Resource, error)
}
ResourceGetter gets resources by tags.
type Task ¶ added in v0.3.0
Task represents a one-off workload that runs until completed or an error occurs.
type TaskEventsLogger ¶ added in v0.3.0
type TaskEventsLogger interface {
TaskLogEvents(logGroupName string,
streamLastEventTime map[string]int64,
opts ...cloudwatchlogs.GetLogEventsOpts) (*cloudwatchlogs.LogEventsOutput, error)
}
TaskEventsLogger gets a log group's log events.
type TaskRunner ¶
type TaskRunner interface {
RunTask(input ecs.RunTaskInput) ([]*ecs.Task, error)
}
TaskRunner runs the tasks and wait for it to start.